summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorFlorian Obser <florian@cvs.openbsd.org>2017-05-31 07:30:33 +0000
committerFlorian Obser <florian@cvs.openbsd.org>2017-05-31 07:30:33 +0000
commitdd0b5e62287589d555650551b8bf300f4b6c23c4 (patch)
tree1207d039240299602c97023b6160df1a7782b3b9 /usr.sbin
parentbba0bb1b1b6ccbfceb333ae5bc905bf2212f193f (diff)
do not leak address and dfr proposals if an interface goes away
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/slaacd/engine.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/usr.sbin/slaacd/engine.c b/usr.sbin/slaacd/engine.c
index 6ecd6cb2f0e..c43bfc4c708 100644
--- a/usr.sbin/slaacd/engine.c
+++ b/usr.sbin/slaacd/engine.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: engine.c,v 1.36 2017/05/31 07:14:58 florian Exp $ */
+/* $OpenBSD: engine.c,v 1.37 2017/05/31 07:30:32 florian Exp $ */
/*
* Copyright (c) 2017 Florian Obser <florian@openbsd.org>
@@ -847,6 +847,8 @@ remove_slaacd_iface(uint32_t if_index)
{
struct slaacd_iface *iface, *tiface;
struct radv *ra;
+ struct address_proposal *addr_proposal;
+ struct dfr_proposal *dfr_proposal;
LIST_FOREACH_SAFE (iface, &slaacd_interfaces, entries, tiface) {
if (iface->if_index == if_index) {
@@ -856,6 +858,19 @@ remove_slaacd_iface(uint32_t if_index)
LIST_REMOVE(ra, entries);
free_ra(ra);
}
+ /* XXX inform netcfgd? */
+ while(!LIST_EMPTY(&iface->addr_proposals)) {
+ addr_proposal =
+ LIST_FIRST(&iface->addr_proposals);
+ LIST_REMOVE(addr_proposal, entries);
+ free(addr_proposal);
+ }
+ while(!LIST_EMPTY(&iface->dfr_proposals)) {
+ dfr_proposal =
+ LIST_FIRST(&iface->dfr_proposals);
+ LIST_REMOVE(dfr_proposal, entries);
+ free(dfr_proposal);
+ }
free(iface);
break;
}