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
Showing
2 changed files
with
8 additions
and
5 deletions
... | @@ -583,19 +583,22 @@ public class VTNManager implements VTNService { | ... | @@ -583,19 +583,22 @@ public class VTNManager implements VTNService { |
583 | .behaviour(BridgeConfig.class); | 583 | .behaviour(BridgeConfig.class); |
584 | Collection<BridgeDescription> bridgeDescriptions = bridgeConfig | 584 | Collection<BridgeDescription> bridgeDescriptions = bridgeConfig |
585 | .getBridges(); | 585 | .getBridges(); |
586 | - Set<PortNumber> ports = bridgeConfig.getPortNumbers(); | ||
587 | Iterator<BridgeDescription> it = bridgeDescriptions | 586 | Iterator<BridgeDescription> it = bridgeDescriptions |
588 | .iterator(); | 587 | .iterator(); |
589 | - if (it.hasNext()) { | 588 | + while (it.hasNext()) { |
590 | BridgeDescription sw = it.next(); | 589 | BridgeDescription sw = it.next(); |
590 | + if (sw.bridgeName().name().equals(VtnConfig.DEFAULT_BRIDGE_NAME)) { | ||
591 | + List<Port> ports = deviceService.getPorts(sw.deviceId()); | ||
591 | ports.stream() | 592 | ports.stream() |
592 | - .filter(p -> p.name() | 593 | + .filter(p -> p.annotations().value(AnnotationKeys.PORT_NAME) |
593 | .equalsIgnoreCase(tunnelName)) | 594 | .equalsIgnoreCase(tunnelName)) |
594 | .forEach(p -> { | 595 | .forEach(p -> { |
595 | l2ForwardService.programTunnelOut(sw.deviceId(), | 596 | l2ForwardService.programTunnelOut(sw.deviceId(), |
596 | - segmentationId, p, | 597 | + segmentationId, p.number(), |
597 | dstMac, type, ipAddress); | 598 | dstMac, type, ipAddress); |
598 | }); | 599 | }); |
600 | + break; | ||
601 | + } | ||
599 | } | 602 | } |
600 | }); | 603 | }); |
601 | } | 604 | } | ... | ... |
... | @@ -37,7 +37,7 @@ import org.onosproject.net.driver.DriverHandler; | ... | @@ -37,7 +37,7 @@ import org.onosproject.net.driver.DriverHandler; |
37 | */ | 37 | */ |
38 | public final class VtnConfig { | 38 | public final class VtnConfig { |
39 | 39 | ||
40 | - private static final String DEFAULT_BRIDGE_NAME = "br-int"; | 40 | + public static final String DEFAULT_BRIDGE_NAME = "br-int"; |
41 | private static final String DEFAULT_TUNNEL = "vxlan-0.0.0.0"; | 41 | private static final String DEFAULT_TUNNEL = "vxlan-0.0.0.0"; |
42 | private static final Map<String, String> DEFAULT_TUNNEL_OPTIONS = new HashMap<String, String>() { | 42 | private static final Map<String, String> DEFAULT_TUNNEL_OPTIONS = new HashMap<String, String>() { |
43 | { | 43 | { | ... | ... |
-
Please register or login to post a comment