提交 953e7f54 编写于 作者: J Jan Kiszka

slirp: Prevent recursion of if_start

if_start can be called recursively via if_encap. Avoid this as our
scheme of dequeuing packets is not compatible with this.

CC: Fabien Chouteau <chouteau@adacore.com>
CC: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
CC: Stefan Weil <sw@weilnetz.de>
Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com>
上级 d6536b2c
......@@ -163,10 +163,17 @@ void if_start(Slirp *slirp)
DEBUG_CALL("if_start");
if (slirp->if_start_busy) {
return;
}
slirp->if_start_busy = true;
while (slirp->if_queued) {
/* check if we can really output */
if (!slirp_can_output(slirp->opaque))
if (!slirp_can_output(slirp->opaque)) {
slirp->if_start_busy = false;
return;
}
/*
* See which queue to get next packet from
......@@ -221,4 +228,6 @@ void if_start(Slirp *slirp)
}
slirp->if_queued = requeued;
slirp->if_start_busy = false;
}
......@@ -239,6 +239,7 @@ struct Slirp {
struct mbuf if_fastq; /* fast queue (for interactive data) */
struct mbuf if_batchq; /* queue for non-interactive data */
struct mbuf *next_m; /* pointer to next mbuf to output */
bool if_start_busy; /* avoid if_start recursion */
/* ip states */
struct ipq ipq; /* ip reass. queue */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册