1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2025-01-10 17:10:15 +02:00
openwrt-xburst/package/network/ipv6/ipv6-support/files/dhcpv6.sh
cyrus 9b62f5ffba ipv6-support:
* Automatically detect and propagate MTU from upstream interfaces
* Add site-border feature (RFC 6204, ULA-4)
* Fix a typo

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@34896 3c298f89-4303-0410-b956-a3cf2f4a3e73
2012-12-27 14:10:17 +00:00

49 lines
996 B
Bash
Executable File

#!/bin/sh
# Copyright (c) 2012 OpenWrt.org
. /lib/ipv6/support.sh
. /lib/netifd/netifd-proto.sh
local device="$1"
local state="$2"
local network=""
resolve_network network "$device"
# Unknown network
[ -z "$network" ] && exit 0
# Announce prefixes
for prefix in $PREFIXES; do
announce_prefix "$prefix" "$network" "$device"
done
for prefix in $PREFIXES_LOST; do
announce_prefix "$prefix" "$network" "$device" delprefix
done
# Enable relaying if requested
local fallback="stop"
[ -z "$PREFIXES" -a "$state" != "unbound" ] && fallback="start"
setup_prefix_fallback "$fallback" "$network" "$device"
# Operations in case of success
[ "$state" == "timeout" || "$state" == "unbound" ] && exit 0
local peerdns
config_get_bool peerdns "$network" peerdns 0
[ "$peerdns" -eq "1" ] && {
proto_init_update "*" 1
proto_set_keep 1
for server in $RDNSS; do
proto_add_dns_server "$server"
done
for domain in $DOMAINS; do
proto_add_dns_search "$domain"
done
proto_send_update "$network"
}