From 1dd23ef9398433b38c488b6ef24660a8931be870 Mon Sep 17 00:00:00 2001 From: Jouke Witteveen Date: Wed, 8 Aug 2012 12:27:33 +0200 Subject: Set the IPv6 gateway after DAD Using gateways for which NDP used to discover routes during the latency of netcfg no longer works (https://bbs.archlinux.org/viewtopic.php?id=145923). Such routes can now be added manually. --- src/connections/ethernet | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/connections/ethernet b/src/connections/ethernet index adb34e3..00079fc 100644 --- a/src/connections/ethernet +++ b/src/connections/ethernet @@ -29,7 +29,6 @@ ethernet_up() { report_debug ethernet_up bring_interface up "$INTERFACE" bring_interface up "$INTERFACE" - if ! checkyesno "${SKIPNOCARRIER:-no}"; then # Some cards are plain slow to come up. Don't fail immediately. if ! timeout_wait "${CARRIER_TIMEOUT:-5}" '(( $(< "/sys/class/net/$INTERFACE/carrier") ))'; then @@ -37,6 +36,7 @@ ethernet_up() { fi fi + if checkyesno "${AUTH8021X:-no}"; then . "$SUBR_DIR/8021x" [[ -z "$WPA_CONF" ]] && WPA_CONF="/etc/wpa_supplicant.conf" @@ -139,7 +139,7 @@ ethernet_up() { return 1 fi sysctl -q -w "net.ipv6.conf.$SYSCTL_INTERFACE.accept_ra=1" - if [[ "$IP6" = "dhcp-noaddr" ]]; then + if [[ "$IP6" == "dhcp-noaddr" ]]; then DHCLIENT6_OPTIONS="-S ${DHCLIENT6_OPTIONS}" fi _DHCLIENT_PIDFILE="/run/dhclient6-${INTERFACE}.pid" @@ -164,12 +164,6 @@ ethernet_up() { fi done fi - if [[ -n "$GATEWAY6" ]]; then - report_debug ethernet_up ip -6 route replace default via "$GATEWAY6" dev "$INTERFACE" - if ! ip -6 route replace default via "$GATEWAY6" dev "$INTERFACE"; then - report_iproute "Adding gateway $GATEWAY6 failed" - fi - fi ;; esac @@ -189,6 +183,14 @@ ethernet_up() { fi done fi + + # Set a custom gateway after waiting for DAD to finish + if [[ "$IP6" == "static" && -n "$GATEWAY6" ]]; then + report_debug ethernet_up ip -6 route replace default via "$GATEWAY6" dev "$INTERFACE" + if ! ip -6 route replace default via "$GATEWAY6" dev "$INTERFACE"; then + report_iproute "Adding gateway $GATEWAY6 failed" + fi + fi fi if [[ -n "$IPCFG" ]]; then -- cgit v1.2.3-24-g4f1b