From 69c459578e3b10f7caa2b82a304e728e31969ca5 Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Fri, 6 Jul 2007 18:03:17 +0000 Subject: [PATCH] Add and delete IPv6 addresses and routes correctly on FreeBSD, #184430 thanks to Friedrich Oslage. --- ChangeLog | 5 +++++ net.BSD/ifconfig.sh | 14 ++++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index ae62c339..d7e92d3a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,11 @@ # ChangeLog for Gentoo System Intialization ("rc") scripts # Copyright 1999-2007 Gentoo Foundation; Distributed under the GPLv2 + 06 Jul 2007; Roy Marples : + + Add and delete IPv6 addresses and routes correctly on FreeBSD, #184430 + thanks to Friedrich Oslage. + 02 Jul 2007; Roy Marples : Don't wait for services that were inactive, #183667 thanks to Daniel Drake 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