Lines Matching refs:rth
420 static inline bool rt_is_expired(const struct rtable *rth) in rt_is_expired() argument
422 return rth->rt_genid != rt_genid_ipv4(dev_net(rth->dst.dev)); in rt_is_expired()
1722 struct rtable *rth; in ip_route_input_mc() local
1733 rth = rt_dst_alloc(dev_net(dev)->loopback_dev, flags, RTN_MULTICAST, in ip_route_input_mc()
1735 if (!rth) in ip_route_input_mc()
1739 rth->dst.tclassid = itag; in ip_route_input_mc()
1741 rth->dst.output = ip_rt_bug; in ip_route_input_mc()
1742 rth->rt_is_input= 1; in ip_route_input_mc()
1746 rth->dst.input = ip_mr_input; in ip_route_input_mc()
1750 skb_dst_set(skb, &rth->dst); in ip_route_input_mc()
1789 struct rtable *rth; in __mkroute_input() local
1840 rth = rcu_dereference(fnhe->fnhe_rth_input); in __mkroute_input()
1842 rth = rcu_dereference(nhc->nhc_rth_input); in __mkroute_input()
1843 if (rt_cache_valid(rth)) { in __mkroute_input()
1844 skb_dst_set_noref(skb, &rth->dst); in __mkroute_input()
1849 rth = rt_dst_alloc(out_dev->dev, 0, res->type, in __mkroute_input()
1852 if (!rth) { in __mkroute_input()
1857 rth->rt_is_input = 1; in __mkroute_input()
1860 rth->dst.input = ip_forward; in __mkroute_input()
1862 rt_set_nexthop(rth, daddr, res, fnhe, res->fi, res->type, itag, in __mkroute_input()
1864 lwtunnel_set_redirect(&rth->dst); in __mkroute_input()
1865 skb_dst_set(skb, &rth->dst); in __mkroute_input()
2047 struct rtable *rth; in ip_route_input_slow() local
2170 rth = rcu_dereference(nhc->nhc_rth_input); in ip_route_input_slow()
2171 if (rt_cache_valid(rth)) { in ip_route_input_slow()
2172 skb_dst_set_noref(skb, &rth->dst); in ip_route_input_slow()
2178 rth = rt_dst_alloc(l3mdev_master_dev_rcu(dev) ? : net->loopback_dev, in ip_route_input_slow()
2181 if (!rth) in ip_route_input_slow()
2184 rth->dst.output= ip_rt_bug; in ip_route_input_slow()
2186 rth->dst.tclassid = itag; in ip_route_input_slow()
2188 rth->rt_is_input = 1; in ip_route_input_slow()
2192 rth->dst.input= ip_error; in ip_route_input_slow()
2193 rth->dst.error= -err; in ip_route_input_slow()
2194 rth->rt_flags &= ~RTCF_LOCAL; in ip_route_input_slow()
2200 rth->dst.lwtstate = lwtstate_get(nhc->nhc_lwtstate); in ip_route_input_slow()
2201 if (lwtunnel_input_redirect(rth->dst.lwtstate)) { in ip_route_input_slow()
2202 WARN_ON(rth->dst.input == lwtunnel_input); in ip_route_input_slow()
2203 rth->dst.lwtstate->orig_input = rth->dst.input; in ip_route_input_slow()
2204 rth->dst.input = lwtunnel_input; in ip_route_input_slow()
2207 if (unlikely(!rt_cache_route(nhc, rth))) in ip_route_input_slow()
2208 rt_add_uncached_list(rth); in ip_route_input_slow()
2210 skb_dst_set(skb, &rth->dst); in ip_route_input_slow()
2321 struct rtable *rth; in __mkroute_output() local
2396 rth = rcu_dereference(*prth); in __mkroute_output()
2397 if (rt_cache_valid(rth) && dst_hold_safe(&rth->dst)) in __mkroute_output()
2398 return rth; in __mkroute_output()
2402 rth = rt_dst_alloc(dev_out, flags, type, in __mkroute_output()
2406 if (!rth) in __mkroute_output()
2409 rth->rt_iif = orig_oif; in __mkroute_output()
2416 rth->dst.output = ip_mc_output; in __mkroute_output()
2423 rth->dst.input = ip_mr_input; in __mkroute_output()
2424 rth->dst.output = ip_mc_output; in __mkroute_output()
2430 rt_set_nexthop(rth, fl4->daddr, res, fnhe, fi, type, 0, do_cache); in __mkroute_output()
2431 lwtunnel_set_redirect(&rth->dst); in __mkroute_output()
2433 return rth; in __mkroute_output()
2450 struct rtable *rth; in ip_route_output_key_hash() local
2458 rth = ip_route_output_key_hash_rcu(net, fl4, &res, skb); in ip_route_output_key_hash()
2461 return rth; in ip_route_output_key_hash()
2472 struct rtable *rth; in ip_route_output_key_hash_rcu() local
2479 rth = ERR_PTR(-EINVAL); in ip_route_output_key_hash_rcu()
2483 rth = ERR_PTR(-ENETUNREACH); in ip_route_output_key_hash_rcu()
2530 rth = ERR_PTR(-ENODEV); in ip_route_output_key_hash_rcu()
2536 rth = ERR_PTR(-ENETUNREACH); in ip_route_output_key_hash_rcu()
2599 rth = ERR_PTR(err); in ip_route_output_key_hash_rcu()
2632 rth = __mkroute_output(res, fl4, orig_oif, dev_out, flags); in ip_route_output_key_hash_rcu()
2635 return rth; in ip_route_output_key_hash_rcu()