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] [day] [month] [year] [list]
Date:	Tue, 10 Dec 2013 20:48:50 +0100
From:	Jiri Pirko <jiri@...nulli.us>
To:	David Miller <davem@...emloft.net>
Cc:	netdev@...r.kernel.org
Subject: Re: [patch net-next] neighbour: always have struct net pointer in
 struct neigh_parms

Tue, Dec 10, 2013 at 08:45:38PM CET, davem@...emloft.net wrote:
>From: Jiri Pirko <jiri@...nulli.us>
>Date: Tue, 10 Dec 2013 08:44:57 +0100
>
>> This fixes compile error when CONFIG_NET_NS is not set.
>> 
>> Introduced by:
>> commit 1d4c8c29841b9991cdf3c7cc4ba7f96a94f104ca
>>     "neigh: restore old behaviour of default parms values"
>> 
>> Signed-off-by: Jiri Pirko <jiri@...nulli.us>
>
>Jiri please don't fix things this way.
>
>When network name spaces are disabled, you're supposed to abstract
>all of this stuff away behind accessor macros so that it is truly
>zero cost.
>
>For example, look at how "dev_net()" and related helpers works.
>
>This means you need to do something like:
>
>/*
> * Net namespace inlines
> */
>static inline
>struct net *neigh_parms_net(const struct neigh_parms *np)
>{
>	return read_pnet(&np->net);
>}
>
>static inline
>void neigh_parms_net_set(struct neigh_parms *np, struct net *net)
>{
>#ifdef CONFIG_NET_NS
>	release_net(np->net);
>	np->net = hold_net(net);
>#endif
>}
>
>And then use these helpers consistently in your new code.

Will do. Thanks.

>
>Thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ