interfaceIdentifier);
if (!optionalInf.isPresent()) {
wrtConfigTxn.put(interfaceIdentifier, inf);
+ } else if (isInterfaceUpdated(inf, optionalInf.get())) {
+ /*
+ Case where an update DTCN wasn't received by this class due to node going down
+ upon cluster reboot or any other unknown reason
+ In such a case, updates contained in the missed DTCN won't be processed and have to be handled
+ explicitly
+ Update of subports (vlanId, splithorizon tag) is handled here
+ Update of portSecurity (PortSecurityEnabled, SecurityGroups, AllowedAddressPairs) add is handled
+ Update of portSecurity update/removed is not handled
+ Update of parentrefs is not handled as parentrefs updation is handled by IFM Oxygen onwards
+ */
+ wrtConfigTxn.put(interfaceIdentifier, inf);
+ LOG.error("Interface {} is already present and is updated", infName);
} else {
LOG.warn("Interface {} is already present", infName);
}
return infName;
}
+ // Not for generic use. For a special case where update DTCN isn't received
+ private static boolean isInterfaceUpdated(Interface newInterface, Interface oldInterface) {
+ if (newInterface.augmentation(SplitHorizon.class) != null) {
+ if (oldInterface.augmentation(SplitHorizon.class) == null) {
+ return true;
+ }
+ if (!newInterface.augmentation(SplitHorizon.class).equals(oldInterface
+ .augmentation(SplitHorizon.class))) {
+ return true;
+ }
+ }
+ if (!newInterface.augmentation(IfL2vlan.class).equals(oldInterface.augmentation(IfL2vlan.class))) {
+ return true;
+ }
+ if (newInterface.augmentation(InterfaceAcl.class) != null && oldInterface
+ .augmentation(InterfaceAcl.class) == null) {
+ return true;
+ }
+ return false;
+ }
+
private Interface createInterface(Port port) {
String interfaceName = port.getUuid().getValue();
IfL2vlan.L2vlanMode l2VlanMode = IfL2vlan.L2vlanMode.Trunk;