diff options
author | John Southworth <john.southworth@vyatta.com> | 2012-08-30 17:32:44 -0700 |
---|---|---|
committer | John Southworth <john.southworth@vyatta.com> | 2012-08-30 17:32:44 -0700 |
commit | 8faaec7b1b9bd034449348b693c5216e349a04ec (patch) | |
tree | 095da2281e8d5e03373b48debeeddd14991d9d67 /scripts/vyatta-address | |
parent | b1db793cc89a00afca627b9419c24e4315b77a84 (diff) | |
download | vyatta-cfg-system-8faaec7b1b9bd034449348b693c5216e349a04ec.tar.gz vyatta-cfg-system-8faaec7b1b9bd034449348b693c5216e349a04ec.zip |
Bugfix 6967: Test if an address is already applied to an interface before attempting to apply it
Diffstat (limited to 'scripts/vyatta-address')
-rwxr-xr-x | scripts/vyatta-address | 8 |
1 files 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) |