netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 4/4] netns: prevent usage of flowi with not initialized fl_net in routing
@ 2007-12-04  9:55 Denis V. Lunev
       [not found] ` <20071204095524.GA6070-aPCOdVxUTlgvJsYlp49lxw@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Denis V. Lunev @ 2007-12-04  9:55 UTC (permalink / raw)
  To: davem; +Cc: devel, netdev, containers

Prevent usage of flowi with not initialized fl_net in routing. This is
a temporary measure to simplify maintenance of the patchset.

Signed-off-by: Denis V. Lunev <den@openvz.org>
---
 net/ipv4/route.c      |    1 +
 net/ipv6/fib6_rules.c |    1 +
 net/ipv6/ip6_fib.c    |    1 +
 3 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 84a7f32..996fd9e 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -2444,6 +2444,7 @@ int ip_route_output_flow(struct rtable **rp, struct flowi *flp, struct sock *sk,
 {
 	int err;
 
+	BUG_ON(flp->fl_net == NULL);
 	if ((err = __ip_route_output_key(rp, flp)) != 0)
 		return err;
 
diff --git a/net/ipv6/fib6_rules.c b/net/ipv6/fib6_rules.c
index 428c6b0..326ea69 100644
--- a/net/ipv6/fib6_rules.c
+++ b/net/ipv6/fib6_rules.c
@@ -38,6 +38,7 @@ struct dst_entry *fib6_rule_lookup(struct flowi *fl, int flags,
 		.lookup_ptr = lookup,
 	};
 
+	BUG_ON(fl->fl_net == NULL);
 	fib_rules_lookup(&fib6_rules_ops, fl, flags, &arg);
 	if (arg.rule)
 		fib_rule_put(arg.rule);
diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
index 31b60a0..706cb72 100644
--- a/net/ipv6/ip6_fib.c
+++ b/net/ipv6/ip6_fib.c
@@ -282,6 +282,7 @@ struct fib6_table *fib6_get_table(u32 id)
 struct dst_entry *fib6_rule_lookup(struct flowi *fl, int flags,
 				   pol_lookup_t lookup)
 {
+	BUG_ON(fl->fl_net == NULL);
 	return (struct dst_entry *) lookup(&fib6_main_tbl, fl, flags);
 }
 
-- 
1.5.3.rc5


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

end of thread, other threads:[~2007-12-04 14:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-04  9:55 [PATCH 4/4] netns: prevent usage of flowi with not initialized fl_net in routing Denis V. Lunev
     [not found] ` <20071204095524.GA6070-aPCOdVxUTlgvJsYlp49lxw@public.gmane.org>
2007-12-04 14:38   ` Patrick McHardy

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