summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2010-11-29 16:53:42 -0800
committerStephen Hemminger <stephen.hemminger@vyatta.com>2010-11-29 16:53:42 -0800
commitf790ecbc1151161be94f83f2a30258ff32ecfef9 (patch)
tree7edd84f0972d001a1204c9f40759221dd38266c4 /scripts
parenta82b23badec73f6da6cff5337b5ebf18856b39b6 (diff)
downloadvyatta-cfg-system-f790ecbc1151161be94f83f2a30258ff32ecfef9.tar.gz
vyatta-cfg-system-f790ecbc1151161be94f83f2a30258ff32ecfef9.zip
Fix interface scanning on boot - allow more mac addresses
The code to match on locally assigned bit had a bad regex. Use conversion to hex and mask instead. Also don't allow multicast address bit.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/system/vyatta_interface_rescan12
1 files changed, 8 insertions, 4 deletions
diff --git a/scripts/system/vyatta_interface_rescan b/scripts/system/vyatta_interface_rescan
index bdc8fd67..a33f8ee9 100755
--- a/scripts/system/vyatta_interface_rescan
+++ b/scripts/system/vyatta_interface_rescan
@@ -45,11 +45,15 @@ my %whitelist = (
sub persistent_address {
my $mac = shift;
- # is local assignment bit (IEEE802) not set?
- return 1 unless ($mac =~ /^.[2367abef]:/);
+ return if ($mac eq '00:00:00:00:00:00'); # zero address is reserved
- # is address bogus?
- return if ($mac eq '00:00:00:00:00:00');
+ # get first octet
+ return unless ($mac =~ /^([0-9a-f][0-9a-f]):/);
+ my $oct0 = hex($1);
+
+ return if ($oct0 & 0x1); # skip it is a multicast address
+
+ return 1 unless ($oct0 & 0x2); # this is good, not locally assigned
# unless it is in whitelist, it is non persistent
$mac =~ /^([0-9a-f][0-9a-f]:[0-9a-f][0-9a-f]:[0-9a-f][0-9a-f])/;