aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/fib_semantics.c
diff options
context:
space:
mode:
authorDenis V. Lunev <den@openvz.org>2008-01-31 21:49:32 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-31 22:28:40 -0500
commit7462bd744e8882f9ebb9220d46fd4fec8b35b082 (patch)
tree25c5ba54034199e6a8e3d123c5e8e79f88f7c394 /net/ipv4/fib_semantics.c
parent85326fa54b5516d8859617cc5fdfce8ae19c1480 (diff)
[NETNS]: Add a namespace mark to fib_info.
This is required to make fib_info lookups namespace aware. In the other case initial namespace devices are marked as dead in the local routing table during other namespace stop. Signed-off-by: Denis V. Lunev <den@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/fib_semantics.c')
-rw-r--r--net/ipv4/fib_semantics.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c
index 5beff2e02751..97cc49412684 100644
--- a/net/ipv4/fib_semantics.c
+++ b/net/ipv4/fib_semantics.c
@@ -687,6 +687,7 @@ struct fib_info *fib_create_info(struct fib_config *cfg)
687 struct fib_info *fi = NULL; 687 struct fib_info *fi = NULL;
688 struct fib_info *ofi; 688 struct fib_info *ofi;
689 int nhs = 1; 689 int nhs = 1;
690 struct net *net = cfg->fc_nlinfo.nl_net;
690 691
691 /* Fast check to catch the most weird cases */ 692 /* Fast check to catch the most weird cases */
692 if (fib_props[cfg->fc_type].scope > cfg->fc_scope) 693 if (fib_props[cfg->fc_type].scope > cfg->fc_scope)
@@ -727,6 +728,7 @@ struct fib_info *fib_create_info(struct fib_config *cfg)
727 goto failure; 728 goto failure;
728 fib_info_cnt++; 729 fib_info_cnt++;
729 730
731 fi->fib_net = net;
730 fi->fib_protocol = cfg->fc_protocol; 732 fi->fib_protocol = cfg->fc_protocol;
731 fi->fib_flags = cfg->fc_flags; 733 fi->fib_flags = cfg->fc_flags;
732 fi->fib_priority = cfg->fc_priority; 734 fi->fib_priority = cfg->fc_priority;
@@ -798,8 +800,7 @@ struct fib_info *fib_create_info(struct fib_config *cfg)
798 if (nhs != 1 || nh->nh_gw) 800 if (nhs != 1 || nh->nh_gw)
799 goto err_inval; 801 goto err_inval;
800 nh->nh_scope = RT_SCOPE_NOWHERE; 802 nh->nh_scope = RT_SCOPE_NOWHERE;
801 nh->nh_dev = dev_get_by_index(cfg->fc_nlinfo.nl_net, 803 nh->nh_dev = dev_get_by_index(net, fi->fib_nh->nh_oif);
802 fi->fib_nh->nh_oif);
803 err = -ENODEV; 804 err = -ENODEV;
804 if (nh->nh_dev == NULL) 805 if (nh->nh_dev == NULL)
805 goto failure; 806 goto failure;
@@ -813,8 +814,7 @@ struct fib_info *fib_create_info(struct fib_config *cfg)
813 if (fi->fib_prefsrc) { 814 if (fi->fib_prefsrc) {
814 if (cfg->fc_type != RTN_LOCAL || !cfg->fc_dst || 815 if (cfg->fc_type != RTN_LOCAL || !cfg->fc_dst ||
815 fi->fib_prefsrc != cfg->fc_dst) 816 fi->fib_prefsrc != cfg->fc_dst)
816 if (inet_addr_type(cfg->fc_nlinfo.nl_net, 817 if (inet_addr_type(net, fi->fib_prefsrc) != RTN_LOCAL)
817 fi->fib_prefsrc) != RTN_LOCAL)
818 goto err_inval; 818 goto err_inval;
819 } 819 }
820 820