lishuai
Committed by Gerrit Code Review

[ONOS-3606] update vtn's bug: if ovs has a plurality of bridge, the code

should filter br-int and get the ports via deviceService.

Change-Id: I3112f1fa5e72460fed77f03ad6cc21858d110276
......@@ -583,19 +583,22 @@ public class VTNManager implements VTNService {
.behaviour(BridgeConfig.class);
Collection<BridgeDescription> bridgeDescriptions = bridgeConfig
.getBridges();
Set<PortNumber> ports = bridgeConfig.getPortNumbers();
Iterator<BridgeDescription> it = bridgeDescriptions
.iterator();
if (it.hasNext()) {
while (it.hasNext()) {
BridgeDescription sw = it.next();
if (sw.bridgeName().name().equals(VtnConfig.DEFAULT_BRIDGE_NAME)) {
List<Port> ports = deviceService.getPorts(sw.deviceId());
ports.stream()
.filter(p -> p.name()
.filter(p -> p.annotations().value(AnnotationKeys.PORT_NAME)
.equalsIgnoreCase(tunnelName))
.forEach(p -> {
l2ForwardService.programTunnelOut(sw.deviceId(),
segmentationId, p,
segmentationId, p.number(),
dstMac, type, ipAddress);
});
break;
}
}
});
}
......
......@@ -37,7 +37,7 @@ import org.onosproject.net.driver.DriverHandler;
*/
public final class VtnConfig {
private static final String DEFAULT_BRIDGE_NAME = "br-int";
public static final String DEFAULT_BRIDGE_NAME = "br-int";
private static final String DEFAULT_TUNNEL = "vxlan-0.0.0.0";
private static final Map<String, String> DEFAULT_TUNNEL_OPTIONS = new HashMap<String, String>() {
{
......