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]
Message-ID: <063D6719AE5E284EB5DD2968C1650D6D0F6E02DB@AcuExch.aculab.com>
Date:	Tue, 18 Mar 2014 15:52:37 +0000
From:	David Laight <David.Laight@...LAB.COM>
To:	'Bjørn Mork' <bjorn@...k.no>,
	Eric Dumazet <eric.dumazet@...il.com>
CC:	Ben Hutchings <ben@...adent.org.uk>,
	"Eric W. Biederman" <ebiederm@...ssion.com>,
	David Miller <davem@...emloft.net>,
	"stephen@...workplumber.org" <stephen@...workplumber.org>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
	"xiyou.wangcong@...il.com" <xiyou.wangcong@...il.com>,
	"mpm@...enic.com" <mpm@...enic.com>,
	"satyam.sharma@...il.com" <satyam.sharma@...il.com>
Subject: RE: [PATCH 6/6] net: Free skbs from irqs when possible.

From: Bjørn Mork
...
> >Try following code, and you'll get a compilation error.
> >
> >unsigned int can_this_fly(struct sk_buff *skb)
> >{
> >	return IS_ENABLED(CONFIG_NOWAY_SIR) ? skb->unknown_field : 0;
> >}
> 
> Doh. Of course. Thanks for spoon feeding me that.

Of course, config_enabled(foo) could be implemented as
config_enabled_(foo, 1, 0)
Allowing you to define and test:
	IS_ENABLED_Q(CONFIG_NOWAY_SIR, skb->unknown_field, 0)

Although you'd probably need to paste the expansions of both 'foo'
'foo_MODULE' onto __ARG_PLACEHOLDER_ to avoid the ||.

More useful might be IF_ENABLED(foo, x) which expands to either
x or nothing at all.
The you could conditionally generate the chunks of format statement
as well as the parameter list.

OTOH you might want readable code!

	David

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ