2 # Copyright (c) 2012 OpenWrt.org
4 .
/lib
/netifd
/netifd-proto.sh
10 resolve_network network
"$device"
13 [ -z "$network" ] && exit 0
15 if [ "$state" == "started" ]; then
17 set_forward_border
"$network" "$device" enable
20 conf_set
"$device" accept_ra
2
21 conf_set
"$device" forwarding
2
23 # Send RS on interface
24 [ -x /usr
/sbin
/6relayd
] && /usr
/sbin
/6relayd
-s "$device"
27 elif [ "$state" == "stopped" ]; then
29 conf_set
"$device" accept_ra
1
30 conf_set
"$device" forwarding
1
33 set_forward_border
"$network" "$device" disable
39 for prefix
in $PREFIXES; do
40 announce_prefix
"$prefix" "$network" "$device"
43 for prefix
in $PREFIXES_LOST; do
44 announce_prefix
"$prefix" "$network" "$device" delprefix
48 # Enable relaying if requested and we didn't get a prefix, disable otherwise
50 [ -z "$PREFIXES" -a "$state" != "unbound" ] && fallback
="start"
51 setup_prefix_fallback
"$fallback" "$network" "$device"
54 # Operations in case of success
55 [ "$state" == "timeout" -o "$state" == "unbound" ] && exit 0
57 # Handshake completed, disable forwarding border
58 set_forward_border
"$network" "$device" disable
61 config_get_bool peerdns
"$network" peerdns
1
62 [ "$peerdns" -eq "1" ] && {
63 proto_init_update
"*" 1
65 for server
in $RDNSS; do
66 proto_add_dns_server
"$server"
68 for domain
in $DOMAINS; do
69 proto_add_dns_search
"$domain"
71 proto_send_update
"$network"