Author: cgutman Date: Thu Jan 12 02:11:02 2012 New Revision: 54915
URL: http://svn.reactos.org/svn/reactos?rev=54915&view=rev Log: [DHCPCSVC] - Remove timeouts associated with the protocol in remove_protocol()
Modified: branches/wlan-bringup/dll/win32/dhcpcsvc/dhcp/dispatch.c
Modified: branches/wlan-bringup/dll/win32/dhcpcsvc/dhcp/dispatch.c URL: http://svn.reactos.org/svn/reactos/branches/wlan-bringup/dll/win32/dhcpcsvc/... ============================================================================== --- branches/wlan-bringup/dll/win32/dhcpcsvc/dhcp/dispatch.c [iso-8859-1] (original) +++ branches/wlan-bringup/dll/win32/dhcpcsvc/dhcp/dispatch.c [iso-8859-1] Thu Jan 12 02:11:02 2012 @@ -352,6 +352,43 @@ 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) {