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]
Message-ID: <55E8C82B.6000208@gmail.com>
Date:	Thu, 3 Sep 2015 15:22:35 -0700
From:	Alexander Duyck <alexander.duyck@...il.com>
To:	David Miller <davem@...emloft.net>, nforro@...hat.com
Cc:	netdev@...r.kernel.org
Subject: Re: [PATCH v2] net: Fix behaviour of unreachable, blackhole and
 prohibit routes

On 09/03/2015 10:29 AM, David Miller wrote:
> From: Nikola Forró <nforro@...hat.com>
> Date: Thu, 03 Sep 2015 11:08:51 +0200
>
>> @@ -233,8 +233,10 @@ static inline int fib_lookup(struct net *net, const struct flowi4 *flp,
>>   	rcu_read_lock();
>>   
>>   	tb = fib_get_table(net, RT_TABLE_MAIN);
>> -	if (tb && !fib_table_lookup(tb, flp, res, flags | FIB_LOOKUP_NOREF))
>> -		err = 0;
>> +	if (tb)
>> +		err = fib_table_lookup(tb, flp, res, flags | FIB_LOOKUP_NOREF);
>> +		if (err == -EAGAIN)
>> +			err = -ENETUNREACH;
> You didn't test this.

Actually the way the code is structured is still functional this way.  
The indentation is all that is really wrong.

I suspect this actually results in smaller code that may be faster for 
the standard case since tb will almost always have a value anyway, and 
if tb doesn't exist then err would equal -ENETUNREACH which would just 
mean the err == -EAGAIN would be ignored.

- Alex


--
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