Subject: Re: [PATCH][IPV6]: Make sure fib6_rule_lookup doesn't return NULL

From: Ville Nuorvala <[email-masked]>
Date: Wed, 09 Aug 2006 09:31:15 +0300

David Miller wrote:
> From: Thomas Graf <[email-masked]>
> Date: Wed, 9 Aug 2006 00:16:51 +0200
> 
>> * Ville Nuorvala <[email-masked]> 2006-08-09 01:05
>>>     [IPV6]: Make sure fib6_rule_lookup doesn't return NULL
>>>     
>>>     The callers of fib6_rule_lookup don't expect it to return NULL,
>>>     therefore it must return ip6_null_entry whenever fib_rule_lookup fails.
>>>     
>>>     Signed-off-by: Ville Nuorvala <[email-masked]>
>> I think it would be a lot cleaner to return an error code
>> like fib_lookup() and save the atomic operations. We only
>> destroy the dst again anyway in case of a failure.
> 
> Yes, the current scheme is a poor substitute for IS_ERR/PTR_ERR.

But the ip6_null_entry not always discarded after a failed route lookup!
On a forwarding router it triggers the ICMPv6 Destination Unreachable
message to the sender.

Regards,
Ville