summaryrefslogtreecommitdiffhomepage
path: root/ubus.c
diff options
context:
space:
mode:
authorHans Dedecker <dedeckeh@gmail.com>2017-01-31 16:46:15 +0100
committerFelix Fietkau <nbd@nbd.name>2017-02-11 21:51:36 +0100
commitcdc0e80300a465d507aba8e8d11be56366ebb6cd (patch)
tree0a7ce90bfa9fb152713011235a6775970fca5b83 /ubus.c
parent6397f5edb977b5963aa8eec1deaa709355bbbc7d (diff)
interface: add prefix assignment priority support
In case of prefix delegation prefixes are assigned to one or more configured downstream interfaces. The delegated prefix length in combination with the assignment length of the downstream interfaces determines the number of subnets which can be allocated from the delegated prefix. The interface ip6weight parameter allows to prioritize the allocation of subnets to interfaces in case of multiple configured downstream interfaces. The order of interface prefix assignment from a delegated prefix is based on the following parameters: - Primary key is prefix assignment based on the configured interface ip6hint - Secondary key is the requested downstream interface prefix length, interfaces configured with the smallest ip6hint will be assigned first - Third key is the assigned interface ip6weight in case of equal prefix assignment length; interfaces having the highest ip6weight will be assigned first - Finally the alphabetical order of the interfaces in case of equal ip6weight Signed-off-by: Hans Dedecker <dedeckeh@gmail.com> Signed-off-by: Felix Fietkau <nbd@nbd.name> [cleanup]
Diffstat (limited to 'ubus.c')
-rw-r--r--ubus.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/ubus.c b/ubus.c
index 66f714a..1b1a4cd 100644
--- a/ubus.c
+++ b/ubus.c
@@ -698,6 +698,8 @@ netifd_dump_status(struct interface *iface)
blobmsg_add_u32(&b, "metric", iface->metric);
blobmsg_add_u32(&b, "dns_metric", iface->dns_metric);
blobmsg_add_u8(&b, "delegation", !iface->proto_ip.no_delegation);
+ if (iface->assignment_weight)
+ blobmsg_add_u32(&b, "ip6weight", iface->assignment_weight);
a = blobmsg_open_array(&b, "ipv4-address");
interface_ip_dump_address_list(&iface->config_ip, false, true);
interface_ip_dump_address_list(&iface->proto_ip, false, true);