On Tue, 2011-01-04 at 14:16 +0000, Ben Hutchings wrote:
On Tue, 2011-01-04 at 09:38 +0100, Eric Dumazet wrote:
quoted
Le mardi 04 janvier 2011 à 16:07 +0800, Changli Gao a écrit :
quoted
On Tue, Jan 4, 2011 at 3:33 PM, Eric Dumazet [off-list ref] wrote:
quoted
Le mardi 04 janvier 2011 à 08:24 +0100, Eric Dumazet a écrit :
quoted
Please use FIB_RES_PREFSRC(res)
Hmm no, this is not applicable, but this could be shorter :
fl.fl4_src = res.fi->fib_prefsrc ? : fl.fl4_dst;
I think Joe may object the use of "? :"
Ternary operator is standard C idiom, used in networking stuff, for
example in FIB_RES_PREFSRC() ;)
However, the option to omit the second operand is a GNU extension.
I don't object to using GNU extensions.
The ?: extension is used in most every major subsystem.
$ grep -rP --include=*.[ch] "\?\s*:" * | wc -l
515
(with some false positives)