summaryrefslogtreecommitdiff
path: root/lib/Vyatta/Interface.pm
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2009-06-04 14:49:08 -0700
committerStephen Hemminger <stephen.hemminger@vyatta.com>2009-06-04 14:49:08 -0700
commit77fb131b888bafd815722ebdceb5282b43dbb96d (patch)
tree0283ce68eec27ca421f086188ed180b3356199b0 /lib/Vyatta/Interface.pm
parent8b37e2224a3dd35bce0c295312ec2ca4ce3faf44 (diff)
downloadvyatta-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.
Diffstat (limited to 'lib/Vyatta/Interface.pm')
-rwxr-xr-xlib/Vyatta/Interface.pm24
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