netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][IPV6]: Make sure fib6_rule_lookup doesn't return NULL
@ 2006-08-08 22:05 Ville Nuorvala
  2006-08-08 22:16 ` Thomas Graf
  0 siblings, 1 reply; 10+ messages in thread
From: Ville Nuorvala @ 2006-08-08 22:05 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev

[-- Attachment #1: Type: text/plain, Size: 60 bytes --]

Hi David,

please apply the attached patch!

Regards,
Ville

[-- Attachment #2: fib6_rule_null_route.patch --]
[-- Type: text/x-patch, Size: 1036 bytes --]

commit 1fb9864632af5a493353643e7acf970da1d4f59f
tree 569fd122cad5000077f80138a3014c390a7999f5
parent a66c990b9f6b0b9b4c4d2b84f96ddd019b7a8eb3
author Ville Nuorvala <vnuorval@tcs.hut.fi> 1155073548 +0300
committer Ville Nuorvala <vnuorval@tcs.hut.fi> 1155073548 +0300

    [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 <vnuorval@tcs.hut.fi>

diff --git a/net/ipv6/fib6_rules.c b/net/ipv6/fib6_rules.c
index bf9bba8..22a2fdb 100644
--- a/net/ipv6/fib6_rules.c
+++ b/net/ipv6/fib6_rules.c
@@ -63,7 +63,11 @@ struct dst_entry *fib6_rule_lookup(struc
 	if (arg.rule)
 		fib_rule_put(arg.rule);
 
-	return (struct dst_entry *) arg.result;
+	if (arg.result)
+		return (struct dst_entry *) arg.result;
+
+	dst_hold(&ip6_null_entry.u.dst);
+	return &ip6_null_entry.u.dst;
 }
 
 static int fib6_rule_action(struct fib_rule *rule, struct flowi *flp,

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2006-08-09 10:45 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-08 22:05 [PATCH][IPV6]: Make sure fib6_rule_lookup doesn't return NULL Ville Nuorvala
2006-08-08 22:16 ` Thomas Graf
2006-08-08 23:43   ` David Miller
2006-08-09  6:31     ` Ville Nuorvala
2006-08-09  6:34       ` David Miller
2006-08-09  8:36         ` Ville Nuorvala
2006-08-09  9:23           ` Thomas Graf
2006-08-09  9:42             ` Ville Nuorvala
2006-08-09  9:48               ` Thomas Graf
2006-08-09 10:45                 ` Ville Nuorvala

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).