From 8faaec7b1b9bd034449348b693c5216e349a04ec Mon Sep 17 00:00:00 2001 From: John Southworth Date: Thu, 30 Aug 2012 17:32:44 -0700 Subject: Bugfix 6967: Test if an address is already applied to an interface before attempting to apply it --- scripts/vyatta-address | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/vyatta-address b/scripts/vyatta-address index 94fb1c59..a0c374e6 100755 --- a/scripts/vyatta-address +++ b/scripts/vyatta-address @@ -18,9 +18,13 @@ case $1 in exec /opt/vyatta/sbin/vyatta-dhcpv6-client.pl --start -ifname "$2" elif [[ "$3" =~ ":" ]] then # Ipv6 address - exec ip -6 addr add "$3" dev "$2" + if ! ip -6 addr list dev $2 | grep -q $3; then + exec ip -6 addr add "$3" dev "$2" + fi else - exec ip addr add "$3" broadcast + dev "$2" + if ! ip addr list dev $2 | grep -q $3; then + exec ip addr add "$3" broadcast + dev "$2" + fi fi ;; delete) -- cgit v1.2.3