aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/fib_semantics.c
diff options
context:
space:
mode:
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