diff options
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/Vyatta/Misc.pm | 10 |
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; } |