summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2009-04-28 22:50:27 -0700
committerStephen Hemminger <stephen.hemminger@vyatta.com>2009-04-28 22:50:27 -0700
commite4e05713a76c31ba4edbb252e6f5fa0f59b13837 (patch)
tree136b866ca3b0429dc91e4ca456906d6777bbf808 /scripts
parent7d181bfaafd262f95bcf13e1c358a043ee6c685c (diff)
downloadvyatta-cfg-e4e05713a76c31ba4edbb252e6f5fa0f59b13837.tar.gz
vyatta-cfg-e4e05713a76c31ba4edbb252e6f5fa0f59b13837.zip
Catch incorrect address format
Don't just silently exit on incorrect address format. At least print an error
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/vyatta-interfaces.pl8
1 files changed, 3 insertions, 5 deletions
diff --git a/scripts/vyatta-interfaces.pl b/scripts/vyatta-interfaces.pl
index c4e5c4e..5574462 100755
--- a/scripts/vyatta-interfaces.pl
+++ b/scripts/vyatta-interfaces.pl
@@ -233,9 +233,8 @@ sub update_eth_addrs {
return;
}
my $version = is_ip_v4_or_v6($addr);
- if (!defined $version) {
- exit 1;
- }
+ die "Unknown address not IPV4 or IPV6" unless $version;
+
if (is_ip_configured($intf, $addr)) {
#
# treat this as informational, don't fail
@@ -250,8 +249,7 @@ sub update_eth_addrs {
if ($version == 6) {
return system("ip -6 addr add $addr dev $intf");
}
- print "Error: Invalid address/prefix [$addr] for interface $intf\n";
- exit 1;
+ die "Error: Invalid address/prefix [$addr] for interface $intf\n";
}
sub delete_eth_addrs {