slirp: Add a special case for the NULL socket

NULL sockets are used for NDP, BOOTP, and other critical operations.
If the topmost mbuf in a NULL session is blocked pending resolution,
it may cause problems if it blocks other packets with a NULL socket.
So do not add mbufs with a NULL socket field to the same session.

Signed-off-by: Kevin Cernekee <cernekee@chromium.org>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
This commit is contained in:
Kevin Cernekee 2017-09-20 13:42:05 -07:00 committed by Samuel Thibault
parent e2aad34d73
commit 13146a8395

View file

@ -73,14 +73,16 @@ if_output(struct socket *so, struct mbuf *ifm)
* We mustn't put this packet back on the fastq (or we'll send it out of order) * We mustn't put this packet back on the fastq (or we'll send it out of order)
* XXX add cache here? * XXX add cache here?
*/ */
for (ifq = (struct mbuf *) slirp->if_batchq.qh_rlink; if (so) {
(struct quehead *) ifq != &slirp->if_batchq; for (ifq = (struct mbuf *) slirp->if_batchq.qh_rlink;
ifq = ifq->ifq_prev) { (struct quehead *) ifq != &slirp->if_batchq;
if (so == ifq->ifq_so) { ifq = ifq->ifq_prev) {
/* A match! */ if (so == ifq->ifq_so) {
ifm->ifq_so = so; /* A match! */
ifs_insque(ifm, ifq->ifs_prev); ifm->ifq_so = so;
goto diddit; ifs_insque(ifm, ifq->ifs_prev);
goto diddit;
}
} }
} }