[ros-diffs] [cgutman] 54915: [DHCPCSVC] - Remove timeouts associated with the protocol in remove_protocol()

cgutman at svn.reactos.org cgutman at svn.reactos.org
Thu Jan 12 02:11:03 UTC 2012


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/dhcp/dispatch.c?rev=54915&r1=54914&r2=54915&view=diff
==============================================================================
--- 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) {




More information about the Ros-diffs mailing list