diff options
author | Stephen Hemminger <shemminger@vyatta.com> | 2011-05-09 09:35:34 -0700 |
---|---|---|
committer | Stephen Hemminger <shemminger@vyatta.com> | 2011-05-09 09:35:34 -0700 |
commit | 8528e99ba95c33aeffd8285162fa009b5aa4f240 (patch) | |
tree | f3e1b3be67cc9cf241ca4eb349b8b52de19a2f21 /scripts | |
parent | bdba1ac96e48e5d3b4cfa0b31ebafa1f8255787f (diff) | |
download | vyatta-cfg-quagga-8528e99ba95c33aeffd8285162fa009b5aa4f240.tar.gz vyatta-cfg-quagga-8528e99ba95c33aeffd8285162fa009b5aa4f240.zip |
Convert mac octets from hex
Bug 7063
Need to convert MAC octets from hex to numeric before doing
math operations.
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/vyatta-interfaces.pl | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/vyatta-interfaces.pl b/scripts/vyatta-interfaces.pl index 30b35c05..26f2791a 100755 --- a/scripts/vyatta-interfaces.pl +++ b/scripts/vyatta-interfaces.pl @@ -255,10 +255,10 @@ sub is_valid_mac { ($#octets == 5) or die "Error: wrong number of octets: $#octets\n"; - (($octets[0] & 1) == 0) or die "Error: $mac is a multicast address\n"; + ((hex($octets[0]) & 1) == 0) or die "Error: $mac is a multicast address\n"; my $sum = 0; - $sum += strtoul('0x' . $_) foreach @octets; + $sum += hex( $_) foreach @octets; ( $sum != 0 ) or die "Error: zero is not a valid address\n"; exit 0; |