Re: [PATCH v2 09/25] tcp: authopt: Disable via sysctl by default

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11/1/21 10:34 AM, Leonard Crestez wrote:
> diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c
> index 97eb54774924..cc34de6e4817 100644
> --- a/net/ipv4/sysctl_net_ipv4.c
> +++ b/net/ipv4/sysctl_net_ipv4.c
> @@ -17,10 +17,11 @@
>  #include <net/udp.h>
>  #include <net/cipso_ipv4.h>
>  #include <net/ping.h>
>  #include <net/protocol.h>
>  #include <net/netevent.h>
> +#include <net/tcp_authopt.h>
>  
>  static int two = 2;
>  static int three __maybe_unused = 3;
>  static int four = 4;
>  static int thousand = 1000;
> @@ -583,10 +584,19 @@ static struct ctl_table ipv4_table[] = {
>  		.mode		= 0644,
>  		.proc_handler	= proc_douintvec_minmax,
>  		.extra1		= &sysctl_fib_sync_mem_min,
>  		.extra2		= &sysctl_fib_sync_mem_max,
>  	},
> +#ifdef CONFIG_TCP_AUTHOPT
> +	{
> +		.procname	= "tcp_authopt",
> +		.data		= &sysctl_tcp_authopt,
> +		.maxlen		= sizeof(int),
> +		.mode		= 0644,
> +		.proc_handler	= proc_dointvec,

Just add it to the namespace set, and this could be a u8 (try to plug a
hole if possible) with min/max specified:

                .maxlen         = sizeof(u8),
                .mode           = 0644,
                .extra1         = SYSCTL_ZERO,
                .extra2         = SYSCTL_ONE


see icmp_echo_enable_probe as an example. And if you are not going to
clean up when toggled off, you need a handler that tells the user it can
not be disabled by erroring out on attempts to disable it.




[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]

  Powered by Linux