CLOUDSTACK-5280: fix issue in getBroadcastUriFromBridge

This commit is contained in:
Wei Zhou 2013-11-26 23:35:38 +01:00
parent 1fe8efc85f
commit 96842475d9
1 changed files with 2 additions and 2 deletions

View File

@ -1682,14 +1682,14 @@ ServerResource {
private String getBroadcastUriFromBridge(String brName) {
String pif= matchPifFileInDirectory(brName);
Pattern pattern = Pattern.compile("(\\D+)(\\d+)");
Pattern pattern = Pattern.compile("(\\D+)(\\d+)(\\D*)(\\d*)");
Matcher matcher = pattern.matcher(pif);
if(matcher.find()) {
if (brName.startsWith("brvx")){
return BroadcastDomainType.Vxlan.toUri(matcher.group(2)).toString();
}
else{
return BroadcastDomainType.Vlan.toUri(matcher.group(2)).toString();
return BroadcastDomainType.Vlan.toUri(matcher.group(4)).toString();
}
} else {
s_logger.debug("failed to get vNet id from bridge " + brName