Fix for Bug3644 - Same labels for route in diff vpns
Overlapping IPs in separate VPNs were assigned same label based on
nexthopip. Fix modifies the way label is created using key as rd+nexthopip
info
Change-Id: I4a0717c0c3f69975284294be7af445b380f409bc
Signed-off-by: Abhinav Gupta <abhi3123@gmail.com>
(cherry picked from commit
7ece688c41702efe0c4e4c5b8be0785f4622848c)
public static final short FIB_TABLE = 21;
public static final short DEFAULT_FLOW_PRIORITY = 10;
public static final long INVALID_ID = -1;
public static final short FIB_TABLE = 21;
public static final short DEFAULT_FLOW_PRIORITY = 10;
public static final long INVALID_ID = -1;
+ public static final String SEPARATOR = ".";
LOG.trace("NextHops are {}", nextHops);
for (Adjacency nextHop : nextHops) {
LOG.trace("NextHops are {}", nextHops);
for (Adjacency nextHop : nextHops) {
- String key = nextHop.getIpAddress();
+ String key = rd + VpnConstants.SEPARATOR + nextHop.getIpAddress();
long label = getUniqueId(key);
value.add(new AdjacencyBuilder(nextHop).setLabel(label).build());
}
long label = getUniqueId(key);
value.add(new AdjacencyBuilder(nextHop).setLabel(label).build());
}
InstanceIdentifier<VpnInterface> interfaceId = VpnUtil.getVpnInterfaceIdentifier(intfName);
syncWrite(LogicalDatastoreType.OPERATIONAL, interfaceId, opInterface, DEFAULT_CALLBACK);
for (Adjacency nextHop : nextHops) {
InstanceIdentifier<VpnInterface> interfaceId = VpnUtil.getVpnInterfaceIdentifier(intfName);
syncWrite(LogicalDatastoreType.OPERATIONAL, interfaceId, opInterface, DEFAULT_CALLBACK);
for (Adjacency nextHop : nextHops) {
- String key = nextHop.getIpAddress();
+ String key = rd + VpnConstants.SEPARATOR + nextHop.getIpAddress();
long label = getUniqueId(key);
updatePrefixToBGP(rd, nextHop, nextHopIp, label);
}
long label = getUniqueId(key);
updatePrefixToBGP(rd, nextHop, nextHopIp, label);
}
label = nextHop.getLabel();
if(label == VpnConstants.INVALID_ID) {
//Generate label using ID Manager
label = nextHop.getLabel();
if(label == VpnConstants.INVALID_ID) {
//Generate label using ID Manager
- label = getUniqueId(nextHop.getIpAddress());
+ String key = newRd + VpnConstants.SEPARATOR + nextHop.getIpAddress();
+ label = getUniqueId(key);
}
removePrefixFromBGP(rd, nextHop);
//updatePrefixToBGP(newRd, nextHop, nextHopIp, label);
}
removePrefixFromBGP(rd, nextHop);
//updatePrefixToBGP(newRd, nextHop, nextHopIp, label);