Lines Matching refs:rth
423 static inline bool rt_is_expired(const struct rtable *rth) in rt_is_expired() argument
425 return rth->rt_genid != rt_genid_ipv4(dev_net(rth->dst.dev)); in rt_is_expired()
1752 struct rtable *rth; in ip_route_input_mc() local
1763 rth = rt_dst_alloc(dev_net(dev)->loopback_dev, flags, RTN_MULTICAST, in ip_route_input_mc()
1765 if (!rth) in ip_route_input_mc()
1769 rth->dst.tclassid = itag; in ip_route_input_mc()
1771 rth->dst.output = ip_rt_bug; in ip_route_input_mc()
1772 rth->rt_is_input= 1; in ip_route_input_mc()
1776 rth->dst.input = ip_mr_input; in ip_route_input_mc()
1781 skb_dst_set(skb, &rth->dst); in ip_route_input_mc()
1820 struct rtable *rth; in __mkroute_input() local
1871 rth = rcu_dereference(fnhe->fnhe_rth_input); in __mkroute_input()
1873 rth = rcu_dereference(nhc->nhc_rth_input); in __mkroute_input()
1874 if (rt_cache_valid(rth)) { in __mkroute_input()
1875 skb_dst_set_noref(skb, &rth->dst); in __mkroute_input()
1880 rth = rt_dst_alloc(out_dev->dev, 0, res->type, in __mkroute_input()
1883 if (!rth) { in __mkroute_input()
1888 rth->rt_is_input = 1; in __mkroute_input()
1891 rth->dst.input = ip_forward; in __mkroute_input()
1893 rt_set_nexthop(rth, daddr, res, fnhe, res->fi, res->type, itag, in __mkroute_input()
1895 lwtunnel_set_redirect(&rth->dst); in __mkroute_input()
1896 skb_dst_set(skb, &rth->dst); in __mkroute_input()
2078 struct rtable *rth; in ip_route_input_slow() local
2202 rth = rcu_dereference(nhc->nhc_rth_input); in ip_route_input_slow()
2203 if (rt_cache_valid(rth)) { in ip_route_input_slow()
2204 skb_dst_set_noref(skb, &rth->dst); in ip_route_input_slow()
2210 rth = rt_dst_alloc(l3mdev_master_dev_rcu(dev) ? : net->loopback_dev, in ip_route_input_slow()
2213 if (!rth) in ip_route_input_slow()
2216 rth->dst.output= ip_rt_bug; in ip_route_input_slow()
2218 rth->dst.tclassid = itag; in ip_route_input_slow()
2220 rth->rt_is_input = 1; in ip_route_input_slow()
2224 rth->dst.input= ip_error; in ip_route_input_slow()
2225 rth->dst.error= -err; in ip_route_input_slow()
2226 rth->rt_flags &= ~RTCF_LOCAL; in ip_route_input_slow()
2232 rth->dst.lwtstate = lwtstate_get(nhc->nhc_lwtstate); in ip_route_input_slow()
2233 if (lwtunnel_input_redirect(rth->dst.lwtstate)) { in ip_route_input_slow()
2234 WARN_ON(rth->dst.input == lwtunnel_input); in ip_route_input_slow()
2235 rth->dst.lwtstate->orig_input = rth->dst.input; in ip_route_input_slow()
2236 rth->dst.input = lwtunnel_input; in ip_route_input_slow()
2239 if (unlikely(!rt_cache_route(nhc, rth))) in ip_route_input_slow()
2240 rt_add_uncached_list(rth); in ip_route_input_slow()
2242 skb_dst_set(skb, &rth->dst); in ip_route_input_slow()
2353 struct rtable *rth; in __mkroute_output() local
2428 rth = rcu_dereference(*prth); in __mkroute_output()
2429 if (rt_cache_valid(rth) && dst_hold_safe(&rth->dst)) in __mkroute_output()
2430 return rth; in __mkroute_output()
2434 rth = rt_dst_alloc(dev_out, flags, type, in __mkroute_output()
2438 if (!rth) in __mkroute_output()
2441 rth->rt_iif = orig_oif; in __mkroute_output()
2448 rth->dst.output = ip_mc_output; in __mkroute_output()
2455 rth->dst.input = ip_mr_input; in __mkroute_output()
2456 rth->dst.output = ip_mc_output; in __mkroute_output()
2462 rt_set_nexthop(rth, fl4->daddr, res, fnhe, fi, type, 0, do_cache); in __mkroute_output()
2463 lwtunnel_set_redirect(&rth->dst); in __mkroute_output()
2465 return rth; in __mkroute_output()
2482 struct rtable *rth; in ip_route_output_key_hash() local
2490 rth = ip_route_output_key_hash_rcu(net, fl4, &res, skb); in ip_route_output_key_hash()
2493 return rth; in ip_route_output_key_hash()
2504 struct rtable *rth; in ip_route_output_key_hash_rcu() local
2511 rth = ERR_PTR(-EINVAL); in ip_route_output_key_hash_rcu()
2515 rth = ERR_PTR(-ENETUNREACH); in ip_route_output_key_hash_rcu()
2562 rth = ERR_PTR(-ENODEV); in ip_route_output_key_hash_rcu()
2568 rth = ERR_PTR(-ENETUNREACH); in ip_route_output_key_hash_rcu()
2631 rth = ERR_PTR(err); in ip_route_output_key_hash_rcu()
2662 rth = __mkroute_output(res, fl4, orig_oif, dev_out, flags); in ip_route_output_key_hash_rcu()
2665 return rth; in ip_route_output_key_hash_rcu()