From d7f7f002e3d168aedb5f2bc92180f5966482d7d9 Mon Sep 17 00:00:00 2001 From: Steven Barth Date: Tue, 8 Jan 2013 18:52:32 +0100 Subject: Initial IPv6 prefix support Signed-off-by: Steven Barth --- dummy/netifd-proto.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'dummy') diff --git a/dummy/netifd-proto.sh b/dummy/netifd-proto.sh index dba6cc4..323322b 100755 --- a/dummy/netifd-proto.sh +++ b/dummy/netifd-proto.sh @@ -58,6 +58,7 @@ proto_init_update() { PROTO_IP6ADDR= PROTO_ROUTE= PROTO_ROUTE6= + PROTO_PREFIX6= PROTO_DNS= PROTO_DNS_SEARCH= json_init @@ -141,6 +142,19 @@ proto_add_ipv6_route() { append PROTO_ROUTE6 "$target/$mask/$gw" } +proto_add_ipv6_prefix() { + local prefix="$1" + local valid="$2" + local preferred="$3" + + if [ -z "$valid" ]; then + append PROTO_PREFIX6 "$prefix" + else + [ -z "$preferred" ] && preferred="$valid" + append PROTO_PREFIX6 "$prefix,$valid,$preferred" + fi +} + _proto_push_ipv4_addr() { local str="$1" local address mask broadcast ptp @@ -221,6 +235,7 @@ proto_send_update() { _proto_push_array "ip6addr" "$PROTO_IP6ADDR" _proto_push_ipv6_addr _proto_push_array "routes" "$PROTO_ROUTE" _proto_push_route _proto_push_array "routes6" "$PROTO_ROUTE6" _proto_push_route + _proto_push_array "ip6prefix" "$PROTO_PREFIX6" _proto_push_string _proto_push_array "dns" "$PROTO_DNS" _proto_push_string _proto_push_array "dns_search" "$PROTO_DNS_SEARCH" _proto_push_string _proto_notify "$interface" -- cgit v1.2.3