Commit bcca0a02 authored by Jouke Witteveen's avatar Jouke Witteveen
Browse files

Add option to bypass Duplicate Address Detection

After several requests, here is SkipDAD to bypass Duplicate Address
Detection.
parent 05959bbb
......@@ -180,16 +180,16 @@ network. In particular, these connection types are +ethernet+,
Maximum time, in seconds, to wait for IPv6's Duplicate Address
Detection to succeed. Defaults to `++3++'.
'SkipDAD='::
Whether or not to bypass Duplicate Address Detection altogether.
Defaults to `++no++'.
OPTIONS FOR `ethernet' CONNECTIONS
----------------------------------
Next to the *ip options*, the following are understood for connections
of the `ethernet' type:
'SkipNoCarrier='::
Whether or not the absence of a carrier (plugged-in cable) is
acceptable. Defaults to `++no++'.
'Auth8021X='::
Set to `++yes++' to use 802.1x authentication.
......@@ -209,6 +209,10 @@ of the `ethernet' type:
Maximum time, in seconds, to wait for 802.1x authentication to
succeed. Defaults to `++15++'.
'SkipNoCarrier='::
Whether or not the absence of a carrier (plugged-in cable) is
acceptable. Defaults to `++no++'.
OPTIONS FOR `wireless' CONNECTIONS
----------------------------------
......
......@@ -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)"
......
......@@ -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
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment