Home
last modified time | relevance | path

Searched refs:rt (Results 1 – 25 of 87) sorted by relevance

1234

/net/x25/
Dx25_route.c29 struct x25_route *rt; in x25_add_route() local
36 rt = list_entry(entry, struct x25_route, node); in x25_add_route()
38 if (!memcmp(&rt->address, address, sigdigits) && in x25_add_route()
39 rt->sigdigits == sigdigits) in x25_add_route()
43 rt = kmalloc(sizeof(*rt), GFP_ATOMIC); in x25_add_route()
45 if (!rt) in x25_add_route()
48 strcpy(rt->address.x25_addr, "000000000000000"); in x25_add_route()
49 memcpy(rt->address.x25_addr, address->x25_addr, sigdigits); in x25_add_route()
51 rt->sigdigits = sigdigits; in x25_add_route()
52 rt->dev = dev; in x25_add_route()
[all …]
/net/decnet/
Ddn_route.c149 struct dn_route *rt = (struct dn_route *) dst; in dn_dst_destroy() local
151 if (rt->n) in dn_dst_destroy()
152 neigh_release(rt->n); in dn_dst_destroy()
159 struct dn_route *rt = (struct dn_route *) dst; in dn_dst_ifdown() local
160 struct neighbour *n = rt->n; in dn_dst_ifdown()
182 struct dn_route *rt; in dn_dst_check_expire() local
191 while ((rt = rcu_dereference_protected(*rtp, in dn_dst_check_expire()
193 if (atomic_read(&rt->dst.__refcnt) > 1 || in dn_dst_check_expire()
194 (now - rt->dst.lastuse) < expire) { in dn_dst_check_expire()
195 rtp = &rt->dn_next; in dn_dst_check_expire()
[all …]
/net/ipv6/
Droute.c106 struct fib6_info *rt, struct dst_entry *dst,
133 void rt6_uncached_list_add(struct rt6_info *rt) in rt6_uncached_list_add() argument
137 rt->rt6i_uncached_list = ul; in rt6_uncached_list_add()
140 list_add_tail(&rt->rt6i_uncached, &ul->head); in rt6_uncached_list_add()
144 void rt6_uncached_list_del(struct rt6_info *rt) in rt6_uncached_list_del() argument
146 if (!list_empty(&rt->rt6i_uncached)) { in rt6_uncached_list_del()
147 struct uncached_list *ul = rt->rt6i_uncached_list; in rt6_uncached_list_del()
148 struct net *net = dev_net(rt->dst.dev); in rt6_uncached_list_del()
151 list_del(&rt->rt6i_uncached); in rt6_uncached_list_del()
167 struct rt6_info *rt; in rt6_uncached_list_flush_dev() local
[all …]
Dip6_fib.c315 struct rt6_info *rt; in fib6_rule_lookup() local
317 rt = lookup(net, net->ipv6.fib6_main_tbl, fl6, skb, flags); in fib6_rule_lookup()
318 if (rt->dst.error == -EAGAIN) { in fib6_rule_lookup()
319 ip6_rt_put_flags(rt, flags); in fib6_rule_lookup()
320 rt = net->ipv6.ip6_null_entry; in fib6_rule_lookup()
322 dst_hold(&rt->dst); in fib6_rule_lookup()
325 return &rt->dst; in fib6_rule_lookup()
362 struct fib6_info *rt) in call_fib6_entry_notifier() argument
365 .rt = rt, in call_fib6_entry_notifier()
373 struct fib6_info *rt, in call_fib6_entry_notifiers() argument
[all …]
Dfib6_rules.c111 struct rt6_info *rt; in fib6_rule_lookup() local
113 rt = lookup(net, net->ipv6.fib6_local_tbl, fl6, skb, flags); in fib6_rule_lookup()
114 if (rt != net->ipv6.ip6_null_entry && rt->dst.error != -EAGAIN) in fib6_rule_lookup()
115 return &rt->dst; in fib6_rule_lookup()
116 ip6_rt_put_flags(rt, flags); in fib6_rule_lookup()
117 rt = lookup(net, net->ipv6.fib6_main_tbl, fl6, skb, flags); in fib6_rule_lookup()
118 if (rt->dst.error != -EAGAIN) in fib6_rule_lookup()
119 return &rt->dst; in fib6_rule_lookup()
120 ip6_rt_put_flags(rt, flags); in fib6_rule_lookup()
196 struct rt6_info *rt = NULL; in __fib6_rule_action() local
[all …]
Dip6_output.c505 struct rt6_info *rt; in ip6_forward() local
512 rt = (struct rt6_info *) dst; in ip6_forward()
513 if (rt->rt6i_flags & RTF_GATEWAY) in ip6_forward()
514 target = &rt->rt6i_gateway; in ip6_forward()
766 struct rt6_info *rt = (struct rt6_info *)skb_dst(skb); in ip6_fragment() local
817 hroom = LL_RESERVED_SPACE(rt->dst.dev); in ip6_fragment()
862 IP6_INC_STATS(net, ip6_dst_idev(&rt->dst), in ip6_fragment()
874 IP6_INC_STATS(net, ip6_dst_idev(&rt->dst), in ip6_fragment()
881 IP6_INC_STATS(net, ip6_dst_idev(&rt->dst), in ip6_fragment()
900 ip6_frag_init(skb, hlen, mtu, rt->dst.dev->needed_tailroom, in ip6_fragment()
[all …]
/net/ipv4/
Droute.c435 const struct rtable *rt = container_of(dst, struct rtable, dst); in ipv4_neigh_lookup() local
441 if (likely(rt->rt_gw_family == AF_INET)) { in ipv4_neigh_lookup()
442 n = ip_neigh_gw4(dev, rt->rt_gw4); in ipv4_neigh_lookup()
443 } else if (rt->rt_gw_family == AF_INET6) { in ipv4_neigh_lookup()
444 n = ip_neigh_gw6(dev, &rt->rt_gw6); in ipv4_neigh_lookup()
462 const struct rtable *rt = container_of(dst, struct rtable, dst); in ipv4_confirm_neigh() local
466 if (rt->rt_gw_family == AF_INET) { in ipv4_confirm_neigh()
467 pkey = (const __be32 *)&rt->rt_gw4; in ipv4_confirm_neigh()
468 } else if (rt->rt_gw_family == AF_INET6) { in ipv4_confirm_neigh()
469 return __ipv6_confirm_neigh_stub(dev, &rt->rt_gw6); in ipv4_confirm_neigh()
[all …]
Dxfrm4_policy.c26 struct rtable *rt; in __xfrm4_dst_lookup() local
38 rt = __ip_route_output_key(net, fl4); in __xfrm4_dst_lookup()
39 if (!IS_ERR(rt)) in __xfrm4_dst_lookup()
40 return &rt->dst; in __xfrm4_dst_lookup()
42 return ERR_CAST(rt); in __xfrm4_dst_lookup()
74 struct rtable *rt = (struct rtable *)xdst->route; in xfrm4_fill_dst() local
77 xdst->u.rt.rt_iif = fl4->flowi4_iif; in xfrm4_fill_dst()
84 xdst->u.rt.rt_is_input = rt->rt_is_input; in xfrm4_fill_dst()
85 xdst->u.rt.rt_flags = rt->rt_flags & (RTCF_BROADCAST | RTCF_MULTICAST | in xfrm4_fill_dst()
87 xdst->u.rt.rt_type = rt->rt_type; in xfrm4_fill_dst()
[all …]
Dicmp.c310 static bool icmpv4_xrlim_allow(struct net *net, struct rtable *rt, in icmpv4_xrlim_allow() argument
313 struct dst_entry *dst = &rt->dst; in icmpv4_xrlim_allow()
365 struct ipcm_cookie *ipc, struct rtable **rt) in icmp_push_reply() argument
370 sk = icmp_sk(dev_net((*rt)->dst.dev)); in icmp_push_reply()
374 ipc, rt, MSG_DONTWAIT) < 0) { in icmp_push_reply()
401 struct rtable *rt = skb_rtable(skb); in icmp_reply() local
402 struct net *net = dev_net(rt->dst.dev); in icmp_reply()
448 rt = ip_route_output_key(net, &fl4); in icmp_reply()
449 if (IS_ERR(rt)) in icmp_reply()
451 if (icmpv4_xrlim_allow(net, rt, &fl4, type, code)) in icmp_reply()
[all …]
Ddatagram.c25 struct rtable *rt; in __ip4_datagram_connect() local
48 rt = ip_route_connect(fl4, usin->sin_addr.s_addr, saddr, in __ip4_datagram_connect()
52 if (IS_ERR(rt)) { in __ip4_datagram_connect()
53 err = PTR_ERR(rt); in __ip4_datagram_connect()
59 if ((rt->rt_flags & RTCF_BROADCAST) && !sock_flag(sk, SOCK_BROADCAST)) { in __ip4_datagram_connect()
60 ip_rt_put(rt); in __ip4_datagram_connect()
78 sk_dst_set(sk, &rt->dst); in __ip4_datagram_connect()
107 struct rtable *rt; in ip4_datagram_release_cb() local
119 rt = ip_route_output_ports(sock_net(sk), &fl4, sk, daddr, in ip4_datagram_release_cb()
124 dst = !IS_ERR(rt) ? &rt->dst : NULL; in ip4_datagram_release_cb()
Dip_output.c148 struct rtable *rt = skb_rtable(skb); in ip_build_and_send_pkt() local
159 iph->ttl = ip_select_ttl(inet, &rt->dst); in ip_build_and_send_pkt()
163 if (ip_dont_fragment(sk, &rt->dst)) { in ip_build_and_send_pkt()
173 ip_options_build(skb, &opt->opt, daddr, rt, 0); in ip_build_and_send_pkt()
188 struct rtable *rt = (struct rtable *)dst; in ip_finish_output2() local
194 if (rt->rt_type == RTN_MULTICAST) { in ip_finish_output2()
196 } else if (rt->rt_type == RTN_BROADCAST) in ip_finish_output2()
222 neigh = ip_neigh_for_gw(rt, skb, &is_v6gw); in ip_finish_output2()
363 struct rtable *rt = skb_rtable(skb); in ip_mc_output() local
364 struct net_device *dev = rt->dst.dev; in ip_mc_output()
[all …]
Dnetfilter.c23 struct rtable *rt; in ip_route_me_harder() local
49 rt = ip_route_output_key(net, &fl4); in ip_route_me_harder()
50 if (IS_ERR(rt)) in ip_route_me_harder()
51 return PTR_ERR(rt); in ip_route_me_harder()
55 skb_dst_set(skb, &rt->dst); in ip_route_me_harder()
86 struct rtable *rt = ip_route_output_key(net, &fl->u.ip4); in nf_ip_route() local
87 if (IS_ERR(rt)) in nf_ip_route()
88 return PTR_ERR(rt); in nf_ip_route()
89 *dst = &rt->dst; in nf_ip_route()
Dip_tunnel.c295 struct rtable *rt; in ip_tunnel_bind_dev() local
301 rt = ip_route_output_key(tunnel->net, &fl4); in ip_tunnel_bind_dev()
303 if (!IS_ERR(rt)) { in ip_tunnel_bind_dev()
304 tdev = rt->dst.dev; in ip_tunnel_bind_dev()
305 ip_rt_put(rt); in ip_tunnel_bind_dev()
490 struct rtable *rt, __be16 df, in tnl_update_pmtu() argument
502 mtu = dst_mtu(&rt->dst) - dev->hard_header_len in tnl_update_pmtu()
555 struct rtable *rt = NULL; in ip_md_tunnel_xmit() local
583 rt = dst_cache_get_ip4(&tun_info->dst_cache, &fl4.saddr); in ip_md_tunnel_xmit()
584 if (!rt) { in ip_md_tunnel_xmit()
[all …]
Dip_forward.c90 struct rtable *rt; /* Route we use */ in ip_forward() local
124 rt = skb_rtable(skb); in ip_forward()
126 if (opt->is_strictroute && rt->rt_uses_gateway) in ip_forward()
130 mtu = ip_dst_mtu_maybe_forward(&rt->dst, true); in ip_forward()
139 if (skb_cow(skb, LL_RESERVED_SPACE(rt->dst.dev)+rt->dst.header_len)) in ip_forward()
158 net, NULL, skb, skb->dev, rt->dst.dev, in ip_forward()
Darp.c431 struct rtable *rt; in arp_filter() local
436 rt = ip_route_output(net, sip, tip, 0, l3mdev_master_ifindex_rcu(dev)); in arp_filter()
437 if (IS_ERR(rt)) in arp_filter()
439 if (rt->dst.dev != dev) { in arp_filter()
443 ip_rt_put(rt); in arp_filter()
451 struct net_device *dev, struct rtable *rt) in arp_fwd_proxy() argument
456 if (rt->dst.dev == dev) in arp_fwd_proxy()
469 out_dev = __in_dev_get_rcu(rt->dst.dev); in arp_fwd_proxy()
496 struct net_device *dev, struct rtable *rt, in arp_fwd_pvlan() argument
500 if (rt->dst.dev != dev) in arp_fwd_pvlan()
[all …]
/net/mpls/
Daf_mpls.c73 static void rtmsg_lfib(int event, u32 label, struct mpls_route *rt,
79 struct mpls_route *rt = NULL; in mpls_route_input_rcu() local
84 rt = rcu_dereference(platform_label[index]); in mpls_route_input_rcu()
86 return rt; in mpls_route_input_rcu()
95 static u8 *__mpls_nh_via(struct mpls_route *rt, struct mpls_nh *nh) in __mpls_nh_via() argument
97 return (u8 *)nh + rt->rt_via_offset; in __mpls_nh_via()
100 static const u8 *mpls_nh_via(const struct mpls_route *rt, in mpls_nh_via() argument
103 return __mpls_nh_via((struct mpls_route *)rt, (struct mpls_nh *)nh); in mpls_nh_via()
156 static u32 mpls_multipath_hash(struct mpls_route *rt, struct sk_buff *skb) in mpls_multipath_hash() argument
223 static struct mpls_nh *mpls_get_nexthop(struct mpls_route *rt, u8 index) in mpls_get_nexthop() argument
[all …]
Dinternal.h160 #define for_nexthops(rt) { \ argument
162 for (nhsel = 0, nh = (rt)->rt_nh, __nh = (u8 *)((rt)->rt_nh); \
163 nhsel < (rt)->rt_nhn; \
164 __nh += rt->rt_nh_size, nh = (struct mpls_nh *)__nh, nhsel++)
166 #define change_nexthops(rt) { \ argument
168 for (nhsel = 0, nh = (struct mpls_nh *)((rt)->rt_nh), \
169 __nh = (u8 *)((rt)->rt_nh); \
170 nhsel < (rt)->rt_nhn; \
171 __nh += rt->rt_nh_size, nh = (struct mpls_nh *)__nh, nhsel++)
173 #define endfor_nexthops(rt) } argument
/net/sunrpc/
Dtimer.c35 void rpc_init_rtt(struct rpc_rtt *rt, unsigned long timeo) in rpc_init_rtt() argument
40 rt->timeo = timeo; in rpc_init_rtt()
45 rt->srtt[i] = init; in rpc_init_rtt()
46 rt->sdrtt[i] = RPC_RTO_INIT; in rpc_init_rtt()
47 rt->ntimeouts[i] = 0; in rpc_init_rtt()
61 void rpc_update_rtt(struct rpc_rtt *rt, unsigned int timer, long m) in rpc_update_rtt() argument
75 srtt = (long *)&rt->srtt[timer]; in rpc_update_rtt()
82 sdrtt = (long *)&rt->sdrtt[timer]; in rpc_update_rtt()
110 unsigned long rpc_calc_rto(struct rpc_rtt *rt, unsigned int timer) in rpc_calc_rto() argument
115 return rt->timeo; in rpc_calc_rto()
[all …]
/net/ipv6/netfilter/
Dnft_fib_ipv6.c59 struct rt6_info *rt; in __nft_fib6_eval_type() local
76 route_err = nf_ip6_route(nft_net(pkt), (struct dst_entry **)&rt, in __nft_fib6_eval_type()
81 if (rt->rt6i_flags & RTF_REJECT) { in __nft_fib6_eval_type()
82 route_err = rt->dst.error; in __nft_fib6_eval_type()
83 dst_release(&rt->dst); in __nft_fib6_eval_type()
87 if (ipv6_anycast_destination((struct dst_entry *)rt, &fl6.daddr)) in __nft_fib6_eval_type()
89 else if (!dev && rt->rt6i_flags & RTF_LOCAL) in __nft_fib6_eval_type()
92 dst_release(&rt->dst); in __nft_fib6_eval_type()
150 struct rt6_info *rt; in nft_fib6_eval() local
173 rt = (void *)ip6_route_lookup(nft_net(pkt), &fl6, pkt->skb, in nft_fib6_eval()
[all …]
Dip6t_rpfilter.c35 struct rt6_info *rt; in rpfilter_lookup_reverse6() local
63 rt = (void *)ip6_route_lookup(net, &fl6, skb, lookup_flags); in rpfilter_lookup_reverse6()
64 if (rt->dst.error) in rpfilter_lookup_reverse6()
67 if (rt->rt6i_flags & (RTF_REJECT|RTF_ANYCAST)) in rpfilter_lookup_reverse6()
70 if (rt->rt6i_flags & RTF_LOCAL) { in rpfilter_lookup_reverse6()
75 if (rt->rt6i_idev->dev == dev || in rpfilter_lookup_reverse6()
76 l3mdev_master_ifindex_rcu(rt->rt6i_idev->dev) == dev->ifindex || in rpfilter_lookup_reverse6()
80 ip6_rt_put(rt); in rpfilter_lookup_reverse6()
/net/netfilter/ipvs/
Dip_vs_xmit.c127 struct rtable *rt; in do_output_route4() local
136 rt = ip_route_output_key(net, &fl4); in do_output_route4()
137 if (IS_ERR(rt)) { in do_output_route4()
139 if (PTR_ERR(rt) == -EINVAL && *saddr && in do_output_route4()
148 ip_rt_put(rt); in do_output_route4()
155 return rt; in do_output_route4()
159 static inline int __ip_vs_is_local_route6(struct rt6_info *rt) in __ip_vs_is_local_route6() argument
161 return rt->dst.dev && rt->dst.dev->flags & IFF_LOOPBACK; in __ip_vs_is_local_route6()
314 struct rtable *rt; /* Route to the other host */ in __ip_vs_get_out_rt() local
321 rt = (struct rtable *) dest_dst->dst_cache; in __ip_vs_get_out_rt()
[all …]
/net/appletalk/
Datalk_proc.c122 struct atalk_route *rt; in atalk_seq_route_show() local
130 rt = &atrtr_default; in atalk_seq_route_show()
132 ntohs(rt->gateway.s_net), rt->gateway.s_node, in atalk_seq_route_show()
133 rt->flags, rt->dev->name); in atalk_seq_route_show()
136 rt = v; in atalk_seq_route_show()
138 ntohs(rt->target.s_net), rt->target.s_node, in atalk_seq_route_show()
139 ntohs(rt->gateway.s_net), rt->gateway.s_node, in atalk_seq_route_show()
140 rt->flags, rt->dev->name); in atalk_seq_route_show()
Dddp.c499 struct atalk_route *rt; in atrtr_create() local
515 for (rt = atalk_routes; rt; rt = rt->next) { in atrtr_create()
516 if (r->rt_flags != rt->flags) in atrtr_create()
519 if (ta->sat_addr.s_net == rt->target.s_net) { in atrtr_create()
520 if (!(rt->flags & RTF_HOST)) in atrtr_create()
522 if (ta->sat_addr.s_node == rt->target.s_node) in atrtr_create()
552 if (!rt) { in atrtr_create()
553 rt = kzalloc(sizeof(*rt), GFP_ATOMIC); in atrtr_create()
556 if (!rt) in atrtr_create()
559 rt->next = atalk_routes; in atrtr_create()
[all …]
/net/bridge/
Dbr_nf_core.c74 struct rtable *rt = &br->fake_rtable; in br_netfilter_rtable_init() local
76 atomic_set(&rt->dst.__refcnt, 1); in br_netfilter_rtable_init()
77 rt->dst.dev = br->dev; in br_netfilter_rtable_init()
78 dst_init_metrics(&rt->dst, br_dst_default_metrics, true); in br_netfilter_rtable_init()
79 rt->dst.flags = DST_NOXFRM | DST_FAKE_RTABLE; in br_netfilter_rtable_init()
80 rt->dst.ops = &fake_dst_ops; in br_netfilter_rtable_init()
/net/netfilter/
Dnf_flow_table_ip.c245 struct rtable *rt; in nf_flow_offload_ip_hook() local
262 rt = (struct rtable *)flow->tuplehash[dir].tuple.dst_cache; in nf_flow_offload_ip_hook()
263 outdev = rt->dst.dev; in nf_flow_offload_ip_hook()
275 if (nf_flow_offload_dst_check(&rt->dst)) { in nf_flow_offload_ip_hook()
288 if (unlikely(dst_xfrm(&rt->dst))) { in nf_flow_offload_ip_hook()
292 return nf_flow_xmit_xfrm(skb, state, &rt->dst); in nf_flow_offload_ip_hook()
296 nexthop = rt_nexthop(rt, flow->tuplehash[!dir].tuple.src_v4.s_addr); in nf_flow_offload_ip_hook()
297 skb_dst_set_noref(skb, &rt->dst); in nf_flow_offload_ip_hook()
477 struct rt6_info *rt; in nf_flow_offload_ipv6_hook() local
491 rt = (struct rt6_info *)flow->tuplehash[dir].tuple.dst_cache; in nf_flow_offload_ipv6_hook()
[all …]

1234