Skip to content

Commit cb0a24e

Browse files
committed
Fix: do not add/remove SNAT rules when receiving FLAT vport events
Change-Id: Ib30a5d376bcb08b9a6eec595dee49b6607a8f07b
1 parent 8ac677c commit cb0a24e

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackRoutingSnatHandler.java

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1459,8 +1459,14 @@ private void processGatewayCompletion(OpenstackNode osNode) {
14591459
}
14601460

14611461
if (getStatefulSnatFlag() && osNode.type() == GATEWAY) {
1462-
instancePortService.instancePorts().forEach(instPort ->
1463-
setGatewayToInstanceDownstreamRule(osNode, instPort, true));
1462+
instancePortService.instancePorts().forEach(instPort -> {
1463+
Type netType = osNetworkAdminService.networkType(instPort.networkId());
1464+
1465+
if (netType == FLAT) {
1466+
return;
1467+
}
1468+
setGatewayToInstanceDownstreamRule(osNode, instPort, true);
1469+
});
14641470
}
14651471
}
14661472

@@ -1470,8 +1476,15 @@ private void processGatewayRemoval(OpenstackNode osNode) {
14701476
}
14711477

14721478
if (getStatefulSnatFlag() && osNode.type() == GATEWAY) {
1473-
instancePortService.instancePorts().forEach(instPort ->
1474-
setGatewayToInstanceDownstreamRule(osNode, instPort, false));
1479+
instancePortService.instancePorts().forEach(instPort -> {
1480+
Type netType = osNetworkAdminService.networkType(instPort.networkId());
1481+
1482+
if (netType == FLAT) {
1483+
return;
1484+
}
1485+
1486+
setGatewayToInstanceDownstreamRule(osNode, instPort, false);
1487+
});
14751488
}
14761489
}
14771490

0 commit comments

Comments
 (0)