netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ipv6_skip_exthdr: use ipv6_authlen for AH hdrlen
@ 2017-09-19 12:59 Xiang Gao
  2017-09-19 22:32 ` David Miller
  2017-09-20  0:38 ` Tom Herbert
  0 siblings, 2 replies; 4+ messages in thread
From: Xiang Gao @ 2017-09-19 12:59 UTC (permalink / raw)
  To: trivial, netdev, davem, kuznet, yoshfuji; +Cc: qasdfgtyuiop

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(-)

diff --git a/net/ipv6/exthdrs_core.c b/net/ipv6/exthdrs_core.c
index 305e2ed730bf..115d60919f72 100644
--- a/net/ipv6/exthdrs_core.c
+++ b/net/ipv6/exthdrs_core.c
@@ -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);
 
-- 
2.14.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] ipv6_skip_exthdr: use ipv6_authlen for AH hdrlen
  2017-09-19 12:59 [PATCH] ipv6_skip_exthdr: use ipv6_authlen for AH hdrlen Xiang Gao
@ 2017-09-19 22:32 ` David Miller
  2017-09-20 16:17   ` Xiang Gao
  2017-09-20  0:38 ` Tom Herbert
  1 sibling, 1 reply; 4+ messages in thread
From: David Miller @ 2017-09-19 22:32 UTC (permalink / raw)
  To: qasdfgtyuiop; +Cc: trivial, netdev, kuznet, yoshfuji

From: Xiang Gao <qasdfgtyuiop@gmail.com>
Date: Tue, 19 Sep 2017 08:59:50 -0400

> 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.

All patch submissions must have a proper signoff.

Also, please use a proper subsystem prefix in your Subject
line "[PATCH] ipv6: Use ipv6_authlen for AH hdrlen in ipv6_skip_exthdr()"
would have been much better as "ipv6: " is the appropriate
subsystem prefix to use here.

Thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ipv6_skip_exthdr: use ipv6_authlen for AH hdrlen
  2017-09-19 12:59 [PATCH] ipv6_skip_exthdr: use ipv6_authlen for AH hdrlen Xiang Gao
  2017-09-19 22:32 ` David Miller
@ 2017-09-20  0:38 ` Tom Herbert
  1 sibling, 0 replies; 4+ messages in thread
From: Tom Herbert @ 2017-09-20  0:38 UTC (permalink / raw)
  To: Xiang Gao
  Cc: trivial, Linux Kernel Network Developers, David S. Miller,
	Alexey Kuznetsov, Hideaki YOSHIFUJI

On Tue, Sep 19, 2017 at 5:59 AM, Xiang Gao <qasdfgtyuiop@gmail.com> wrote:
> 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.

This isn't directly related to this patch, but I notice that flow
dissector doesn't used the ipv6_optlen macro and doesn't have
NEXTHDR_AUTH or NEXTHDR_NONE in the ip_proto switch statement. Would
be a nice fix. The NEXTHDR_NONE is probably just a break, but would be
nice to have it there for completeness.

Tom

> ---
>  net/ipv6/exthdrs_core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/ipv6/exthdrs_core.c b/net/ipv6/exthdrs_core.c
> index 305e2ed730bf..115d60919f72 100644
> --- a/net/ipv6/exthdrs_core.c
> +++ b/net/ipv6/exthdrs_core.c
> @@ -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);
>
> --
> 2.14.1
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ipv6_skip_exthdr: use ipv6_authlen for AH hdrlen
  2017-09-19 22:32 ` David Miller
@ 2017-09-20 16:17   ` Xiang Gao
  0 siblings, 0 replies; 4+ messages in thread
From: Xiang Gao @ 2017-09-20 16:17 UTC (permalink / raw)
  To: David Miller; +Cc: trivial, netdev, Alexey Kuznetsov, Hideaki YOSHIFUJI

Hi David,

Thanks for your time and all your suggestions. I will resend a new patch soon.

Xiang Gao
Xiang Gao


2017-09-19 18:32 GMT-04:00 David Miller <davem@davemloft.net>:
> From: Xiang Gao <qasdfgtyuiop@gmail.com>
> Date: Tue, 19 Sep 2017 08:59:50 -0400
>
>> 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.
>
> All patch submissions must have a proper signoff.
>
> Also, please use a proper subsystem prefix in your Subject
> line "[PATCH] ipv6: Use ipv6_authlen for AH hdrlen in ipv6_skip_exthdr()"
> would have been much better as "ipv6: " is the appropriate
> subsystem prefix to use here.
>
> Thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-09-20 16:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-19 12:59 [PATCH] ipv6_skip_exthdr: use ipv6_authlen for AH hdrlen Xiang Gao
2017-09-19 22:32 ` David Miller
2017-09-20 16:17   ` Xiang Gao
2017-09-20  0:38 ` Tom Herbert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).