Skip to content

Commit

Permalink
ipv6: Use ipv6_authlen for len in ipv6_skip_exthdr
Browse files Browse the repository at this point in the history
In ipv6_skip_exthdr, the lengh of AH header is computed manually
as (hp->hdrlen+2)<<2. However, in include/linux/ipv6.h, a macro
named ipv6_authlen is already defined for exactly the same job. This
commit replaces the manual computation code with the macro.

Signed-off-by: Xiang Gao <qasdfgtyuiop@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Xiang Gao authored and David S. Miller committed Sep 20, 2017
1 parent 8ca712c commit d4e1b29
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/ipv6/exthdrs_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ int ipv6_skip_exthdr(const struct sk_buff *skb, int start, u8 *nexthdrp,
break;
hdrlen = 8;
} else if (nexthdr == NEXTHDR_AUTH)
hdrlen = (hp->hdrlen+2)<<2;
hdrlen = ipv6_authlen(hp);
else
hdrlen = ipv6_optlen(hp);

Expand Down

0 comments on commit d4e1b29

Please sign in to comment.