X-Git-Url: http://git.cascardo.info/?a=blobdiff_plain;f=net%2Fipv6%2Froute.c;h=e3a224b97905585287571ec2ce2c238580392793;hb=709b8f67d72078cbbd166aaecd2d0f48d1d1560c;hp=49817555449e2956fcfe81555e646b5f9b53261a;hpb=43a0a98aa8da71583f84b84fd72e265c24d4c5f8;p=cascardo%2Flinux.git diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 49817555449e..e3a224b97905 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -1986,9 +1986,18 @@ static struct rt6_info *ip6_route_info_create(struct fib6_config *cfg) if (!(gwa_type & IPV6_ADDR_UNICAST)) goto out; - if (cfg->fc_table) + if (cfg->fc_table) { grt = ip6_nh_lookup_table(net, cfg, gw_addr); + if (grt) { + if (grt->rt6i_flags & RTF_GATEWAY || + (dev && dev != grt->dst.dev)) { + ip6_rt_put(grt); + grt = NULL; + } + } + } + if (!grt) grt = rt6_lookup(net, gw_addr, NULL, cfg->fc_ifindex, 1);