summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJouke Witteveen <j.witteveen@gmail.com>2015-01-06 18:53:54 +0100
committerJouke Witteveen <j.witteveen@gmail.com>2015-01-12 22:08:40 +0100
commit4892bac89bd22f065d8d91beb7e0b4b2002b7b5b (patch)
tree1064d5b293945fe138e37ea1ffbd0bb4f3c4e44a /src
parent9c5c435f6240c0293ad01c34e1e4c4b224fffea2 (diff)
downloadnetctl-4892bac89bd22f065d8d91beb7e0b4b2002b7b5b.tar.gz
netctl-4892bac89bd22f065d8d91beb7e0b4b2002b7b5b.tar.xz
Start DHCPv6 after DAD (FS#43183)
We need our link-local address to not be tentative. After DHCPv6 we do not need to do DAD again, as it is part of DHCPv6 per RFT 3315, section 18.1.8.
Diffstat (limited to 'src')
-rw-r--r--src/lib/ip28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/lib/ip b/src/lib/ip
index b7847a2..f0dec69 100644
--- a/src/lib/ip
+++ b/src/lib/ip
@@ -45,7 +45,7 @@ ip_set() {
# Load ipv6 module if necessary
case "$IP6" in
- dhcp*|stateless|static)
+ dhcp|dhcp-noaddr|stateless|static)
[[ -d "/proc/sys/net/ipv6" ]] || modprobe ipv6
sysctl -q -w "net.ipv6.conf.$interface_sysctl.disable_ipv6=0"
[[ $IP6 == "static" ]]
@@ -100,20 +100,15 @@ ip_set() {
fi
fi
- case "$IP6" in
- dhcp|dhcp-noaddr)
- dhcp_call "${DHCP6Client:-dhclient}" start 6 ${IP6:5} || return
- ;;
- stateless|static)
- for addr in "${Address6[@]}"; do
- if ! do_debug ip -6 addr add $addr $(is_yes "${SkipDAD:-no}" && printf nodad) dev "$Interface"; then
- report_error "Could not add address '$addr' to interface '$Interface'"
- fi
- done
- ;;
- esac
-
if [[ $IP6 ]]; then
+ if [[ $IP6 == @(stateless|static) ]]; then
+ for addr in "${Address6[@]}"; do
+ if ! do_debug ip -6 addr add $addr $(is_yes "${SkipDAD:-no}" && printf nodad) dev "$Interface"; then
+ report_error "Could not add address '$addr' to interface '$Interface'"
+ fi
+ done
+ fi
+
if ! is_yes "${SkipDAD:-no}"; then
# Wait for Duplicate Address Detection to finish
if ! timeout_wait "${TimeoutDAD:-3}" '[[ -z "$(ip -6 addr show dev "$Interface" tentative)" ]]'; then
@@ -122,6 +117,11 @@ ip_set() {
fi
fi
+ # Start a DHCPv6 client after DAD has finished for the link-local address
+ if [[ $IP6 == @(dhcp|dhcp-noaddr) ]]; then
+ dhcp_call "${DHCP6Client:-dhclient}" start 6 ${IP6:5} || return
+ fi
+
# Add static IPv6 routes after DAD has finished
for route in "${Routes6[@]}"; do
if ! do_debug ip -6 route add $route dev "$Interface"; then