summaryrefslogtreecommitdiffhomepage
path: root/dummy/netifd-proto.sh
diff options
context:
space:
mode:
Diffstat (limited to 'dummy/netifd-proto.sh')
-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"