]> git.puffer.fish Git - mirror/frr.git/commitdiff
lib: Tweak to if_delete_retain()
authorJosh Bailey <joshb@google.com>
Wed, 21 Mar 2012 17:37:03 +0000 (10:37 -0700)
committerAvneesh Sachdev <avneesh@opensourcerouting.org>
Sun, 8 Apr 2012 08:18:41 +0000 (01:18 -0700)
  * lib/if.c: Change if_delete_retain() to delete all connected
    addresses, but to not free the list that holds them. Free the list
    just before the interface structure itself is freed, in
    if_delete().

lib/if.c

index 86f754b6b3edbec6dbc76d9e794e1538e7939dd0..e9ef50b76d121a194ca9b04c9c8ac2db87893a8f 100644 (file)
--- a/lib/if.c
+++ b/lib/if.c
@@ -146,7 +146,7 @@ if_delete_retain (struct interface *ifp)
     (*if_master.if_delete_hook) (ifp);
 
   /* Free connected address list */
-  list_delete (ifp->connected);
+  list_delete_all_node (ifp->connected);
 }
 
 /* Delete and free interface structure. */
@@ -157,6 +157,8 @@ if_delete (struct interface *ifp)
 
   if_delete_retain(ifp);
 
+  list_free (ifp->connected);
+
   XFREE (MTYPE_IF, ifp);
 }