summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2009-08-12 21:17:10 -0700
committerStephen Hemminger <stephen.hemminger@vyatta.com>2009-08-12 21:17:10 -0700
commit10a869acbf23193c20c33a783a907fdc6a8a70f5 (patch)
tree15d66cfe0e8d36c9cdd0b318731bf47f9555370e /lib
parentecd1018636b82242d7827d301723d15a12d10949 (diff)
downloadvyatta-cfg-10a869acbf23193c20c33a783a907fdc6a8a70f5.tar.gz
vyatta-cfg-10a869acbf23193c20c33a783a907fdc6a8a70f5.zip
Skip wmaster interface in operational commands
Ignore the bogus wmaster interface
Diffstat (limited to 'lib')
-rwxr-xr-xlib/Vyatta/Misc.pm10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/Vyatta/Misc.pm b/lib/Vyatta/Misc.pm
index 5852e84..091e49f 100755
--- a/lib/Vyatta/Misc.pm
+++ b/lib/Vyatta/Misc.pm
@@ -93,11 +93,17 @@ sub generate_dhclient_intf_files {
}
+# get list of interfaces on the system via sysfs
+# skip dot files (and any interfaces name .xxx)
+# and bond_masters file used by bonding
+# and pseudo-interface wmaster used by wireless (will disappear in 2.6.32)
sub getInterfaces {
opendir( my $sys_class, '/sys/class/net' )
or die "can't open /sys/class/net: $!";
- my @interfaces =
- grep { ( !/^\./ ) && ( $_ ne 'bonding_masters' ) } readdir $sys_class;
+ my @interfaces = grep { ( !/^\./ ) &&
+ ( $_ ne 'bonding_masters' ) &&
+ ! ( $_ =~ '^wmaster\d+$')
+ } readdir $sys_class;
closedir $sys_class;
return @interfaces;
}