net: ipv6: remove unused code in ipv6_find_hdr()
authorLin Zhang <xiaolou4617@gmail.com>
Thu, 5 Oct 2017 18:07:08 +0000 (02:07 +0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 6 Oct 2017 04:53:02 +0000 (21:53 -0700)
Storing the left length of skb into 'len' actually has no effect
so we can remove it.

Signed-off-by: Lin Zhang <xiaolou4617@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/exthdrs_core.c

index 115d60919f72c7c83298bb10d05684ac304cb2fa..11025f8d124b86be72d51f9aa934ad1c85e04626 100644 (file)
@@ -187,7 +187,6 @@ int ipv6_find_hdr(const struct sk_buff *skb, unsigned int *offset,
 {
        unsigned int start = skb_network_offset(skb) + sizeof(struct ipv6hdr);
        u8 nexthdr = ipv6_hdr(skb)->nexthdr;
-       unsigned int len;
        bool found;
 
        if (fragoff)
@@ -204,7 +203,6 @@ int ipv6_find_hdr(const struct sk_buff *skb, unsigned int *offset,
                start = *offset + sizeof(struct ipv6hdr);
                nexthdr = ip6->nexthdr;
        }
-       len = skb->len - start;
 
        do {
                struct ipv6_opt_hdr _hdr, *hp;
@@ -273,7 +271,6 @@ int ipv6_find_hdr(const struct sk_buff *skb, unsigned int *offset,
 
                if (!found) {
                        nexthdr = hp->nexthdr;
-                       len -= hdrlen;
                        start += hdrlen;
                }
        } while (!found);