Subject: Re: [PATCH] net/ipv6: add sysctl option accept_ra_hop_limit

From: YOSHIFUJI Hideaki <[email-masked]>
Date: Fri, 24 Jul 2015 13:48:12 +0900

Hi,

Hangbin Liu wrote:
> Commit 6fd99094de2b ("ipv6: Don't reduce hop limit for an interface")
> disabled accept hop limit from RA if it is higher than the current hop
> limit for security stuff. But this behavior kind of break the RFC definition.
> 
> RFC 4861, 6.3.4.  Processing Received Router Advertisements
>    If the received Cur Hop Limit value is non-zero, the host SHOULD set
>    its CurHopLimit variable to the received value.
> 
> So add sysctl option accept_ra_hop_limit to let user choose whether accept
> hop limit info in RA.
> 
> Signed-off-by: Hangbin Liu <[email-masked]>
> Acked-by: Hannes Frederic Sowa <[email-masked]>
> ---
>  Documentation/networking/ip-sysctl.txt | 11 +++++++++++
>  include/linux/ipv6.h                   |  1 +
>  include/uapi/linux/ipv6.h              |  1 +
>  net/ipv6/addrconf.c                    | 10 ++++++++++
>  net/ipv6/ndisc.c                       | 17 +++++++++++------
>  5 files changed, 34 insertions(+), 6 deletions(-)
> 
:
> diff --git a/include/uapi/linux/ipv6.h b/include/uapi/linux/ipv6.h
> index 5efa54a..9f40ac9 100644
> --- a/include/uapi/linux/ipv6.h
> +++ b/include/uapi/linux/ipv6.h
> @@ -153,6 +153,7 @@ enum {
>  	DEVCONF_FORCE_MLD_VERSION,
>  	DEVCONF_ACCEPT_RA_DEFRTR,
>  	DEVCONF_ACCEPT_RA_PINFO,
> +	DEVCONF_ACCEPT_RA_HOP_LIMIT,
>  	DEVCONF_ACCEPT_RA_RTR_PREF,
>  	DEVCONF_RTR_PROBE_INTERVAL,
>  	DEVCONF_ACCEPT_RA_RT_INFO_MAX_PLEN,

No, you cannot add new one in the middle of these since 
values are exported to userspace.

--yoshfuji