diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-06-04 14:49:08 -0700 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-06-04 14:49:08 -0700 |
commit | 77fb131b888bafd815722ebdceb5282b43dbb96d (patch) | |
tree | 0283ce68eec27ca421f086188ed180b3356199b0 | |
parent | 8b37e2224a3dd35bce0c295312ec2ca4ce3faf44 (diff) | |
download | vyatta-cfg-77fb131b888bafd815722ebdceb5282b43dbb96d.tar.gz vyatta-cfg-77fb131b888bafd815722ebdceb5282b43dbb96d.zip |
Make sure interface name regex are anchored
This solves the problem that 'show interfaces ethernet' also
shows pseudo ethernet (peth0) device. The problem was that peth0
matched the regex since it was missing start/end.
-rwxr-xr-x | lib/Vyatta/Interface.pm | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/lib/Vyatta/Interface.pm b/lib/Vyatta/Interface.pm index d81497b..96429c0 100755 --- a/lib/Vyatta/Interface.pm +++ b/lib/Vyatta/Interface.pm @@ -56,26 +56,26 @@ use constant { # path: configuration level below interfaces # vif: places to look for vif (if any) my %net_prefix = ( - 'adsl[\d]+' => { path => 'adsl', + '^adsl[\d]+$' => { path => 'adsl', vif => 'vif', }, - 'bond[\d]+' => { path => 'bonding', + '^bond[\d]+$' => { path => 'bonding', vif => 'vif', }, - 'br[\d]+' => { path => 'bridge', + '^br[\d]+$' => { path => 'bridge', vif => 'vif' }, - 'eth[\d]+' => { path => 'ethernet', + '^eth[\d]+$' => { path => 'ethernet', vif => 'vif', }, - 'lo' => { path => 'loopback' }, - 'ml[\d]+' => { path => 'multilink', + '^lo$' => { path => 'loopback' }, + '^ml[\d]+$' => { path => 'multilink', vif => 'vif', }, - 'vtun[\d]+' => { path => 'openvpn' }, - 'wan[\d]+' => { path => 'serial', + '^vtun[\d]+$' => { path => 'openvpn' }, + '^wan[\d]+$' => { path => 'serial', vif => ( 'cisco-hdlc vif', 'ppp vif', 'frame-relay vif' ), }, - 'tun[\d]+' => { path => 'tunnel' }, - 'wlm[\d]+' => { path => 'wireless-modem' }, - 'peth[\d]+' => { path => 'pseudo-ethernet', + '^tun[\d]+$' => { path => 'tunnel' }, + '^wlm[\d]+$' => { path => 'wireless-modem' }, + '^peth[\d]+$' => { path => 'pseudo-ethernet', vif => 'vif', }, - 'wlan[\d]+' => { path => 'wireless', vif => 'vif' }, + '^wlan[\d]+$' => { path => 'wireless', vif => 'vif' }, ); # get list of interface types |