2 [ -z "$2" ] && echo "Error: should be run by odhcpc6c" && exit 1
4 . /lib/netifd/netifd-proto.sh
7 echo "$3" > "/proc/sys/net/ipv6/conf/$1/$2"
10 # RFC 6204 requires us to block forwarding until address acquisition is complete
11 ipv6_block_forwarding() {
12 ip6tables "-$2" forwarding_rule -o "$1" -j REJECT --reject-with no-route 2>/dev/null
18 ipv6_block_forwarding "$device" A
20 ipv6_conf "$device" accept_ra 2
21 ipv6_conf "$device" forwarding 2
24 [ -x /usr/sbin/6relayd ] && /usr/sbin/6relayd -s "$device"
29 ipv6_conf "$device" accept_ra 1
30 ipv6_conf "$device" forwarding 1
31 ipv6_block_forwarding "$device" D
36 ipv6_block_forwarding "$device" D
38 proto_init_update "*" 1
41 proto_add_dns_server "$dns"
44 for domain in $DOMAINS; do
45 proto_add_dns_search "$domain"
48 for prefix in $PREFIXES; do
49 proto_add_ipv6_prefix "$prefix"
52 proto_send_update "$INTERFACE"
54 # TODO: $SNTP_IP $SIP_IP $SNTP_FQDN $SIP_DOMAIN
57 teardown_interface() {
58 proto_init_update "*" 0
59 proto_send_update "$INTERFACE"
64 prepare_interface "$1"
67 cleanup_interface "$1"
69 informed|bound|updated|rebound)
73 teardown_interface "$1"
78 [ -f /etc/odhcp6c.user ] && . /etc/odhcp6c.user