提交 380537b4 编写于 作者: L Lin Zhang 提交者: David S. Miller

net: ipv6: remove unused code in ipv6_find_hdr()

Storing the left length of skb into 'len' actually has no effect
so we can remove it.
Signed-off-by: NLin Zhang <xiaolou4617@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 d433b3f3
...@@ -187,7 +187,6 @@ int ipv6_find_hdr(const struct sk_buff *skb, unsigned int *offset, ...@@ -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); unsigned int start = skb_network_offset(skb) + sizeof(struct ipv6hdr);
u8 nexthdr = ipv6_hdr(skb)->nexthdr; u8 nexthdr = ipv6_hdr(skb)->nexthdr;
unsigned int len;
bool found; bool found;
if (fragoff) if (fragoff)
...@@ -204,7 +203,6 @@ int ipv6_find_hdr(const struct sk_buff *skb, unsigned int *offset, ...@@ -204,7 +203,6 @@ int ipv6_find_hdr(const struct sk_buff *skb, unsigned int *offset,
start = *offset + sizeof(struct ipv6hdr); start = *offset + sizeof(struct ipv6hdr);
nexthdr = ip6->nexthdr; nexthdr = ip6->nexthdr;
} }
len = skb->len - start;
do { do {
struct ipv6_opt_hdr _hdr, *hp; struct ipv6_opt_hdr _hdr, *hp;
...@@ -273,7 +271,6 @@ int ipv6_find_hdr(const struct sk_buff *skb, unsigned int *offset, ...@@ -273,7 +271,6 @@ int ipv6_find_hdr(const struct sk_buff *skb, unsigned int *offset,
if (!found) { if (!found) {
nexthdr = hp->nexthdr; nexthdr = hp->nexthdr;
len -= hdrlen;
start += hdrlen; start += hdrlen;
} }
} while (!found); } while (!found);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册