Skip to contentSkip to conversation

ipv6: Use ipv6_authlen for len in ipv6_skip_exthdr

PATCH Applied Xiang Gao 2 participants 2 messages Sep 20, 2017

Subsystems (3)
lore
Share & tools
lore

Xiang Gao

author
#0 lore raw

PATCH 1/1 ipv6: Use ipv6_authlen for len in ipv6_skip_exthdr

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.

---
 net/ipv6/exthdrs_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv6/exthdrs_core.c +1 -1
index 305e2ed730bf..115d60919f72 100644
@@ -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);
 
Signature · 1 line
2.14.1
maintainer Applied
#1 lore raw

From: Xiang Gao <[email protected]>
Date: Wed, 20 Sep 2017 12:18:17 -0400

Quoted 6 lines

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.

Applied, thank you.