diff options
author | David S. Miller <davem@davemloft.net> | 2011-12-28 20:19:20 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-12-28 20:19:20 -0500 |
commit | d191854282fd831da785a5a34bc6fd16049b8578 (patch) | |
tree | 2a2700b2dec7ad9e73c55c833346dbbd67b8777c /net/ipv6 | |
parent | f83c7790dc0025fffbd8684f3803a7571f624baa (diff) |
ipv6: Kill rt6i_dev and rt6i_expires defines.
It just obscures that the netdevice pointer and the expires value are
implemented in the dst_entry sub-object of the ipv6 route.
And it makes grepping for dst_entry member uses much harder too.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/addrconf.c | 8 | ||||
-rw-r--r-- | net/ipv6/anycast.c | 2 | ||||
-rw-r--r-- | net/ipv6/ip6_fib.c | 10 | ||||
-rw-r--r-- | net/ipv6/ip6_tunnel.c | 10 | ||||
-rw-r--r-- | net/ipv6/mcast.c | 4 | ||||
-rw-r--r-- | net/ipv6/ndisc.c | 2 | ||||
-rw-r--r-- | net/ipv6/route.c | 58 |
7 files changed, 47 insertions, 47 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 85421cce5e1a..647e6cba237d 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
@@ -797,7 +797,7 @@ static void ipv6_del_addr(struct inet6_ifaddr *ifp) | |||
797 | ip6_del_rt(rt); | 797 | ip6_del_rt(rt); |
798 | rt = NULL; | 798 | rt = NULL; |
799 | } else if (!(rt->rt6i_flags & RTF_EXPIRES)) { | 799 | } else if (!(rt->rt6i_flags & RTF_EXPIRES)) { |
800 | rt->rt6i_expires = expires; | 800 | rt->dst.expires = expires; |
801 | rt->rt6i_flags |= RTF_EXPIRES; | 801 | rt->rt6i_flags |= RTF_EXPIRES; |
802 | } | 802 | } |
803 | } | 803 | } |
@@ -1723,7 +1723,7 @@ static struct rt6_info *addrconf_get_prefix_route(const struct in6_addr *pfx, | |||
1723 | if (!fn) | 1723 | if (!fn) |
1724 | goto out; | 1724 | goto out; |
1725 | for (rt = fn->leaf; rt; rt = rt->dst.rt6_next) { | 1725 | for (rt = fn->leaf; rt; rt = rt->dst.rt6_next) { |
1726 | if (rt->rt6i_dev->ifindex != dev->ifindex) | 1726 | if (rt->dst.dev->ifindex != dev->ifindex) |
1727 | continue; | 1727 | continue; |
1728 | if ((rt->rt6i_flags & flags) != flags) | 1728 | if ((rt->rt6i_flags & flags) != flags) |
1729 | continue; | 1729 | continue; |
@@ -1881,11 +1881,11 @@ void addrconf_prefix_rcv(struct net_device *dev, u8 *opt, int len) | |||
1881 | rt = NULL; | 1881 | rt = NULL; |
1882 | } else if (addrconf_finite_timeout(rt_expires)) { | 1882 | } else if (addrconf_finite_timeout(rt_expires)) { |
1883 | /* not infinity */ | 1883 | /* not infinity */ |
1884 | rt->rt6i_expires = jiffies + rt_expires; | 1884 | rt->dst.expires = jiffies + rt_expires; |
1885 | rt->rt6i_flags |= RTF_EXPIRES; | 1885 | rt->rt6i_flags |= RTF_EXPIRES; |
1886 | } else { | 1886 | } else { |
1887 | rt->rt6i_flags &= ~RTF_EXPIRES; | 1887 | rt->rt6i_flags &= ~RTF_EXPIRES; |
1888 | rt->rt6i_expires = 0; | 1888 | rt->dst.expires = 0; |
1889 | } | 1889 | } |
1890 | } else if (valid_lft) { | 1890 | } else if (valid_lft) { |
1891 | clock_t expires = 0; | 1891 | clock_t expires = 0; |
diff --git a/net/ipv6/anycast.c b/net/ipv6/anycast.c index cc540f9ad130..59402b4637f9 100644 --- a/net/ipv6/anycast.c +++ b/net/ipv6/anycast.c | |||
@@ -83,7 +83,7 @@ int ipv6_sock_ac_join(struct sock *sk, int ifindex, const struct in6_addr *addr) | |||
83 | 83 | ||
84 | rt = rt6_lookup(net, addr, NULL, 0, 0); | 84 | rt = rt6_lookup(net, addr, NULL, 0, 0); |
85 | if (rt) { | 85 | if (rt) { |
86 | dev = rt->rt6i_dev; | 86 | dev = rt->dst.dev; |
87 | dst_release(&rt->dst); | 87 | dst_release(&rt->dst); |
88 | } else if (ishost) { | 88 | } else if (ishost) { |
89 | err = -EADDRNOTAVAIL; | 89 | err = -EADDRNOTAVAIL; |
diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c index 278363123657..246d8e403f26 100644 --- a/net/ipv6/ip6_fib.c +++ b/net/ipv6/ip6_fib.c | |||
@@ -667,16 +667,16 @@ static int fib6_add_rt2node(struct fib6_node *fn, struct rt6_info *rt, | |||
667 | break; | 667 | break; |
668 | } | 668 | } |
669 | 669 | ||
670 | if (iter->rt6i_dev == rt->rt6i_dev && | 670 | if (iter->dst.dev == rt->dst.dev && |
671 | iter->rt6i_idev == rt->rt6i_idev && | 671 | iter->rt6i_idev == rt->rt6i_idev && |
672 | ipv6_addr_equal(&iter->rt6i_gateway, | 672 | ipv6_addr_equal(&iter->rt6i_gateway, |
673 | &rt->rt6i_gateway)) { | 673 | &rt->rt6i_gateway)) { |
674 | if (!(iter->rt6i_flags & RTF_EXPIRES)) | 674 | if (!(iter->rt6i_flags & RTF_EXPIRES)) |
675 | return -EEXIST; | 675 | return -EEXIST; |
676 | iter->rt6i_expires = rt->rt6i_expires; | 676 | iter->dst.expires = rt->dst.expires; |
677 | if (!(rt->rt6i_flags & RTF_EXPIRES)) { | 677 | if (!(rt->rt6i_flags & RTF_EXPIRES)) { |
678 | iter->rt6i_flags &= ~RTF_EXPIRES; | 678 | iter->rt6i_flags &= ~RTF_EXPIRES; |
679 | iter->rt6i_expires = 0; | 679 | iter->dst.expires = 0; |
680 | } | 680 | } |
681 | return -EEXIST; | 681 | return -EEXIST; |
682 | } | 682 | } |
@@ -1521,8 +1521,8 @@ static int fib6_age(struct rt6_info *rt, void *arg) | |||
1521 | * only if they are not in use now. | 1521 | * only if they are not in use now. |
1522 | */ | 1522 | */ |
1523 | 1523 | ||
1524 | if (rt->rt6i_flags & RTF_EXPIRES && rt->rt6i_expires) { | 1524 | if (rt->rt6i_flags & RTF_EXPIRES && rt->dst.expires) { |
1525 | if (time_after(now, rt->rt6i_expires)) { | 1525 | if (time_after(now, rt->dst.expires)) { |
1526 | RT6_TRACE("expiring %p\n", rt); | 1526 | RT6_TRACE("expiring %p\n", rt); |
1527 | return -1; | 1527 | return -1; |
1528 | } | 1528 | } |
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c index f5f98f558acb..e1f7761815f3 100644 --- a/net/ipv6/ip6_tunnel.c +++ b/net/ipv6/ip6_tunnel.c | |||
@@ -653,8 +653,8 @@ ip6ip6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, | |||
653 | rt = rt6_lookup(dev_net(skb->dev), &ipv6_hdr(skb2)->saddr, | 653 | rt = rt6_lookup(dev_net(skb->dev), &ipv6_hdr(skb2)->saddr, |
654 | NULL, 0, 0); | 654 | NULL, 0, 0); |
655 | 655 | ||
656 | if (rt && rt->rt6i_dev) | 656 | if (rt && rt->dst.dev) |
657 | skb2->dev = rt->rt6i_dev; | 657 | skb2->dev = rt->dst.dev; |
658 | 658 | ||
659 | icmpv6_send(skb2, rel_type, rel_code, rel_info); | 659 | icmpv6_send(skb2, rel_type, rel_code, rel_info); |
660 | 660 | ||
@@ -1185,11 +1185,11 @@ static void ip6_tnl_link_config(struct ip6_tnl *t) | |||
1185 | if (rt == NULL) | 1185 | if (rt == NULL) |
1186 | return; | 1186 | return; |
1187 | 1187 | ||
1188 | if (rt->rt6i_dev) { | 1188 | if (rt->dst.dev) { |
1189 | dev->hard_header_len = rt->rt6i_dev->hard_header_len + | 1189 | dev->hard_header_len = rt->dst.dev->hard_header_len + |
1190 | sizeof (struct ipv6hdr); | 1190 | sizeof (struct ipv6hdr); |
1191 | 1191 | ||
1192 | dev->mtu = rt->rt6i_dev->mtu - sizeof (struct ipv6hdr); | 1192 | dev->mtu = rt->dst.dev->mtu - sizeof (struct ipv6hdr); |
1193 | if (!(t->parms.flags & IP6_TNL_F_IGN_ENCAP_LIMIT)) | 1193 | if (!(t->parms.flags & IP6_TNL_F_IGN_ENCAP_LIMIT)) |
1194 | dev->mtu-=8; | 1194 | dev->mtu-=8; |
1195 | 1195 | ||
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c index ea34d58e836d..b853f06cc148 100644 --- a/net/ipv6/mcast.c +++ b/net/ipv6/mcast.c | |||
@@ -162,7 +162,7 @@ int ipv6_sock_mc_join(struct sock *sk, int ifindex, const struct in6_addr *addr) | |||
162 | struct rt6_info *rt; | 162 | struct rt6_info *rt; |
163 | rt = rt6_lookup(net, addr, NULL, 0, 0); | 163 | rt = rt6_lookup(net, addr, NULL, 0, 0); |
164 | if (rt) { | 164 | if (rt) { |
165 | dev = rt->rt6i_dev; | 165 | dev = rt->dst.dev; |
166 | dst_release(&rt->dst); | 166 | dst_release(&rt->dst); |
167 | } | 167 | } |
168 | } else | 168 | } else |
@@ -256,7 +256,7 @@ static struct inet6_dev *ip6_mc_find_dev_rcu(struct net *net, | |||
256 | struct rt6_info *rt = rt6_lookup(net, group, NULL, 0, 0); | 256 | struct rt6_info *rt = rt6_lookup(net, group, NULL, 0, 0); |
257 | 257 | ||
258 | if (rt) { | 258 | if (rt) { |
259 | dev = rt->rt6i_dev; | 259 | dev = rt->dst.dev; |
260 | dev_hold(dev); | 260 | dev_hold(dev); |
261 | dst_release(&rt->dst); | 261 | dst_release(&rt->dst); |
262 | } | 262 | } |
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c index 538a61960a24..3b1fe4b3f3c6 100644 --- a/net/ipv6/ndisc.c +++ b/net/ipv6/ndisc.c | |||
@@ -1258,7 +1258,7 @@ static void ndisc_router_discovery(struct sk_buff *skb) | |||
1258 | } | 1258 | } |
1259 | 1259 | ||
1260 | if (rt) | 1260 | if (rt) |
1261 | rt->rt6i_expires = jiffies + (HZ * lifetime); | 1261 | rt->dst.expires = jiffies + (HZ * lifetime); |
1262 | 1262 | ||
1263 | if (ra_msg->icmph.icmp6_hop_limit) { | 1263 | if (ra_msg->icmph.icmp6_hop_limit) { |
1264 | in6_dev->cnf.hop_limit = ra_msg->icmph.icmp6_hop_limit; | 1264 | in6_dev->cnf.hop_limit = ra_msg->icmph.icmp6_hop_limit; |
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 6bf60946698a..0940729d2f91 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c | |||
@@ -314,7 +314,7 @@ static void ip6_dst_ifdown(struct dst_entry *dst, struct net_device *dev, | |||
314 | static __inline__ int rt6_check_expired(const struct rt6_info *rt) | 314 | static __inline__ int rt6_check_expired(const struct rt6_info *rt) |
315 | { | 315 | { |
316 | return (rt->rt6i_flags & RTF_EXPIRES) && | 316 | return (rt->rt6i_flags & RTF_EXPIRES) && |
317 | time_after(jiffies, rt->rt6i_expires); | 317 | time_after(jiffies, rt->dst.expires); |
318 | } | 318 | } |
319 | 319 | ||
320 | static inline int rt6_need_strict(const struct in6_addr *daddr) | 320 | static inline int rt6_need_strict(const struct in6_addr *daddr) |
@@ -340,7 +340,7 @@ static inline struct rt6_info *rt6_device_match(struct net *net, | |||
340 | goto out; | 340 | goto out; |
341 | 341 | ||
342 | for (sprt = rt; sprt; sprt = sprt->dst.rt6_next) { | 342 | for (sprt = rt; sprt; sprt = sprt->dst.rt6_next) { |
343 | struct net_device *dev = sprt->rt6i_dev; | 343 | struct net_device *dev = sprt->dst.dev; |
344 | 344 | ||
345 | if (oif) { | 345 | if (oif) { |
346 | if (dev->ifindex == oif) | 346 | if (dev->ifindex == oif) |
@@ -401,7 +401,7 @@ static void rt6_probe(struct rt6_info *rt) | |||
401 | 401 | ||
402 | target = (struct in6_addr *)&neigh->primary_key; | 402 | target = (struct in6_addr *)&neigh->primary_key; |
403 | addrconf_addr_solict_mult(target, &mcaddr); | 403 | addrconf_addr_solict_mult(target, &mcaddr); |
404 | ndisc_send_ns(rt->rt6i_dev, NULL, target, &mcaddr, NULL); | 404 | ndisc_send_ns(rt->dst.dev, NULL, target, &mcaddr, NULL); |
405 | } else { | 405 | } else { |
406 | read_unlock_bh(&neigh->lock); | 406 | read_unlock_bh(&neigh->lock); |
407 | } | 407 | } |
@@ -419,7 +419,7 @@ static inline void rt6_probe(struct rt6_info *rt) | |||
419 | */ | 419 | */ |
420 | static inline int rt6_check_dev(struct rt6_info *rt, int oif) | 420 | static inline int rt6_check_dev(struct rt6_info *rt, int oif) |
421 | { | 421 | { |
422 | struct net_device *dev = rt->rt6i_dev; | 422 | struct net_device *dev = rt->dst.dev; |
423 | if (!oif || dev->ifindex == oif) | 423 | if (!oif || dev->ifindex == oif) |
424 | return 2; | 424 | return 2; |
425 | if ((dev->flags & IFF_LOOPBACK) && | 425 | if ((dev->flags & IFF_LOOPBACK) && |
@@ -538,7 +538,7 @@ static struct rt6_info *rt6_select(struct fib6_node *fn, int oif, int strict) | |||
538 | fn->rr_ptr = next; | 538 | fn->rr_ptr = next; |
539 | } | 539 | } |
540 | 540 | ||
541 | net = dev_net(rt0->rt6i_dev); | 541 | net = dev_net(rt0->dst.dev); |
542 | return match ? match : net->ipv6.ip6_null_entry; | 542 | return match ? match : net->ipv6.ip6_null_entry; |
543 | } | 543 | } |
544 | 544 | ||
@@ -607,7 +607,7 @@ int rt6_route_rcv(struct net_device *dev, u8 *opt, int len, | |||
607 | if (!addrconf_finite_timeout(lifetime)) { | 607 | if (!addrconf_finite_timeout(lifetime)) { |
608 | rt->rt6i_flags &= ~RTF_EXPIRES; | 608 | rt->rt6i_flags &= ~RTF_EXPIRES; |
609 | } else { | 609 | } else { |
610 | rt->rt6i_expires = jiffies + HZ * lifetime; | 610 | rt->dst.expires = jiffies + HZ * lifetime; |
611 | rt->rt6i_flags |= RTF_EXPIRES; | 611 | rt->rt6i_flags |= RTF_EXPIRES; |
612 | } | 612 | } |
613 | dst_release(&rt->dst); | 613 | dst_release(&rt->dst); |
@@ -709,7 +709,7 @@ static int __ip6_ins_rt(struct rt6_info *rt, struct nl_info *info) | |||
709 | int ip6_ins_rt(struct rt6_info *rt) | 709 | int ip6_ins_rt(struct rt6_info *rt) |
710 | { | 710 | { |
711 | struct nl_info info = { | 711 | struct nl_info info = { |
712 | .nl_net = dev_net(rt->rt6i_dev), | 712 | .nl_net = dev_net(rt->dst.dev), |
713 | }; | 713 | }; |
714 | return __ip6_ins_rt(rt, &info); | 714 | return __ip6_ins_rt(rt, &info); |
715 | } | 715 | } |
@@ -747,7 +747,7 @@ static struct rt6_info *rt6_alloc_cow(const struct rt6_info *ort, | |||
747 | 747 | ||
748 | retry: | 748 | retry: |
749 | if (rt6_bind_neighbour(rt)) { | 749 | if (rt6_bind_neighbour(rt)) { |
750 | struct net *net = dev_net(rt->rt6i_dev); | 750 | struct net *net = dev_net(rt->dst.dev); |
751 | int saved_rt_min_interval = | 751 | int saved_rt_min_interval = |
752 | net->ipv6.sysctl.ip6_rt_gc_min_interval; | 752 | net->ipv6.sysctl.ip6_rt_gc_min_interval; |
753 | int saved_rt_elasticity = | 753 | int saved_rt_elasticity = |
@@ -931,7 +931,7 @@ struct dst_entry *ip6_blackhole_route(struct net *net, struct dst_entry *dst_ori | |||
931 | rt->rt6i_idev = ort->rt6i_idev; | 931 | rt->rt6i_idev = ort->rt6i_idev; |
932 | if (rt->rt6i_idev) | 932 | if (rt->rt6i_idev) |
933 | in6_dev_hold(rt->rt6i_idev); | 933 | in6_dev_hold(rt->rt6i_idev); |
934 | rt->rt6i_expires = 0; | 934 | rt->dst.expires = 0; |
935 | 935 | ||
936 | rt->rt6i_gateway = ort->rt6i_gateway; | 936 | rt->rt6i_gateway = ort->rt6i_gateway; |
937 | rt->rt6i_flags = ort->rt6i_flags & ~RTF_EXPIRES; | 937 | rt->rt6i_flags = ort->rt6i_flags & ~RTF_EXPIRES; |
@@ -1265,7 +1265,7 @@ int ip6_route_add(struct fib6_config *cfg) | |||
1265 | } | 1265 | } |
1266 | 1266 | ||
1267 | rt->dst.obsolete = -1; | 1267 | rt->dst.obsolete = -1; |
1268 | rt->rt6i_expires = (cfg->fc_flags & RTF_EXPIRES) ? | 1268 | rt->dst.expires = (cfg->fc_flags & RTF_EXPIRES) ? |
1269 | jiffies + clock_t_to_jiffies(cfg->fc_expires) : | 1269 | jiffies + clock_t_to_jiffies(cfg->fc_expires) : |
1270 | 0; | 1270 | 0; |
1271 | 1271 | ||
@@ -1360,12 +1360,12 @@ int ip6_route_add(struct fib6_config *cfg) | |||
1360 | if (!grt) | 1360 | if (!grt) |
1361 | goto out; | 1361 | goto out; |
1362 | if (dev) { | 1362 | if (dev) { |
1363 | if (dev != grt->rt6i_dev) { | 1363 | if (dev != grt->dst.dev) { |
1364 | dst_release(&grt->dst); | 1364 | dst_release(&grt->dst); |
1365 | goto out; | 1365 | goto out; |
1366 | } | 1366 | } |
1367 | } else { | 1367 | } else { |
1368 | dev = grt->rt6i_dev; | 1368 | dev = grt->dst.dev; |
1369 | idev = grt->rt6i_idev; | 1369 | idev = grt->rt6i_idev; |
1370 | dev_hold(dev); | 1370 | dev_hold(dev); |
1371 | in6_dev_hold(grt->rt6i_idev); | 1371 | in6_dev_hold(grt->rt6i_idev); |
@@ -1445,7 +1445,7 @@ static int __ip6_del_rt(struct rt6_info *rt, struct nl_info *info) | |||
1445 | { | 1445 | { |
1446 | int err; | 1446 | int err; |
1447 | struct fib6_table *table; | 1447 | struct fib6_table *table; |
1448 | struct net *net = dev_net(rt->rt6i_dev); | 1448 | struct net *net = dev_net(rt->dst.dev); |
1449 | 1449 | ||
1450 | if (rt == net->ipv6.ip6_null_entry) | 1450 | if (rt == net->ipv6.ip6_null_entry) |
1451 | return -ENOENT; | 1451 | return -ENOENT; |
@@ -1464,7 +1464,7 @@ static int __ip6_del_rt(struct rt6_info *rt, struct nl_info *info) | |||
1464 | int ip6_del_rt(struct rt6_info *rt) | 1464 | int ip6_del_rt(struct rt6_info *rt) |
1465 | { | 1465 | { |
1466 | struct nl_info info = { | 1466 | struct nl_info info = { |
1467 | .nl_net = dev_net(rt->rt6i_dev), | 1467 | .nl_net = dev_net(rt->dst.dev), |
1468 | }; | 1468 | }; |
1469 | return __ip6_del_rt(rt, &info); | 1469 | return __ip6_del_rt(rt, &info); |
1470 | } | 1470 | } |
@@ -1489,8 +1489,8 @@ static int ip6_route_del(struct fib6_config *cfg) | |||
1489 | if (fn) { | 1489 | if (fn) { |
1490 | for (rt = fn->leaf; rt; rt = rt->dst.rt6_next) { | 1490 | for (rt = fn->leaf; rt; rt = rt->dst.rt6_next) { |
1491 | if (cfg->fc_ifindex && | 1491 | if (cfg->fc_ifindex && |
1492 | (!rt->rt6i_dev || | 1492 | (!rt->dst.dev || |
1493 | rt->rt6i_dev->ifindex != cfg->fc_ifindex)) | 1493 | rt->dst.dev->ifindex != cfg->fc_ifindex)) |
1494 | continue; | 1494 | continue; |
1495 | if (cfg->fc_flags & RTF_GATEWAY && | 1495 | if (cfg->fc_flags & RTF_GATEWAY && |
1496 | !ipv6_addr_equal(&cfg->fc_gateway, &rt->rt6i_gateway)) | 1496 | !ipv6_addr_equal(&cfg->fc_gateway, &rt->rt6i_gateway)) |
@@ -1552,7 +1552,7 @@ restart: | |||
1552 | continue; | 1552 | continue; |
1553 | if (!(rt->rt6i_flags & RTF_GATEWAY)) | 1553 | if (!(rt->rt6i_flags & RTF_GATEWAY)) |
1554 | continue; | 1554 | continue; |
1555 | if (fl6->flowi6_oif != rt->rt6i_dev->ifindex) | 1555 | if (fl6->flowi6_oif != rt->dst.dev->ifindex) |
1556 | continue; | 1556 | continue; |
1557 | if (!ipv6_addr_equal(&rdfl->gateway, &rt->rt6i_gateway)) | 1557 | if (!ipv6_addr_equal(&rdfl->gateway, &rt->rt6i_gateway)) |
1558 | continue; | 1558 | continue; |
@@ -1778,7 +1778,7 @@ void rt6_pmtu_discovery(const struct in6_addr *daddr, const struct in6_addr *sad | |||
1778 | static struct rt6_info *ip6_rt_copy(const struct rt6_info *ort, | 1778 | static struct rt6_info *ip6_rt_copy(const struct rt6_info *ort, |
1779 | const struct in6_addr *dest) | 1779 | const struct in6_addr *dest) |
1780 | { | 1780 | { |
1781 | struct net *net = dev_net(ort->rt6i_dev); | 1781 | struct net *net = dev_net(ort->dst.dev); |
1782 | struct rt6_info *rt = ip6_dst_alloc(&net->ipv6.ip6_dst_ops, | 1782 | struct rt6_info *rt = ip6_dst_alloc(&net->ipv6.ip6_dst_ops, |
1783 | ort->dst.dev, 0); | 1783 | ort->dst.dev, 0); |
1784 | 1784 | ||
@@ -1795,7 +1795,7 @@ static struct rt6_info *ip6_rt_copy(const struct rt6_info *ort, | |||
1795 | if (rt->rt6i_idev) | 1795 | if (rt->rt6i_idev) |
1796 | in6_dev_hold(rt->rt6i_idev); | 1796 | in6_dev_hold(rt->rt6i_idev); |
1797 | rt->dst.lastuse = jiffies; | 1797 | rt->dst.lastuse = jiffies; |
1798 | rt->rt6i_expires = 0; | 1798 | rt->dst.expires = 0; |
1799 | 1799 | ||
1800 | rt->rt6i_gateway = ort->rt6i_gateway; | 1800 | rt->rt6i_gateway = ort->rt6i_gateway; |
1801 | rt->rt6i_flags = ort->rt6i_flags & ~RTF_EXPIRES; | 1801 | rt->rt6i_flags = ort->rt6i_flags & ~RTF_EXPIRES; |
@@ -1829,7 +1829,7 @@ static struct rt6_info *rt6_get_route_info(struct net *net, | |||
1829 | goto out; | 1829 | goto out; |
1830 | 1830 | ||
1831 | for (rt = fn->leaf; rt; rt = rt->dst.rt6_next) { | 1831 | for (rt = fn->leaf; rt; rt = rt->dst.rt6_next) { |
1832 | if (rt->rt6i_dev->ifindex != ifindex) | 1832 | if (rt->dst.dev->ifindex != ifindex) |
1833 | continue; | 1833 | continue; |
1834 | if ((rt->rt6i_flags & (RTF_ROUTEINFO|RTF_GATEWAY)) != (RTF_ROUTEINFO|RTF_GATEWAY)) | 1834 | if ((rt->rt6i_flags & (RTF_ROUTEINFO|RTF_GATEWAY)) != (RTF_ROUTEINFO|RTF_GATEWAY)) |
1835 | continue; | 1835 | continue; |
@@ -1884,7 +1884,7 @@ struct rt6_info *rt6_get_dflt_router(const struct in6_addr *addr, struct net_dev | |||
1884 | 1884 | ||
1885 | write_lock_bh(&table->tb6_lock); | 1885 | write_lock_bh(&table->tb6_lock); |
1886 | for (rt = table->tb6_root.leaf; rt; rt=rt->dst.rt6_next) { | 1886 | for (rt = table->tb6_root.leaf; rt; rt=rt->dst.rt6_next) { |
1887 | if (dev == rt->rt6i_dev && | 1887 | if (dev == rt->dst.dev && |
1888 | ((rt->rt6i_flags & (RTF_ADDRCONF | RTF_DEFAULT)) == (RTF_ADDRCONF | RTF_DEFAULT)) && | 1888 | ((rt->rt6i_flags & (RTF_ADDRCONF | RTF_DEFAULT)) == (RTF_ADDRCONF | RTF_DEFAULT)) && |
1889 | ipv6_addr_equal(&rt->rt6i_gateway, addr)) | 1889 | ipv6_addr_equal(&rt->rt6i_gateway, addr)) |
1890 | break; | 1890 | break; |
@@ -2128,7 +2128,7 @@ static int fib6_remove_prefsrc(struct rt6_info *rt, void *arg) | |||
2128 | struct net *net = ((struct arg_dev_net_ip *)arg)->net; | 2128 | struct net *net = ((struct arg_dev_net_ip *)arg)->net; |
2129 | struct in6_addr *addr = ((struct arg_dev_net_ip *)arg)->addr; | 2129 | struct in6_addr *addr = ((struct arg_dev_net_ip *)arg)->addr; |
2130 | 2130 | ||
2131 | if (((void *)rt->rt6i_dev == dev || !dev) && | 2131 | if (((void *)rt->dst.dev == dev || !dev) && |
2132 | rt != net->ipv6.ip6_null_entry && | 2132 | rt != net->ipv6.ip6_null_entry && |
2133 | ipv6_addr_equal(addr, &rt->rt6i_prefsrc.addr)) { | 2133 | ipv6_addr_equal(addr, &rt->rt6i_prefsrc.addr)) { |
2134 | /* remove prefsrc entry */ | 2134 | /* remove prefsrc entry */ |
@@ -2158,7 +2158,7 @@ static int fib6_ifdown(struct rt6_info *rt, void *arg) | |||
2158 | const struct arg_dev_net *adn = arg; | 2158 | const struct arg_dev_net *adn = arg; |
2159 | const struct net_device *dev = adn->dev; | 2159 | const struct net_device *dev = adn->dev; |
2160 | 2160 | ||
2161 | if ((rt->rt6i_dev == dev || !dev) && | 2161 | if ((rt->dst.dev == dev || !dev) && |
2162 | rt != adn->net->ipv6.ip6_null_entry) | 2162 | rt != adn->net->ipv6.ip6_null_entry) |
2163 | return -1; | 2163 | return -1; |
2164 | 2164 | ||
@@ -2211,7 +2211,7 @@ static int rt6_mtu_change_route(struct rt6_info *rt, void *p_arg) | |||
2211 | also have the lowest MTU, TOO BIG MESSAGE will be lead to | 2211 | also have the lowest MTU, TOO BIG MESSAGE will be lead to |
2212 | PMTU discouvery. | 2212 | PMTU discouvery. |
2213 | */ | 2213 | */ |
2214 | if (rt->rt6i_dev == arg->dev && | 2214 | if (rt->dst.dev == arg->dev && |
2215 | !dst_metric_locked(&rt->dst, RTAX_MTU) && | 2215 | !dst_metric_locked(&rt->dst, RTAX_MTU) && |
2216 | (dst_mtu(&rt->dst) >= arg->mtu || | 2216 | (dst_mtu(&rt->dst) >= arg->mtu || |
2217 | (dst_mtu(&rt->dst) < arg->mtu && | 2217 | (dst_mtu(&rt->dst) < arg->mtu && |
@@ -2392,7 +2392,7 @@ static int rt6_fill_node(struct net *net, | |||
2392 | rtm->rtm_type = RTN_UNREACHABLE; | 2392 | rtm->rtm_type = RTN_UNREACHABLE; |
2393 | else if (rt->rt6i_flags & RTF_LOCAL) | 2393 | else if (rt->rt6i_flags & RTF_LOCAL) |
2394 | rtm->rtm_type = RTN_LOCAL; | 2394 | rtm->rtm_type = RTN_LOCAL; |
2395 | else if (rt->rt6i_dev && (rt->rt6i_dev->flags & IFF_LOOPBACK)) | 2395 | else if (rt->dst.dev && (rt->dst.dev->flags & IFF_LOOPBACK)) |
2396 | rtm->rtm_type = RTN_LOCAL; | 2396 | rtm->rtm_type = RTN_LOCAL; |
2397 | else | 2397 | else |
2398 | rtm->rtm_type = RTN_UNICAST; | 2398 | rtm->rtm_type = RTN_UNICAST; |
@@ -2460,14 +2460,14 @@ static int rt6_fill_node(struct net *net, | |||
2460 | rcu_read_unlock(); | 2460 | rcu_read_unlock(); |
2461 | 2461 | ||
2462 | if (rt->dst.dev) | 2462 | if (rt->dst.dev) |
2463 | NLA_PUT_U32(skb, RTA_OIF, rt->rt6i_dev->ifindex); | 2463 | NLA_PUT_U32(skb, RTA_OIF, rt->dst.dev->ifindex); |
2464 | 2464 | ||
2465 | NLA_PUT_U32(skb, RTA_PRIORITY, rt->rt6i_metric); | 2465 | NLA_PUT_U32(skb, RTA_PRIORITY, rt->rt6i_metric); |
2466 | 2466 | ||
2467 | if (!(rt->rt6i_flags & RTF_EXPIRES)) | 2467 | if (!(rt->rt6i_flags & RTF_EXPIRES)) |
2468 | expires = 0; | 2468 | expires = 0; |
2469 | else if (rt->rt6i_expires - jiffies < INT_MAX) | 2469 | else if (rt->dst.expires - jiffies < INT_MAX) |
2470 | expires = rt->rt6i_expires - jiffies; | 2470 | expires = rt->dst.expires - jiffies; |
2471 | else | 2471 | else |
2472 | expires = INT_MAX; | 2472 | expires = INT_MAX; |
2473 | 2473 | ||
@@ -2661,7 +2661,7 @@ static int rt6_info_route(struct rt6_info *rt, void *p_arg) | |||
2661 | seq_printf(m, " %08x %08x %08x %08x %8s\n", | 2661 | seq_printf(m, " %08x %08x %08x %08x %8s\n", |
2662 | rt->rt6i_metric, atomic_read(&rt->dst.__refcnt), | 2662 | rt->rt6i_metric, atomic_read(&rt->dst.__refcnt), |
2663 | rt->dst.__use, rt->rt6i_flags, | 2663 | rt->dst.__use, rt->rt6i_flags, |
2664 | rt->rt6i_dev ? rt->rt6i_dev->name : ""); | 2664 | rt->dst.dev ? rt->dst.dev->name : ""); |
2665 | return 0; | 2665 | return 0; |
2666 | } | 2666 | } |
2667 | 2667 | ||