From 02e1b0f723cde8b4117cabd9cf1557094a5a3ed8 Mon Sep 17 00:00:00 2001 From: gardners Date: Sat, 14 Apr 2012 10:14:43 +0930 Subject: [PATCH] fixed bugs in dequeuing (or lack thereof) of broadcast frames and unicast frames at the right time. --- overlay_interface.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/overlay_interface.c b/overlay_interface.c index 6a3a630c..335e7ee1 100644 --- a/overlay_interface.c +++ b/overlay_interface.c @@ -774,25 +774,24 @@ int overlay_tick_interface(int i, long long now) while ((*p)&&(*p!=pax[j])) p=&(*p)->next; /* skip any broadcast frames that still have live interfaces left to send via */ - while (*p) { - if ((*p)->isBroadcast) { + if (p&&(*p)&&(*p)->isBroadcast) + while (p&&(*p)&&((*p)->isBroadcast)) { int i; int workLeft=0; for(i=0;i0) if (!(*p)->broadcast_sent_via[i]) - { if (0) fprintf(stderr,"Frame still needs to be sent on interface #%d\n",i); + { if (1) fprintf(stderr,"Frame still needs to be sent on interface #%d\n",i); workLeft=1; break; } } if (!workLeft) { - if (debug&DEBUG_BROADCASTS) - WHY("Leaving broadcast payload on the queue for other interfaces"); + if (1||debug&DEBUG_BROADCASTS) + WHY("Dequeueing broadcast frame that has been fully distributed"); break; } + p=&(*p)->next; } - p=&(*p)->next; - } /* Now get rid of this frame once we have found it */ if (*p) { if (debug&DEBUG_QUEUES) @@ -817,7 +816,7 @@ int overlay_tick_interface(int i, long long now) } overlay_tx[q].length--; } - } + } } return 0; }