diff options
author | yangxingwu <xingwu.yang@gmail.com> | 2019-07-10 21:14:10 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-07-11 14:43:25 -0700 |
commit | 416e8126a2672f6e91e9e81c6f5c07cf46808b13 (patch) | |
tree | 022663d29eb3e3629f3004d2b02c72deb2e89209 /net/ipv6/ip6_tunnel.c | |
parent | 311633b604063a8a5d3fbc74d0565b42df721f68 (diff) | |
download | talos-op-linux-416e8126a2672f6e91e9e81c6f5c07cf46808b13.tar.gz talos-op-linux-416e8126a2672f6e91e9e81c6f5c07cf46808b13.zip |
ipv6: Use ipv6_authlen for len
The length 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: yangxingwu <xingwu.yang@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/ip6_tunnel.c')
-rw-r--r-- | net/ipv6/ip6_tunnel.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c index b80fde1bc005..3134fbb65d7f 100644 --- a/net/ipv6/ip6_tunnel.c +++ b/net/ipv6/ip6_tunnel.c @@ -416,7 +416,7 @@ __u16 ip6_tnl_parse_tlv_enc_lim(struct sk_buff *skb, __u8 *raw) break; optlen = 8; } else if (nexthdr == NEXTHDR_AUTH) { - optlen = (hdr->hdrlen + 2) << 2; + optlen = ipv6_authlen(hdr); } else { optlen = ipv6_optlen(hdr); } |