@Override
public boolean updateAcl(AclInterface portBefore, AclInterface portAfter) {
+ // this check is to avoid situations of port update coming before interface state is up
+ if (portAfter.getDpId() == null || portAfter.getLPortTag() == null) {
+ LOG.debug("Unable to find DpId from ACL interface with id {} and lport {}", portAfter.getInterfaceId(),
+ portAfter.getLPortTag());
+ return false;
+ }
boolean result = true;
boolean isPortSecurityEnable = portAfter.getPortSecurityEnabled();
boolean isPortSecurityEnableBefore = portBefore.getPortSecurityEnabled();
@Override
public boolean applyAce(AclInterface port, String aclName, Ace ace) {
- if (!port.isPortSecurityEnabled()) {
+ if (!port.isPortSecurityEnabled() || port.getDpId() == null) {
return false;
}
programAceRule(port, NwConstants.ADD_FLOW, aclName, ace, null);
@Override
public boolean removeAce(AclInterface port, String aclName, Ace ace) {
- if (!port.isPortSecurityEnabled()) {
+ if (!port.isPortSecurityEnabled() || port.getDpId() == null) {
return false;
}
programAceRule(port, NwConstants.DEL_FLOW, aclName, ace, null);
}
private void updateRemoteAclTableForMultipleAcls(AclInterface port, int addOrRemove, String ignorePort) {
- BigInteger dpId = port.getDpId();
- if (dpId == null) {
- LOG.warn("trying to write to null dpnId");
- return;
- }
for (Uuid aclUuid : port.getSecurityGroups()) {
if (aclDataUtil.getRemoteAcl(aclUuid) == null) {
continue;