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
committerAn-Cheng Huang <ancheng@vyatta.com>2009-06-12 15:19:01 -0700
commit2cc732a1b1ddfc492eb047818be2a56167d2e446 (patch)
treeaeefcc6f541bf5421a121fc339a1afae6f262221 /lib/Vyatta/Interface.pm
parentb5253c5041a1fd0b45dbf992cb6c60df109d6927 (diff)
downloadvyatta-cfg-2cc732a1b1ddfc492eb047818be2a56167d2e446.tar.gz
vyatta-cfg-2cc732a1b1ddfc492eb047818be2a56167d2e446.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. (cherry picked from commit 77fb131b888bafd815722ebdceb5282b43dbb96d)
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