[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Minios-devel] [UNIKRAFT/LWIP PATCH] uknetdev_output: Fix loop iterator
Thanks a lot for this fix! Simon Reviewed-by: Simon Kuenzer <simon.kuenzer@xxxxxxxxx> On 18.02.19, 10:30, "Florian Schmidt" <Florian.Schmidt@xxxxxxxxx> wrote: Setting q to p->next leads to an infinite loop if p has at least two segments. The correct way is to iterate over q so we actually progress through the list. Signed-off-by: Florian Schmidt <florian.schmidt@xxxxxxxxx> --- uknetdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uknetdev.c b/uknetdev.c index 34394fc..47d2fb1 100644 --- a/uknetdev.c +++ b/uknetdev.c @@ -142,7 +142,7 @@ static err_t uknetdev_output(struct netif *nf, struct pbuf *p) * yet. As long as we do not have this, we have to copy. */ wpos = nb->data; - for (q = p; q != NULL; q = p->next) { + for (q = p; q != NULL; q = q->next) { memcpy(wpos, q->payload, q->len); wpos += q->len; } -- 2.20.1 _______________________________________________ Minios-devel mailing list Minios-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/minios-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |