lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 11 Oct 2016 16:06:15 +0200
From:   Jiri Benc <jbenc@...hat.com>
To:     zyjzyj2000@...il.com
Cc:     netdev@...r.kernel.org, pabeni@...hat.com, daniel@...earbox.net,
        pshelar@...ira.com, aduyck@...antis.com,
        hannes@...essinduktion.org, davem@...emloft.net
Subject: Re: [PATCH 1/1] vxlan: insert ipv6 macro

On Tue, 11 Oct 2016 16:23:31 +0800, zyjzyj2000@...il.com wrote:
> --- a/drivers/net/vxlan.c
> +++ b/drivers/net/vxlan.c
> @@ -2647,15 +2647,15 @@ static struct socket *vxlan_create_sock(struct net *net, bool ipv6,
>  	int err;
>  
>  	memset(&udp_conf, 0, sizeof(udp_conf));
> -
> +#if IS_ENABLED(CONFIG_IPV6)
>  	if (ipv6) {
>  		udp_conf.family = AF_INET6;
>  		udp_conf.use_udp6_rx_checksums =
>  		    !(flags & VXLAN_F_UDP_ZERO_CSUM6_RX);
>  		udp_conf.ipv6_v6only = 1;
> -	} else {
> +	} else 
> +#endif
>  		udp_conf.family = AF_INET;
> -	}

Zhu Yanjun, before posting patches such as the previous ones or
this one, please test whether they make any difference. In this case,
try to compile the code with IPv6 disabled before and after this patch,
disassemble and compare the results. You'll see that this patch is
pointless.

It's pretty obvious from the code but to be really sure, I've just
quickly built the vxlan module with IPv6 disabled. And indeed, as
expected, the compiler just inlined everything into vxlan_open. The
whole chain vxlan_open -> vxlan_sock_add -> __vxlan_sock_add (note that
there's only a single caller of __vxlan_sock_add with IPv6 disabled) ->
vxlan_socket_create -> vxlan_create_sock is inlined.

It also means the code in the "if (ipv6)" branch is completely
eliminated by the compiler even without ugly #ifdefs.

 Jiri

Powered by blists - more mailing lists