summaryrefslogtreecommitdiff
path: root/interface-ip.c
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2013-05-30 09:37:34 +0200
committerSteven Barth <steven@midlink.org>2013-05-30 09:37:34 +0200
commit91228b6efb36c8954e3d23c0801f54ee984d5a0a (patch)
tree95117114972c65d4d3d73027d9db5a8aac2e0a5f /interface-ip.c
parent717e8e2a6aa746b97d10b6bc38a1a4fbd46f9ba7 (diff)
downloadnetifd-91228b6efb36c8954e3d23c0801f54ee984d5a0a.tar.gz
IPv6: Log a warning if users have prefixes but haven't assigned them
Diffstat (limited to 'interface-ip.c')
-rw-r--r--interface-ip.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/interface-ip.c b/interface-ip.c
index b057fe5..b720eff 100644
--- a/interface-ip.c
+++ b/interface-ip.c
@@ -662,6 +662,7 @@ static void interface_update_prefix_assignments(struct device_prefix *prefix, bo
list_add(&c->head, &prefix->assignments);
}
+ bool assigned_any = false;
struct list_head assign_later = LIST_HEAD_INIT(assign_later);
vlist_for_each_element(&interfaces, iface, node) {
if (iface->config_ip.assignment_length < 48 ||
@@ -684,6 +685,9 @@ static void interface_update_prefix_assignments(struct device_prefix *prefix, bo
}
list_add_tail(&c->head, &assign_later);
}
+
+ if (c->assigned != -1)
+ assigned_any = true;
}
// Then try to assign all other + failed custom assignments
@@ -700,12 +704,18 @@ static void interface_update_prefix_assignments(struct device_prefix *prefix, bo
netifd_log_message(L_WARNING, "Failed to assign subprefix "
"of size %hhu for %s\n", c->length, c->name);
free(c);
+ } else {
+ assigned_any = true;
}
}
list_for_each_entry(c, &prefix->assignments, head)
if ((iface = vlist_find(&interfaces, c->name, iface, node)))
interface_set_prefix_address(c, prefix, iface, true);
+
+ if (!assigned_any)
+ netifd_log_message(L_WARNING, "You have delegated IPv6-prefixes but haven't assigned them "
+ "to any interface. Did you forget to set option ip6assign on your lan-interfaces?");
}