Fixed potential NPE in packet-stats for ipv4 tcp packets
Change-Id: I6b649a689a4e9d7ed1519e7d8f6dd2a4846758ee
(cherry picked from commit 18ee33c43f5b410234442fb2ccb025b30f3509c5)
diff --git a/apps/packet-stats/app/src/main/java/org/onosproject/packetstats/PacketStatistics.java b/apps/packet-stats/app/src/main/java/org/onosproject/packetstats/PacketStatistics.java
index abf0f0e..ddac4a4 100644
--- a/apps/packet-stats/app/src/main/java/org/onosproject/packetstats/PacketStatistics.java
+++ b/apps/packet-stats/app/src/main/java/org/onosproject/packetstats/PacketStatistics.java
@@ -145,6 +145,10 @@
metricService.createCounter(packetStatisticsComponent, lldpFeature, "lldpPC");
this.vlanCounter =
metricService.createCounter(packetStatisticsComponent, vlanFeature, "vlanPC");
+ this.tcpCounter =
+ metricService.createCounter(packetStatisticsComponent, tcpFeature, "tcpPC");
+ this.rarpCounter =
+ metricService.createCounter(packetStatisticsComponent, rarpFeature, "rarpPC");
this.icmpCounter =
metricService.createCounter(packetStatisticsComponent, icmpFeature, "icmpPC");
this.icmp6Counter =
@@ -249,4 +253,4 @@
}
}
}
-}
\ No newline at end of file
+}