summaryrefslogtreecommitdiffhomepage
path: root/dummy
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2013-01-08 18:52:32 +0100
committerFelix Fietkau <nbd@openwrt.org>2013-01-15 11:12:53 +0100
commitd7f7f002e3d168aedb5f2bc92180f5966482d7d9 (patch)
tree05b56547fd087c3865416e290d7e8289d41f2860 /dummy
parent9908adbd9a31c92f13b05f0c057d4429edbc5184 (diff)
Initial IPv6 prefix support
Signed-off-by: Steven Barth <steven@midlink.org>
Diffstat (limited to 'dummy')
-rwxr-xr-xdummy/netifd-proto.sh15
1 files changed, 15 insertions, 0 deletions
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"