Skip to content

Commit 380537b

Browse files
Lin Zhangdavem330
authored andcommitted
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: Lin Zhang <xiaolou4617@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent d433b3f commit 380537b

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

net/ipv6/exthdrs_core.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,6 @@ int ipv6_find_hdr(const struct sk_buff *skb, unsigned int *offset,
187187
{
188188
unsigned int start = skb_network_offset(skb) + sizeof(struct ipv6hdr);
189189
u8 nexthdr = ipv6_hdr(skb)->nexthdr;
190-
unsigned int len;
191190
bool found;
192191

193192
if (fragoff)
@@ -204,7 +203,6 @@ int ipv6_find_hdr(const struct sk_buff *skb, unsigned int *offset,
204203
start = *offset + sizeof(struct ipv6hdr);
205204
nexthdr = ip6->nexthdr;
206205
}
207-
len = skb->len - start;
208206

209207
do {
210208
struct ipv6_opt_hdr _hdr, *hp;
@@ -273,7 +271,6 @@ int ipv6_find_hdr(const struct sk_buff *skb, unsigned int *offset,
273271

274272
if (!found) {
275273
nexthdr = hp->nexthdr;
276-
len -= hdrlen;
277274
start += hdrlen;
278275
}
279276
} while (!found);

0 commit comments

Comments
 (0)