From b7500cc99fc758fa190d212624934b76c2c1f9ce Mon Sep 17 00:00:00 2001 From: Subash Abhinov Kasiviswanathan Date: Thu, 9 Nov 2017 17:32:52 -0700 Subject: [PATCH] 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 --- net/rmnet_data/rmnet_map_data.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/net/rmnet_data/rmnet_map_data.c b/net/rmnet_data/rmnet_map_data.c index 2d68c027d697..1c0f1060eebc 100644 --- a/net/rmnet_data/rmnet_map_data.c +++ b/net/rmnet_data/rmnet_map_data.c @@ -753,18 +753,18 @@ int rmnet_ul_aggregation_skip(struct sk_buff *skb, int offset) 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; } }