diff options
author | Roy Marples <roy@marples.name> | 2007-07-06 18:03:17 +0000 |
---|---|---|
committer | Roy Marples <roy@marples.name> | 2007-07-06 18:03:17 +0000 |
commit | 69c459578e3b10f7caa2b82a304e728e31969ca5 (patch) | |
tree | 222007e813652b9892ba89979016fe2ca99aa2b8 /net.BSD/ifconfig.sh | |
parent | 913b3b1f6baf1fefed9a0d2c5d1cdefa2c8cef8f (diff) |
Add and delete IPv6 addresses and routes correctly on FreeBSD, #184430
thanks to Friedrich Oslage.
Diffstat (limited to 'net.BSD/ifconfig.sh')
-rw-r--r-- | net.BSD/ifconfig.sh | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/net.BSD/ifconfig.sh b/net.BSD/ifconfig.sh index bfc10055..68a3875f 100644 --- a/net.BSD/ifconfig.sh +++ b/net.BSD/ifconfig.sh @@ -63,7 +63,10 @@ _add_address() { set -- "$@" metric ${metric} fi - ifconfig "${IFACE}" add "$@" + case "$@" in + *:*) ifconfig "${IFACE}" inet6 add "$@" ;; + *) ifconfig "${IFACE}" add "$@" ;; + esac } _add_route() { @@ -75,7 +78,10 @@ _add_route() { fi fi - route add "$@" + case "$@" in + *:*) route add -inet6 "$@" ;; + *) route add "$@" ;; + esac } _delete_addresses() { @@ -94,7 +100,7 @@ _delete_addresses() { [ "$1" = "lo" -o "$1" = "lo0" ] && continue fi einfo "${addr}" - /sbin/ifconfig "$1" delete "${addr}" + ifconfig "$1" delete "${addr}" eend $? done @@ -106,7 +112,7 @@ _delete_addresses() { ::1) continue ;; esac einfo "${addr}" - /sbin/ifconfig "${IFACE}" inet6 delete "${addr}" + ifconfig "${IFACE}" inet6 delete "${addr}" eend $? done |