From: Ning Zhang Date: Fri, 20 Sep 2019 09:03:18 +0000 (+0800) Subject: Manage Acl For Existing TrafficTable Throwing Exception X-Git-Tag: release/magnesium~61 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=5a8cc558a8b885c8bb8dd08063d90e3b364ab96a;p=netvirt.git Manage Acl For Existing TrafficTable Throwing Exception Issue Description: ================= Elan id may be null, calling the intValue() must throws NPE. ERROR: java.lang.NullPointerException: null at org.opendaylight.netvirt.aclservice.utils.AclServiceUtils.createCtMarkInstructionForNewState(AclServiceUtils.java:1284) at org.opendaylight.netvirt.aclservice.AbstractAclServiceImpl.programAclForExistingTrafficTable(AbstractAclServiceImpl.java:481) Solution: ================ Determine that the Elan id cannot be null before define ActionNxConntrack Change-Id: I48a67f75f8ef73c1e44babc324157b9a85560512 Signed-off-by: Ning Zhang --- diff --git a/aclservice/impl/src/main/java/org/opendaylight/netvirt/aclservice/AbstractAclServiceImpl.java b/aclservice/impl/src/main/java/org/opendaylight/netvirt/aclservice/AbstractAclServiceImpl.java index 15cc7eac8b..65645cbcf7 100644 --- a/aclservice/impl/src/main/java/org/opendaylight/netvirt/aclservice/AbstractAclServiceImpl.java +++ b/aclservice/impl/src/main/java/org/opendaylight/netvirt/aclservice/AbstractAclServiceImpl.java @@ -496,6 +496,11 @@ public abstract class AbstractAclServiceImpl implements AclServiceListener { private void programAclForExistingTrafficTable(AclInterface port, Ace ace, int addOrRemove, String flowName, List matches, Integer priority) { + if (port == null || port.getElanId() == null) { + LOG.debug("Acl interface or elan id is null, No need to update traffic flow table."); + return; + } + AceIp acl = (AceIp) ace.getMatches().getAceType(); final String newFlowName = flowName + this.directionString + "_" + port.getDpId() + "_" + port.getLPortTag() + "_" + (acl.getAceIpVersion() instanceof AceIpv4 ? "_IPv4" : "_IPv6") + "_FlowAfterRuleDeleted";