summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Bailey <joshb@google.com>2012-03-21 10:37:03 -0700
committerAvneesh Sachdev <avneesh@opensourcerouting.org>2012-04-08 01:18:41 -0700
commit2dd04c5dc8b5a09cce1c251361fa58f26398fd9f (patch)
treea738ee1b46f7d346e05285677b6c4df9ba689b6d
parentaf56d404cd56d94ad3b2ec3f159650eb72baef0a (diff)
lib: Tweak to if_delete_retain()
* 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().
-rw-r--r--lib/if.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/if.c b/lib/if.c
index 86f754b6..e9ef50b7 100644
--- 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);
}