From bcca0a027786c0d23f3f70c9f21b3332f41786e1 Mon Sep 17 00:00:00 2001 From: Jouke Witteveen Date: Thu, 27 Feb 2014 12:48:12 +0100 Subject: Add option to bypass Duplicate Address Detection After several requests, here is SkipDAD to bypass Duplicate Address Detection. --- src/lib/connections/ethernet | 4 +++- src/lib/ip | 12 +++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) (limited to 'src/lib') diff --git a/src/lib/connections/ethernet b/src/lib/connections/ethernet index 3db69a0..ce00dc3 100644 --- a/src/lib/connections/ethernet +++ b/src/lib/connections/ethernet @@ -19,7 +19,9 @@ ethernet_up() { return 1 fi - if ! is_yes "${SkipNoCarrier:-no}"; then + if is_yes "${SkipNoCarrier:-no}"; then + SkipDAD=yes + else # Some cards are plain slow to come up. Don't fail immediately. if ! timeout_wait "${TimeoutCarrier:-5}" '(( $(< "/sys/class/net/$Interface/carrier") ))'; then report_error "No connection found on interface '$Interface' (timeout)" diff --git a/src/lib/ip b/src/lib/ip index a93eaee..4698595 100644 --- a/src/lib/ip +++ b/src/lib/ip @@ -117,7 +117,7 @@ ip_set() { ;; stateless|static) for addr in "${Address6[@]}"; do - if ! do_debug ip -6 addr add $addr dev "$Interface"; then + 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 @@ -125,10 +125,12 @@ ip_set() { esac if [[ $IP6 ]]; then - # Wait for Duplicate Address Detection to finish - if ! timeout_wait "${TimeoutDAD:-3}" '[[ -z "$(ip -6 addr show dev "$Interface" tentative)" ]]'; then - report_error "Duplicate Address Detection is taking too long on interface '$Interface'" - return 1 + 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 + report_error "Duplicate Address Detection is taking too long on interface '$Interface'" + return 1 + fi fi # Add static IPv6 routes after DAD has finished -- cgit v1.2.3-24-g4f1b