summaryrefslogtreecommitdiffhomepage
path: root/interface-ip.c
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2013-10-18 14:18:32 +0200
committerSteven Barth <steven@midlink.org>2013-10-18 14:18:32 +0200
commitb08f841685bf67b3f4f8cc3e8f667c80878916a8 (patch)
treeb54bb7bfcadbcf057d1134e4487b3bcbff6d8106 /interface-ip.c
parente93c42c036c4b4df1f65f261def31cf1a429e942 (diff)
Add option "delegate" to toggle prefix delegation
Diffstat (limited to 'interface-ip.c')
-rw-r--r--interface-ip.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/interface-ip.c b/interface-ip.c
index 60902f9..2280266 100644
--- a/interface-ip.c
+++ b/interface-ip.c
@@ -920,7 +920,9 @@ interface_update_prefix(struct vlist_tree *tree,
} else if (node_new) {
// Set null-route to avoid routing loops
system_add_route(NULL, &route);
- interface_update_prefix_assignments(prefix_new, true);
+
+ if (!prefix_new->iface || !prefix_new->iface->proto_ip.no_delegation)
+ interface_update_prefix_assignments(prefix_new, true);
} else if (node_old) {
// Remove null-route
interface_update_prefix_assignments(prefix_old, false);
@@ -928,11 +930,12 @@ interface_update_prefix(struct vlist_tree *tree,
}
if (node_old) {
- list_del(&prefix_old->head);
+ if (prefix_old->head.next)
+ list_del(&prefix_old->head);
free(prefix_old);
}
- if (node_new)
+ if (node_new && (!prefix_new->iface || !prefix_new->iface->proto_ip.no_delegation))
list_add(&prefix_new->head, &prefixes);
}