ONOS-6489 - Code submitted to facilitate installation of flow rules (via FlowObjective and ofdpa drivers) per port in case of IN_PORT "ALL"

Change-Id: I5fd001220c16cabb3a853f1fd8297f9e0a7decab
diff --git a/drivers/default/src/main/java/org/onosproject/driver/pipeline/ofdpa/Ofdpa2Pipeline.java b/drivers/default/src/main/java/org/onosproject/driver/pipeline/ofdpa/Ofdpa2Pipeline.java
index 9800260..1158b7e 100644
--- a/drivers/default/src/main/java/org/onosproject/driver/pipeline/ofdpa/Ofdpa2Pipeline.java
+++ b/drivers/default/src/main/java/org/onosproject/driver/pipeline/ofdpa/Ofdpa2Pipeline.java
@@ -543,7 +543,7 @@
         // ofdpa cannot match on ALL portnumber, so we need to use separate
         // rules for each port.
         List<PortNumber> portnums = new ArrayList<>();
-        if (portCriterion.port() == PortNumber.ALL) {
+        if (portCriterion != null && PortNumber.ALL.equals(portCriterion.port())) {
             for (Port port : deviceService.getPorts(deviceId)) {
                 if (port.number().toLong() > 0 && port.number().toLong() < OFPP_MAX) {
                     portnums.add(port.number());
@@ -601,7 +601,7 @@
                                                  VlanId assignedVlan,
                                                  ApplicationId applicationId) {
         // Consider PortNumber.ANY as wildcard. Match ETH_DST only
-        if (portCriterion != null && portCriterion.port() == PortNumber.ANY) {
+        if (portCriterion != null && PortNumber.ANY.equals(portCriterion.port())) {
             return processEthDstOnlyFilter(ethCriterion, applicationId);
         }
 
@@ -617,7 +617,7 @@
         // ofdpa cannot match on ALL portnumber, so we need to use separate
         // rules for each port.
         List<PortNumber> portnums = new ArrayList<>();
-        if (portCriterion.port() == PortNumber.ALL) {
+        if (portCriterion != null && PortNumber.ALL.equals(portCriterion.port())) {
             for (Port port : deviceService.getPorts(deviceId)) {
                 if (port.number().toLong() > 0 && port.number().toLong() < OFPP_MAX) {
                     portnums.add(port.number());