summaryrefslogtreecommitdiffstats
path: root/src/connections/ethernet
diff options
context:
space:
mode:
authorJouke Witteveen <j.witteveen@gmail.com>2012-08-08 12:27:33 +0200
committerJouke Witteveen <j.witteveen@gmail.com>2012-08-08 13:16:31 +0200
commit1dd23ef9398433b38c488b6ef24660a8931be870 (patch)
tree274b01c3a5e9d97038e3cf5df28a57f5e664ab3e /src/connections/ethernet
parentec0fb097b62d5861d382f56ce03246a51076bdfe (diff)
downloadnetctl-1dd23ef9398433b38c488b6ef24660a8931be870.tar.gz
netctl-1dd23ef9398433b38c488b6ef24660a8931be870.tar.xz
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.
Diffstat (limited to 'src/connections/ethernet')
-rw-r--r--src/connections/ethernet18
1 files 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