mirror of
https://github.com/opennetworkinglab/onos.git
synced 2025-10-16 09:51:38 +02:00
Fix: allow to specify duplicated gateways for different subnets
Change-Id: I846b045c346ca328744803c2e72a5a549a95f860
This commit is contained in:
parent
581f21a1c0
commit
8e365bdab1
@ -277,6 +277,21 @@ public final class OpenstackSwitchingArpHandler {
|
|||||||
private void setFakeGatewayArpRule(Subnet osSubnet, boolean install, OpenstackNode osNode) {
|
private void setFakeGatewayArpRule(Subnet osSubnet, boolean install, OpenstackNode osNode) {
|
||||||
|
|
||||||
if (ARP_BROADCAST_MODE.equals(getArpMode())) {
|
if (ARP_BROADCAST_MODE.equals(getArpMode())) {
|
||||||
|
|
||||||
|
// do not remove fake gateway ARP rules, if there is another gateway
|
||||||
|
// which has the same subnet that to be removed
|
||||||
|
// this only occurs if we have duplicated subnets associated with
|
||||||
|
// different networks
|
||||||
|
if (!install) {
|
||||||
|
long numOfDupGws = osNetworkService.subnets().stream()
|
||||||
|
.filter(s -> !s.getId().equals(osSubnet.getId()))
|
||||||
|
.filter(s -> s.getGateway().equals(osSubnet.getGateway()))
|
||||||
|
.count();
|
||||||
|
if (numOfDupGws > 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
String gateway = osSubnet.getGateway();
|
String gateway = osSubnet.getGateway();
|
||||||
|
|
||||||
TrafficSelector selector = DefaultTrafficSelector.builder()
|
TrafficSelector selector = DefaultTrafficSelector.builder()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user