net: rmnet_data: Optimize the UL aggregation skip logic

Optimize for the IPv6 normal ping case instead of the
fragmentation scenario. Also, check for IPv6 explicitly
rather than directly disecting the packet.

CRs-Fixed: 2131879
Change-Id: Idee5c7d52972d06aee6ac6d71ebd5d1c3c875f9f
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
diff --git a/net/rmnet_data/rmnet_map_data.c b/net/rmnet_data/rmnet_map_data.c
index 2d68c02..1c0f1060 100644
--- a/net/rmnet_data/rmnet_map_data.c
+++ b/net/rmnet_data/rmnet_map_data.c
@@ -753,18 +753,18 @@
 
 		if (ip4h->protocol == IPPROTO_ICMP)
 			is_icmp = 1;
-	} else {
+	} else if ((skb->data[offset]) >> 4 == 0x06) {
 		struct ipv6hdr *ip6h = (struct ipv6hdr *)(packet_start);
 
-		if (ip6h->nexthdr == NEXTHDR_FRAGMENT) {
+		if (ip6h->nexthdr == IPPROTO_ICMPV6) {
+			is_icmp = 1;
+		} else if (ip6h->nexthdr == NEXTHDR_FRAGMENT) {
 			struct frag_hdr *frag;
 
 			frag = (struct frag_hdr *)(packet_start
 						   + sizeof(struct ipv6hdr));
 			if (frag->nexthdr == IPPROTO_ICMPV6)
 				is_icmp = 1;
-		} else if (ip6h->nexthdr == IPPROTO_ICMPV6) {
-			is_icmp = 1;
 		}
 	}