[DHCPCSVC]

- Remove timeouts associated with the protocol in remove_protocol()

svn path=/branches/wlan-bringup/; revision=54915
This commit is contained in:
Cameron Gutman 2012-01-12 02:11:02 +00:00
parent 6a5a77ea59
commit 8828d269af

View file

@ -352,6 +352,43 @@ void
remove_protocol(struct protocol *proto)
{
struct protocol *p, *next, *prev;
struct interface_info *ip = proto->local;
struct timeout *t, *q, *u;
t = NULL;
q = timeouts;
while (q != NULL)
{
/* Remove all timeouts for this protocol */
if (q->what == ip)
{
/* Unlink the timeout from previous */
if (t)
t->next = q->next;
else
timeouts = q->next;
DbgPrint("Disposing timeout 0x%x\n", q);
/* Advance to the next timeout */
u = q->next;
/* Add it to the free list */
q->next = free_timeouts;
free_timeouts = q;
}
else
{
/* Advance to the next timeout */
u = q->next;
/* Update the previous pointer */
t = q;
}
/* Advance */
q = u;
}
prev = NULL;
for (p = protocols; p; p = next) {