diff --git a/src/connections/ethernet b/src/connections/ethernet index 1c527ee..755c22c 100644 --- a/src/connections/ethernet +++ b/src/connections/ethernet @@ -123,16 +123,6 @@ ethernet_up() { ;; esac - if [[ -n "$IPCFG" ]]; then - for line in "${IPCFG[@]}"; do - - report_debug ethernet_iproute_up ip "$line" - if ! ip $line; then - report_iproute "Could not configure interface ($line)." - fi - done - fi - # Load ipv6 module if necessary (FS#25530) case "$IP6" in dhcp*|stateless|static) @@ -189,6 +179,9 @@ ethernet_up() { # Add static IPv6 routes if [[ -n "$ROUTES6" ]]; then + if ! wait_dad; then + report_iproute "Duplicate Address Detection is taking too long" + fi for route in "${ROUTES6[@]}"; do report_debug ethernet_iproute_up ip -6 route add "$route" dev "$INTERFACE" if ! ip -6 route add "$route" dev "$INTERFACE"; then @@ -199,6 +192,16 @@ ethernet_up() { ;; esac + if [[ -n "$IPCFG" ]]; then + wait_dad # Not fatal + for line in "${IPCFG[@]}"; do + report_debug ethernet_up ip "$line" + if ! ip $line; then + report_iproute "Could not configure interface ($line)." + fi + done + fi + # Set hostname if [[ -n "$HOSTNAME" ]]; then report_debug ethernet_iproute_up hostname "$HOSTNAME" @@ -275,6 +278,16 @@ stop_80211x() { fi } +wait_dad() +{ + local t + for ((t=${DAD_TIMEOUT:-3}; t > 0; t--)); do + sleep 1 + [[ -z "$(ip -6 addr show tentative dev "$INTERFACE")" ]] && return 0 + done + return 1 +} + ethernet_$1 "$2" exit $? # vim: set ts=4 et sw=4: