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
26 ipv6_conf "$device" accept_ra 1
27 ipv6_conf "$device" forwarding 1
28 ipv6_block_forwarding "$device" D
33 ipv6_block_forwarding "$device" D
35 proto_init_update "*" 1
38 proto_add_dns_server "$dns"
41 for domain in $DOMAINS; do
42 proto_add_dns_search "$domain"
45 for prefix in $PREFIXES; do
46 proto_add_ipv6_prefix "$prefix"
49 proto_send_update "$INTERFACE"
51 # TODO: $SNTP_IP $SIP_IP $SNTP_FQDN $SIP_DOMAIN
54 teardown_interface() {
55 proto_init_update "*" 0
56 proto_send_update "$INTERFACE"
61 prepare_interface "$1"
64 cleanup_interface "$1"
66 informed|bound|updated|rebound)
70 teardown_interface "$1"
75 [ -f /etc/odhcp6c.user ] && . /etc/odhcp6c.user