• Home
  • Raw
  • Download

Lines Matching refs:dst

81 static struct dst_entry	*ip6_dst_check(struct dst_entry *dst, u32 cookie);
82 static unsigned int ip6_default_advmss(const struct dst_entry *dst);
83 static unsigned int ip6_mtu(const struct dst_entry *dst);
95 static void ip6_rt_update_pmtu(struct dst_entry *dst, struct sock *sk,
97 static void rt6_do_redirect(struct dst_entry *dst, struct sock *sk,
125 rt->dst.flags |= DST_NOCACHE; in rt6_uncached_list_add()
159 struct net_device *rt_dev = rt->dst.dev; in rt6_uncached_list_flush_dev()
167 rt->dst.dev = loopback_dev; in rt6_uncached_list_flush_dev()
168 dev_hold(rt->dst.dev); in rt6_uncached_list_flush_dev()
178 return dst_metrics_write_ptr(rt->dst.from); in rt6_pcpu_cow_metrics()
181 static u32 *ipv6_cow_metrics(struct dst_entry *dst, unsigned long old) in ipv6_cow_metrics() argument
183 struct rt6_info *rt = (struct rt6_info *)dst; in ipv6_cow_metrics()
190 return dst_cow_metrics_generic(dst, old); in ipv6_cow_metrics()
206 static struct neighbour *ip6_neigh_lookup(const struct dst_entry *dst, in ip6_neigh_lookup() argument
210 struct rt6_info *rt = (struct rt6_info *) dst; in ip6_neigh_lookup()
214 n = __ipv6_neigh_lookup(dst->dev, daddr); in ip6_neigh_lookup()
217 return neigh_create(&nd_tbl, daddr, dst->dev); in ip6_neigh_lookup()
238 static unsigned int ip6_blackhole_mtu(const struct dst_entry *dst) in ip6_blackhole_mtu() argument
240 unsigned int mtu = dst_metric_raw(dst, RTAX_MTU); in ip6_blackhole_mtu()
242 return mtu ? : dst->dev->mtu; in ip6_blackhole_mtu()
245 static void ip6_rt_blackhole_update_pmtu(struct dst_entry *dst, struct sock *sk, in ip6_rt_blackhole_update_pmtu() argument
250 static void ip6_rt_blackhole_redirect(struct dst_entry *dst, struct sock *sk, in ip6_rt_blackhole_redirect() argument
272 .dst = {
289 .dst = {
304 .dst = {
322 struct dst_entry *dst = &rt->dst; in rt6_info_init() local
324 memset(dst + 1, 0, sizeof(*rt) - sizeof(*dst)); in rt6_info_init()
371 static void ip6_dst_destroy(struct dst_entry *dst) in ip6_dst_destroy() argument
373 struct rt6_info *rt = (struct rt6_info *)dst; in ip6_dst_destroy()
374 struct dst_entry *from = dst->from; in ip6_dst_destroy()
377 dst_destroy_metrics_generic(dst); in ip6_dst_destroy()
387 dst->from = NULL; in ip6_dst_destroy()
391 static void ip6_dst_ifdown(struct dst_entry *dst, struct net_device *dev, in ip6_dst_ifdown() argument
394 struct rt6_info *rt = (struct rt6_info *)dst; in ip6_dst_ifdown()
414 return time_after(jiffies, rt->dst.expires); in __rt6_check_expired()
422 if (time_after(jiffies, rt->dst.expires)) in rt6_check_expired()
424 } else if (rt->dst.from) { in rt6_check_expired()
425 return rt6_check_expired((struct rt6_info *) rt->dst.from); in rt6_check_expired()
481 for (sprt = rt; sprt; sprt = sprt->dst.rt6_next) { in rt6_device_match()
482 struct net_device *dev = sprt->dst.dev; in rt6_device_match()
550 neigh = __ipv6_neigh_lookup_noref(rt->dst.dev, &rt->rt6i_gateway); in rt6_probe()
573 dev_hold(rt->dst.dev); in rt6_probe()
574 work->dev = rt->dst.dev; in rt6_probe()
592 struct net_device *dev = rt->dst.dev; in rt6_check_dev()
611 neigh = __ipv6_neigh_lookup_noref(rt->dst.dev, &rt->rt6i_gateway); in rt6_check_neigh()
658 struct net_device *dev = rt->dst.dev; in find_match()
699 for (rt = rr_head; rt; rt = rt->dst.rt6_next) { in find_rr_leaf()
708 for (rt = fn->leaf; rt && rt != rr_head; rt = rt->dst.rt6_next) { in find_rr_leaf()
720 for (rt = cont; rt; rt = rt->dst.rt6_next) in find_rr_leaf()
740 struct rt6_info *next = rt0->dst.rt6_next; in rt6_select()
750 net = dev_net(rt0->dst.dev); in rt6_select()
874 dst_use(&rt->dst, jiffies); in ip6_pol_route_lookup()
897 struct dst_entry *dst; in rt6_lookup() local
905 dst = fib6_rule_lookup(net, &fl6, flags, ip6_pol_route_lookup); in rt6_lookup()
906 if (dst->error == 0) in rt6_lookup()
907 return (struct rt6_info *) dst; in rt6_lookup()
909 dst_release(dst); in rt6_lookup()
937 struct nl_info info = { .nl_net = dev_net(rt->dst.dev), }; in ip6_ins_rt()
954 ort = (struct rt6_info *)ort->dst.from; in ip6_rt_cache_alloc()
956 rt = __ip6_dst_alloc(dev_net(ort->dst.dev), ort->dst.dev, 0); in ip6_rt_cache_alloc()
964 rt->dst.flags |= DST_HOST; in ip6_rt_cache_alloc()
987 pcpu_rt = __ip6_dst_alloc(dev_net(rt->dst.dev), in ip6_rt_pcpu_alloc()
988 rt->dst.dev, rt->dst.flags); in ip6_rt_pcpu_alloc()
1007 dst_hold(&pcpu_rt->dst); in rt6_get_pcpu_route()
1020 struct net *net = dev_net(rt->dst.dev); in rt6_make_pcpu_route()
1022 dst_hold(&net->ipv6.ip6_null_entry->dst); in rt6_make_pcpu_route()
1032 dst_destroy(&pcpu_rt->dst); in rt6_make_pcpu_route()
1042 dst_destroy(&pcpu_rt->dst); in rt6_make_pcpu_route()
1045 dst_hold(&pcpu_rt->dst); in rt6_make_pcpu_route()
1089 dst_use(&rt->dst, jiffies); in ip6_pol_route()
1106 dst_use(&rt->dst, jiffies); in ip6_pol_route()
1110 dst_release(&rt->dst); in ip6_pol_route()
1117 dst_hold(&uncached_rt->dst); in ip6_pol_route()
1127 rt->dst.lastuse = jiffies; in ip6_pol_route()
1128 rt->dst.__use++; in ip6_pol_route()
1138 dst_hold(&rt->dst); in ip6_pol_route()
1141 dst_release(&rt->dst); in ip6_pol_route()
1202 struct dst_entry *dst; in ip6_route_output_flags() local
1204 dst = l3mdev_link_scope_lookup(net, fl6); in ip6_route_output_flags()
1205 if (dst) in ip6_route_output_flags()
1206 return dst; in ip6_route_output_flags()
1230 rt = dst_alloc(&ip6_dst_blackhole_ops, ort->dst.dev, 1, DST_OBSOLETE_NONE, 0); in ip6_blackhole_route()
1234 new = &rt->dst; in ip6_blackhole_route()
1239 dst_copy_metrics(new, &ort->dst); in ip6_blackhole_route()
1266 if (rt->dst.from && in rt6_dst_from_metrics_check()
1267 dst_metrics_ptr(&rt->dst) != dst_metrics_ptr(rt->dst.from)) in rt6_dst_from_metrics_check()
1268 dst_init_metrics(&rt->dst, dst_metrics_ptr(rt->dst.from), true); in rt6_dst_from_metrics_check()
1281 return &rt->dst; in rt6_check()
1287 rt->dst.obsolete == DST_OBSOLETE_FORCE_CHK && in rt6_dst_from_check()
1288 rt6_check((struct rt6_info *)(rt->dst.from), cookie)) in rt6_dst_from_check()
1289 return &rt->dst; in rt6_dst_from_check()
1294 static struct dst_entry *ip6_dst_check(struct dst_entry *dst, u32 cookie) in ip6_dst_check() argument
1298 rt = (struct rt6_info *) dst; in ip6_dst_check()
1308 (unlikely(dst->flags & DST_NOCACHE) && rt->dst.from)) in ip6_dst_check()
1314 static struct dst_entry *ip6_negative_advice(struct dst_entry *dst) in ip6_negative_advice() argument
1316 struct rt6_info *rt = (struct rt6_info *) dst; in ip6_negative_advice()
1322 dst = NULL; in ip6_negative_advice()
1325 dst_release(dst); in ip6_negative_advice()
1326 dst = NULL; in ip6_negative_advice()
1329 return dst; in ip6_negative_advice()
1341 dst_hold(&rt->dst); in ip6_link_failure()
1357 struct net *net = dev_net(rt->dst.dev); in rt6_do_update_pmtu()
1371 static void __ip6_rt_update_pmtu(struct dst_entry *dst, const struct sock *sk, in __ip6_rt_update_pmtu() argument
1374 struct rt6_info *rt6 = (struct rt6_info *)dst; in __ip6_rt_update_pmtu()
1379 if (dst_metric_locked(dst, RTAX_MTU)) in __ip6_rt_update_pmtu()
1382 dst_confirm(dst); in __ip6_rt_update_pmtu()
1384 if (mtu >= dst_mtu(dst)) in __ip6_rt_update_pmtu()
1416 static void ip6_rt_update_pmtu(struct dst_entry *dst, struct sock *sk, in ip6_rt_update_pmtu() argument
1419 __ip6_rt_update_pmtu(dst, sk, skb ? ipv6_hdr(skb) : NULL, mtu); in ip6_rt_update_pmtu()
1426 struct dst_entry *dst; in ip6_update_pmtu() local
1437 dst = ip6_route_output(net, NULL, &fl6); in ip6_update_pmtu()
1438 if (!dst->error) in ip6_update_pmtu()
1439 __ip6_rt_update_pmtu(dst, NULL, iph, ntohl(mtu)); in ip6_update_pmtu()
1440 dst_release(dst); in ip6_update_pmtu()
1446 struct dst_entry *dst; in ip6_sk_update_pmtu() local
1451 dst = __sk_dst_get(sk); in ip6_sk_update_pmtu()
1452 if (!dst || !dst->obsolete || in ip6_sk_update_pmtu()
1453 dst->ops->check(dst, inet6_sk(sk)->dst_cookie)) in ip6_sk_update_pmtu()
1491 for (rt = fn->leaf; rt; rt = rt->dst.rt6_next) { in __ip6_route_redirect()
1494 if (rt->dst.error) in __ip6_route_redirect()
1498 if (fl6->flowi6_oif != rt->dst.dev->ifindex) in __ip6_route_redirect()
1507 else if (rt->dst.error) { in __ip6_route_redirect()
1519 dst_hold(&rt->dst); in __ip6_route_redirect()
1545 struct dst_entry *dst; in ip6_redirect() local
1557 dst = ip6_route_redirect(net, &fl6, &ipv6_hdr(skb)->saddr); in ip6_redirect()
1558 rt6_do_redirect(dst, NULL, skb); in ip6_redirect()
1559 dst_release(dst); in ip6_redirect()
1568 struct dst_entry *dst; in ip6_redirect_no_header() local
1579 dst = ip6_route_redirect(net, &fl6, &iph->saddr); in ip6_redirect_no_header()
1580 rt6_do_redirect(dst, NULL, skb); in ip6_redirect_no_header()
1581 dst_release(dst); in ip6_redirect_no_header()
1591 static unsigned int ip6_default_advmss(const struct dst_entry *dst) in ip6_default_advmss() argument
1593 struct net_device *dev = dst->dev; in ip6_default_advmss()
1594 unsigned int mtu = dst_mtu(dst); in ip6_default_advmss()
1613 static unsigned int ip6_mtu(const struct dst_entry *dst) in ip6_mtu() argument
1615 const struct rt6_info *rt = (const struct rt6_info *)dst; in ip6_mtu()
1622 mtu = dst_metric_raw(dst, RTAX_MTU); in ip6_mtu()
1629 idev = __in6_dev_get(dst->dev); in ip6_mtu()
1637 return mtu - lwtunnel_headroom(dst->lwtstate, mtu); in ip6_mtu()
1646 struct dst_entry *dst; in icmp6_dst_alloc() local
1657 dst = ERR_PTR(-ENOMEM); in icmp6_dst_alloc()
1661 rt->dst.flags |= DST_HOST; in icmp6_dst_alloc()
1662 rt->dst.input = ip6_input; in icmp6_dst_alloc()
1663 rt->dst.output = ip6_output; in icmp6_dst_alloc()
1664 atomic_set(&rt->dst.__refcnt, 1); in icmp6_dst_alloc()
1669 dst_metric_set(&rt->dst, RTAX_HOPLIMIT, 0); in icmp6_dst_alloc()
1672 rt->dst.next = icmp6_dst_gc_list; in icmp6_dst_alloc()
1673 icmp6_dst_gc_list = &rt->dst; in icmp6_dst_alloc()
1678 dst = xfrm_lookup(net, &rt->dst, flowi6_to_flowi(fl6), NULL, 0); in icmp6_dst_alloc()
1681 return dst; in icmp6_dst_alloc()
1686 struct dst_entry *dst, **pprev; in icmp6_dst_gc() local
1692 while ((dst = *pprev) != NULL) { in icmp6_dst_gc()
1693 if (!atomic_read(&dst->__refcnt)) { in icmp6_dst_gc()
1694 *pprev = dst->next; in icmp6_dst_gc()
1695 dst_free(dst); in icmp6_dst_gc()
1697 pprev = &dst->next; in icmp6_dst_gc()
1710 struct dst_entry *dst, **pprev; in icmp6_clean_all() local
1714 while ((dst = *pprev) != NULL) { in icmp6_clean_all()
1715 struct rt6_info *rt = (struct rt6_info *) dst; in icmp6_clean_all()
1717 *pprev = dst->next; in icmp6_clean_all()
1718 dst_free(dst); in icmp6_clean_all()
1720 pprev = &dst->next; in icmp6_clean_all()
1906 rt->dst.input = ip6_mc_input; in ip6_route_info_create()
1908 rt->dst.input = ip6_input; in ip6_route_info_create()
1910 rt->dst.input = ip6_forward; in ip6_route_info_create()
1912 rt->dst.output = ip6_output; in ip6_route_info_create()
1922 rt->dst.lwtstate = lwtstate_get(lwtstate); in ip6_route_info_create()
1923 if (lwtunnel_output_redirect(rt->dst.lwtstate)) { in ip6_route_info_create()
1924 rt->dst.lwtstate->orig_output = rt->dst.output; in ip6_route_info_create()
1925 rt->dst.output = lwtunnel_output; in ip6_route_info_create()
1927 if (lwtunnel_input_redirect(rt->dst.lwtstate)) { in ip6_route_info_create()
1928 rt->dst.lwtstate->orig_input = rt->dst.input; in ip6_route_info_create()
1929 rt->dst.input = lwtunnel_input; in ip6_route_info_create()
1936 rt->dst.flags |= DST_HOST; in ip6_route_info_create()
1969 rt->dst.error = -EINVAL; in ip6_route_info_create()
1970 rt->dst.output = dst_discard_out; in ip6_route_info_create()
1971 rt->dst.input = dst_discard; in ip6_route_info_create()
1974 rt->dst.error = -EACCES; in ip6_route_info_create()
1975 rt->dst.output = ip6_pkt_prohibit_out; in ip6_route_info_create()
1976 rt->dst.input = ip6_pkt_prohibit; in ip6_route_info_create()
1981 rt->dst.error = (cfg->fc_type == RTN_THROW) ? -EAGAIN in ip6_route_info_create()
1984 rt->dst.output = ip6_pkt_discard_out; in ip6_route_info_create()
1985 rt->dst.input = ip6_pkt_discard; in ip6_route_info_create()
2029 (dev && dev != grt->dst.dev)) { in ip6_route_info_create()
2044 if (dev != grt->dst.dev) { in ip6_route_info_create()
2049 dev = grt->dst.dev; in ip6_route_info_create()
2083 rt->dst.dev = dev; in ip6_route_info_create()
2096 dst_free(&rt->dst); in ip6_route_info_create()
2125 dst_free(&rt->dst); in ip6_route_add()
2134 struct net *net = dev_net(rt->dst.dev); in __ip6_del_rt()
2137 rt->dst.flags & DST_NOCACHE) { in __ip6_del_rt()
2155 .nl_net = dev_net(rt->dst.dev), in ip6_del_rt()
2178 for (rt = fn->leaf; rt; rt = rt->dst.rt6_next) { in ip6_route_del()
2183 (!rt->dst.dev || in ip6_route_del()
2184 rt->dst.dev->ifindex != cfg->fc_ifindex)) in ip6_route_del()
2193 dst_hold(&rt->dst); in ip6_route_del()
2204 static void rt6_do_redirect(struct dst_entry *dst, struct sock *sk, struct sk_buff *skb) in rt6_do_redirect() argument
2265 rt = (struct rt6_info *) dst; in rt6_do_redirect()
2275 dst_confirm(&rt->dst); in rt6_do_redirect()
2305 netevent.old = &rt->dst; in rt6_do_redirect()
2306 netevent.new = &nrt->dst; in rt6_do_redirect()
2312 rt = (struct rt6_info *) dst_clone(&rt->dst); in rt6_do_redirect()
2326 BUG_ON(from->dst.from); in rt6_set_from()
2329 dst_hold(&from->dst); in rt6_set_from()
2330 rt->dst.from = &from->dst; in rt6_set_from()
2331 dst_init_metrics(&rt->dst, dst_metrics_ptr(&from->dst), true); in rt6_set_from()
2336 rt->dst.input = ort->dst.input; in ip6_rt_copy_init()
2337 rt->dst.output = ort->dst.output; in ip6_rt_copy_init()
2339 rt->dst.error = ort->dst.error; in ip6_rt_copy_init()
2343 rt->dst.lastuse = jiffies; in ip6_rt_copy_init()
2353 rt->dst.lwtstate = lwtstate_get(ort->dst.lwtstate); in ip6_rt_copy_init()
2376 for (rt = fn->leaf; rt; rt = rt->dst.rt6_next) { in rt6_get_route_info()
2377 if (rt->dst.dev->ifindex != dev->ifindex) in rt6_get_route_info()
2383 dst_hold(&rt->dst); in rt6_get_route_info()
2433 for (rt = table->tb6_root.leaf; rt; rt = rt->dst.rt6_next) { in rt6_get_dflt_router()
2434 if (dev == rt->dst.dev && in rt6_get_dflt_router()
2440 dst_hold(&rt->dst); in rt6_get_dflt_router()
2551 struct dst_entry *dst = skb_dst(skb); in ip6_pkt_drop() local
2556 IP6_INC_STATS(dev_net(dst->dev), ip6_dst_idev(dst), in ip6_pkt_drop()
2562 IP6_INC_STATS(dev_net(dst->dev), ip6_dst_idev(dst), in ip6_pkt_drop()
2618 rt->dst.flags |= DST_HOST; in addrconf_dst_alloc()
2619 rt->dst.input = ip6_input; in addrconf_dst_alloc()
2620 rt->dst.output = ip6_output; in addrconf_dst_alloc()
2634 rt->dst.flags |= DST_NOCACHE; in addrconf_dst_alloc()
2636 atomic_set(&rt->dst.__refcnt, 1); in addrconf_dst_alloc()
2654 if (((void *)rt->dst.dev == dev || !dev) && in fib6_remove_prefsrc()
2705 if ((rt->dst.dev == dev || !dev) && in fib6_ifdown()
2759 if (rt->dst.dev == arg->dev && in rt6_mtu_change_route()
2760 dst_metric_raw(&rt->dst, RTAX_MTU) && in rt6_mtu_change_route()
2761 !dst_metric_locked(&rt->dst, RTAX_MTU)) { in rt6_mtu_change_route()
2770 } else if (dst_mtu(&rt->dst) >= arg->mtu || in rt6_mtu_change_route()
2771 (dst_mtu(&rt->dst) < arg->mtu && in rt6_mtu_change_route()
2772 dst_mtu(&rt->dst) == idev->cnf.mtu6)) { in rt6_mtu_change_route()
2773 dst_metric_set(&rt->dst, RTAX_MTU, arg->mtu); in rt6_mtu_change_route()
3022 dst_free(&rt->dst); in ip6_route_multipath_add()
3066 dst_free(&nh->rt6_info->dst); in ip6_route_multipath_add()
3157 + lwtunnel_get_encap_size(rt->dst.lwtstate); in rt6_nlmsg_size()
3162 struct in6_addr *dst, struct in6_addr *src, in rt6_fill_node() argument
3196 switch (rt->dst.error) { in rt6_fill_node()
3213 else if (rt->dst.dev && (rt->dst.dev->flags & IFF_LOOPBACK)) in rt6_fill_node()
3218 if (!netif_carrier_ok(rt->dst.dev)) { in rt6_fill_node()
3237 if (dst) { in rt6_fill_node()
3238 if (nla_put_in6_addr(skb, RTA_DST, dst)) in rt6_fill_node()
3273 } else if (dst) { in rt6_fill_node()
3275 if (ip6_route_get_saddr(net, rt, dst, 0, &saddr_buf) == 0 && in rt6_fill_node()
3287 memcpy(metrics, dst_metrics_ptr(&rt->dst), sizeof(metrics)); in rt6_fill_node()
3298 if (rt->dst.dev && in rt6_fill_node()
3299 nla_put_u32(skb, RTA_OIF, rt->dst.dev->ifindex)) in rt6_fill_node()
3304 expires = (rt->rt6i_flags & RTF_EXPIRES) ? rt->dst.expires - jiffies : 0; in rt6_fill_node()
3306 if (rtnl_put_cacheinfo(skb, &rt->dst, 0, expires, rt->dst.error) < 0) in rt6_fill_node()
3312 if (lwtunnel_fill_encap(skb, rt->dst.lwtstate) < 0) in rt6_fill_node()
3424 skb_dst_set(skb, &rt->dst); in inet6_rtm_getroute()
3480 net->ipv6.ip6_null_entry->dst.dev = dev; in ip6_route_dev_notify()
3483 net->ipv6.ip6_prohibit_entry->dst.dev = dev; in ip6_route_dev_notify()
3485 net->ipv6.ip6_blk_hole_entry->dst.dev = dev; in ip6_route_dev_notify()
3683 net->ipv6.ip6_null_entry->dst.path = in ip6_route_net_init()
3685 net->ipv6.ip6_null_entry->dst.ops = &net->ipv6.ip6_dst_ops; in ip6_route_net_init()
3686 dst_init_metrics(&net->ipv6.ip6_null_entry->dst, in ip6_route_net_init()
3695 net->ipv6.ip6_prohibit_entry->dst.path = in ip6_route_net_init()
3697 net->ipv6.ip6_prohibit_entry->dst.ops = &net->ipv6.ip6_dst_ops; in ip6_route_net_init()
3698 dst_init_metrics(&net->ipv6.ip6_prohibit_entry->dst, in ip6_route_net_init()
3706 net->ipv6.ip6_blk_hole_entry->dst.path = in ip6_route_net_init()
3708 net->ipv6.ip6_blk_hole_entry->dst.ops = &net->ipv6.ip6_dst_ops; in ip6_route_net_init()
3709 dst_init_metrics(&net->ipv6.ip6_blk_hole_entry->dst, in ip6_route_net_init()
3812 init_net.ipv6.ip6_null_entry->dst.dev = init_net.loopback_dev; in ip6_route_init_special_entries()
3815 init_net.ipv6.ip6_prohibit_entry->dst.dev = init_net.loopback_dev; in ip6_route_init_special_entries()
3817 init_net.ipv6.ip6_blk_hole_entry->dst.dev = init_net.loopback_dev; in ip6_route_init_special_entries()