Skip to content

Commit

Permalink
net: ipv6: remove unused code in ipv6_find_hdr()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Lin Zhang authored and David S. Miller committed Oct 6, 2017
1 parent d433b3f commit 380537b
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions net/ipv6/exthdrs_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 380537b

Please sign in to comment.