aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/route.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv6/route.c')
-rw-r--r--net/ipv6/route.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index c979dd96d82a..c1ee3813e1ae 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -851,7 +851,6 @@ static struct rt6_info *rt6_alloc_cow(struct rt6_info *ort,
851 if (ort->rt6i_dst.plen != 128 && 851 if (ort->rt6i_dst.plen != 128 &&
852 ipv6_addr_equal(&ort->rt6i_dst.addr, daddr)) 852 ipv6_addr_equal(&ort->rt6i_dst.addr, daddr))
853 rt->rt6i_flags |= RTF_ANYCAST; 853 rt->rt6i_flags |= RTF_ANYCAST;
854 rt->rt6i_gateway = *daddr;
855 } 854 }
856 855
857 rt->rt6i_flags |= RTF_CACHE; 856 rt->rt6i_flags |= RTF_CACHE;
@@ -1338,6 +1337,7 @@ struct dst_entry *icmp6_dst_alloc(struct net_device *dev,
1338 rt->dst.flags |= DST_HOST; 1337 rt->dst.flags |= DST_HOST;
1339 rt->dst.output = ip6_output; 1338 rt->dst.output = ip6_output;
1340 atomic_set(&rt->dst.__refcnt, 1); 1339 atomic_set(&rt->dst.__refcnt, 1);
1340 rt->rt6i_gateway = fl6->daddr;
1341 rt->rt6i_dst.addr = fl6->daddr; 1341 rt->rt6i_dst.addr = fl6->daddr;
1342 rt->rt6i_dst.plen = 128; 1342 rt->rt6i_dst.plen = 128;
1343 rt->rt6i_idev = idev; 1343 rt->rt6i_idev = idev;
@@ -1873,7 +1873,10 @@ static struct rt6_info *ip6_rt_copy(struct rt6_info *ort,
1873 in6_dev_hold(rt->rt6i_idev); 1873 in6_dev_hold(rt->rt6i_idev);
1874 rt->dst.lastuse = jiffies; 1874 rt->dst.lastuse = jiffies;
1875 1875
1876 rt->rt6i_gateway = ort->rt6i_gateway; 1876 if (ort->rt6i_flags & RTF_GATEWAY)
1877 rt->rt6i_gateway = ort->rt6i_gateway;
1878 else
1879 rt->rt6i_gateway = *dest;
1877 rt->rt6i_flags = ort->rt6i_flags; 1880 rt->rt6i_flags = ort->rt6i_flags;
1878 if ((ort->rt6i_flags & (RTF_DEFAULT | RTF_ADDRCONF)) == 1881 if ((ort->rt6i_flags & (RTF_DEFAULT | RTF_ADDRCONF)) ==
1879 (RTF_DEFAULT | RTF_ADDRCONF)) 1882 (RTF_DEFAULT | RTF_ADDRCONF))
@@ -2160,6 +2163,7 @@ struct rt6_info *addrconf_dst_alloc(struct inet6_dev *idev,
2160 else 2163 else
2161 rt->rt6i_flags |= RTF_LOCAL; 2164 rt->rt6i_flags |= RTF_LOCAL;
2162 2165
2166 rt->rt6i_gateway = *addr;
2163 rt->rt6i_dst.addr = *addr; 2167 rt->rt6i_dst.addr = *addr;
2164 rt->rt6i_dst.plen = 128; 2168 rt->rt6i_dst.plen = 128;
2165 rt->rt6i_table = fib6_get_table(net, RT6_TABLE_LOCAL); 2169 rt->rt6i_table = fib6_get_table(net, RT6_TABLE_LOCAL);