Summary: Updated Ethernet regex for vlan-tagged "p1p1.2" style interfaces

Detail: Checks for other Ethernet interface names uses startsWith(),
whereas the p1p1 style interface uses a regex that doesn't allow for
tailing characters, and so blocks vlan IDs. Fixed.

BUG-ID: CLOUDSTACK-4884
Bugfix-for: 4.2.1
Reviewed-by:
Reported-by:
Signed-off-by: John Kinsella <jlk@stratosec.co> 1381965250 -0700
This commit is contained in:
John Kinsella 2013-10-16 16:14:10 -07:00
parent fc6c1ec812
commit c10ee5dde4

View File

@ -1040,7 +1040,7 @@ ServerResource {
s_logger.debug("matchPifFileInDirectory: file name '"+fname+"'");
if (fname.startsWith("eth") || fname.startsWith("bond")
|| fname.startsWith("vlan") || fname.startsWith("em")
|| fname.matches("^p\\d+p\\d+")) {
|| fname.matches("^p\\d+p\\d+.*")) {
return fname;
}
}