/net/x25/ |
D | x25_route.c | 34 struct x25_route *rt; in x25_add_route() local 41 rt = list_entry(entry, struct x25_route, node); in x25_add_route() 43 if (!memcmp(&rt->address, address, sigdigits) && in x25_add_route() 44 rt->sigdigits == sigdigits) in x25_add_route() 48 rt = kmalloc(sizeof(*rt), GFP_ATOMIC); in x25_add_route() 50 if (!rt) in x25_add_route() 53 strcpy(rt->address.x25_addr, "000000000000000"); in x25_add_route() 54 memcpy(rt->address.x25_addr, address->x25_addr, sigdigits); in x25_add_route() 56 rt->sigdigits = sigdigits; in x25_add_route() 57 rt->dev = dev; in x25_add_route() [all …]
|
/net/ipv6/ |
D | route.c | 79 static void ip6_rt_copy_init(struct rt6_info *rt, struct rt6_info *ort); 98 static void rt6_dst_from_metrics_check(struct rt6_info *rt); 99 static int rt6_score_route(struct rt6_info *rt, int oif, int strict); 117 static void rt6_uncached_list_add(struct rt6_info *rt) in rt6_uncached_list_add() argument 121 rt->dst.flags |= DST_NOCACHE; in rt6_uncached_list_add() 122 rt->rt6i_uncached_list = ul; in rt6_uncached_list_add() 125 list_add_tail(&rt->rt6i_uncached, &ul->head); in rt6_uncached_list_add() 129 static void rt6_uncached_list_del(struct rt6_info *rt) in rt6_uncached_list_del() argument 131 if (!list_empty(&rt->rt6i_uncached)) { in rt6_uncached_list_del() 132 struct uncached_list *ul = rt->rt6i_uncached_list; in rt6_uncached_list_del() [all …]
|
D | ip6_fib.c | 170 static void rt6_rcu_free(struct rt6_info *rt) in rt6_rcu_free() argument 172 call_rcu(&rt->dst.rcu_head, dst_rcu_free); in rt6_rcu_free() 198 static void rt6_release(struct rt6_info *rt) in rt6_release() argument 200 if (atomic_dec_and_test(&rt->rt6i_ref)) { in rt6_release() 201 rt6_free_pcpu(rt); in rt6_release() 202 rt6_rcu_free(rt); in rt6_release() 308 struct rt6_info *rt; in fib6_rule_lookup() local 310 rt = lookup(net, net->ipv6.fib6_main_tbl, fl6, flags); in fib6_rule_lookup() 311 if (rt->dst.error == -EAGAIN) { in fib6_rule_lookup() 312 ip6_rt_put(rt); in fib6_rule_lookup() [all …]
|
D | fib6_rules.c | 54 struct rt6_info *rt = NULL; in fib6_rule_action() local 65 rt = net->ipv6.ip6_null_entry; in fib6_rule_action() 70 rt = net->ipv6.ip6_blk_hole_entry; in fib6_rule_action() 74 rt = net->ipv6.ip6_prohibit_entry; in fib6_rule_action() 84 rt = lookup(net, table, flp6, flags); in fib6_rule_action() 85 if (rt != net->ipv6.ip6_null_entry) { in fib6_rule_action() 97 ip6_dst_idev(&rt->dst)->dev, in fib6_rule_action() 107 err = rt->dst.error; in fib6_rule_action() 112 ip6_rt_put(rt); in fib6_rule_action() 114 rt = NULL; in fib6_rule_action() [all …]
|
D | ip6_output.c | 475 struct rt6_info *rt; in ip6_forward() local 482 rt = (struct rt6_info *) dst; in ip6_forward() 483 if (rt->rt6i_flags & RTF_GATEWAY) in ip6_forward() 484 target = &rt->rt6i_gateway; in ip6_forward() 573 struct rt6_info *rt = (struct rt6_info *)skb_dst(skb); in ip6_fragment() local 625 hroom = LL_RESERVED_SPACE(rt->dst.dev); in ip6_fragment() 685 dst_hold(&rt->dst); in ip6_fragment() 713 IP6_INC_STATS(net, ip6_dst_idev(&rt->dst), in ip6_fragment() 727 IP6_INC_STATS(net, ip6_dst_idev(&rt->dst), in ip6_fragment() 729 ip6_rt_put(rt); in ip6_fragment() [all …]
|
D | anycast.c | 79 struct rt6_info *rt; in ipv6_sock_ac_join() local 81 rt = rt6_lookup(net, addr, NULL, 0, 0); in ipv6_sock_ac_join() 82 if (rt) { in ipv6_sock_ac_join() 83 dev = rt->dst.dev; in ipv6_sock_ac_join() 84 ip6_rt_put(rt); in ipv6_sock_ac_join() 225 static struct ifacaddr6 *aca_alloc(struct rt6_info *rt, in aca_alloc() argument 228 struct inet6_dev *idev = rt->rt6i_idev; in aca_alloc() 238 aca->aca_rt = rt; in aca_alloc() 253 struct rt6_info *rt; in __ipv6_dev_ac_inc() local 272 rt = addrconf_dst_alloc(idev, addr, true); in __ipv6_dev_ac_inc() [all …]
|
/net/decnet/ |
D | dn_route.c | 156 struct dn_route *rt = (struct dn_route *) dst; in dn_dst_destroy() local 158 if (rt->n) in dn_dst_destroy() 159 neigh_release(rt->n); in dn_dst_destroy() 166 struct dn_route *rt = (struct dn_route *) dst; in dn_dst_ifdown() local 167 struct neighbour *n = rt->n; in dn_dst_ifdown() 186 static inline void dnrt_free(struct dn_route *rt) in dnrt_free() argument 188 call_rcu_bh(&rt->dst.rcu_head, dst_rcu_free); in dnrt_free() 194 struct dn_route *rt; in dn_dst_check_expire() local 203 while ((rt = rcu_dereference_protected(*rtp, in dn_dst_check_expire() 205 if (atomic_read(&rt->dst.__refcnt) || in dn_dst_check_expire() [all …]
|
/net/ipv4/ |
D | route.c | 452 const struct rtable *rt; in ipv4_neigh_lookup() local 455 rt = (const struct rtable *) dst; in ipv4_neigh_lookup() 456 if (rt->rt_gateway) in ipv4_neigh_lookup() 457 pkey = (const __be32 *) &rt->rt_gateway; in ipv4_neigh_lookup() 580 static inline void rt_free(struct rtable *rt) in rt_free() argument 582 call_rcu(&rt->dst.rcu_head, dst_rcu_free); in rt_free() 589 struct rtable *rt; in fnhe_flush_routes() local 591 rt = rcu_dereference(fnhe->fnhe_rth_input); in fnhe_flush_routes() 592 if (rt) { in fnhe_flush_routes() 594 rt_free(rt); in fnhe_flush_routes() [all …]
|
D | xfrm4_policy.c | 28 struct rtable *rt; in __xfrm4_dst_lookup() local 40 rt = __ip_route_output_key(net, fl4); in __xfrm4_dst_lookup() 41 if (!IS_ERR(rt)) in __xfrm4_dst_lookup() 42 return &rt->dst; in __xfrm4_dst_lookup() 44 return ERR_CAST(rt); in __xfrm4_dst_lookup() 87 struct rtable *rt = (struct rtable *)xdst->route; in xfrm4_fill_dst() local 90 xdst->u.rt.rt_iif = fl4->flowi4_iif; in xfrm4_fill_dst() 97 xdst->u.rt.rt_is_input = rt->rt_is_input; in xfrm4_fill_dst() 98 xdst->u.rt.rt_flags = rt->rt_flags & (RTCF_BROADCAST | RTCF_MULTICAST | in xfrm4_fill_dst() 100 xdst->u.rt.rt_type = rt->rt_type; in xfrm4_fill_dst() [all …]
|
D | icmp.c | 293 static bool icmpv4_xrlim_allow(struct net *net, struct rtable *rt, in icmpv4_xrlim_allow() argument 296 struct dst_entry *dst = &rt->dst; in icmpv4_xrlim_allow() 360 struct ipcm_cookie *ipc, struct rtable **rt) in icmp_push_reply() argument 365 sk = icmp_sk(dev_net((*rt)->dst.dev)); in icmp_push_reply() 369 ipc, rt, MSG_DONTWAIT) < 0) { in icmp_push_reply() 396 struct rtable *rt = skb_rtable(skb); in icmp_reply() local 397 struct net *net = dev_net(rt->dst.dev); in icmp_reply() 437 rt = ip_route_output_key(net, &fl4); in icmp_reply() 438 if (IS_ERR(rt)) in icmp_reply() 440 if (icmpv4_xrlim_allow(net, rt, &fl4, icmp_param->data.icmph.type, in icmp_reply() [all …]
|
D | datagram.c | 28 struct rtable *rt; in __ip4_datagram_connect() local 51 rt = ip_route_connect(fl4, usin->sin_addr.s_addr, saddr, in __ip4_datagram_connect() 55 if (IS_ERR(rt)) { in __ip4_datagram_connect() 56 err = PTR_ERR(rt); in __ip4_datagram_connect() 62 if ((rt->rt_flags & RTCF_BROADCAST) && !sock_flag(sk, SOCK_BROADCAST)) { in __ip4_datagram_connect() 63 ip_rt_put(rt); in __ip4_datagram_connect() 80 sk_dst_set(sk, &rt->dst); in __ip4_datagram_connect() 109 struct rtable *rt; in ip4_datagram_release_cb() local 121 rt = ip_route_output_ports(sock_net(sk), &fl4, sk, daddr, in ip4_datagram_release_cb() 126 dst = !IS_ERR(rt) ? &rt->dst : NULL; in ip4_datagram_release_cb()
|
D | ip_output.c | 143 struct rtable *rt = skb_rtable(skb); in ip_build_and_send_pkt() local 154 iph->ttl = ip_select_ttl(inet, &rt->dst); in ip_build_and_send_pkt() 159 if (skb->len <= IPV4_MIN_MTU || ip_dont_fragment(sk, &rt->dst)) { in ip_build_and_send_pkt() 175 ip_options_build(skb, &opt->opt, daddr, rt, 0); in ip_build_and_send_pkt() 189 struct rtable *rt = (struct rtable *)dst; in ip_finish_output2() local 195 if (rt->rt_type == RTN_MULTICAST) { in ip_finish_output2() 197 } else if (rt->rt_type == RTN_BROADCAST) in ip_finish_output2() 216 nexthop = (__force u32) rt_nexthop(rt, ip_hdr(skb)->daddr); in ip_finish_output2() 301 struct rtable *rt = skb_rtable(skb); in ip_mc_output() local 302 struct net_device *dev = rt->dst.dev; in ip_mc_output() [all …]
|
D | ip_forward.c | 82 struct rtable *rt; /* Route we use */ in ip_forward() local 116 rt = skb_rtable(skb); in ip_forward() 118 if (opt->is_strictroute && rt->rt_uses_gateway) in ip_forward() 122 mtu = ip_dst_mtu_maybe_forward(&rt->dst, true); in ip_forward() 131 if (skb_cow(skb, LL_RESERVED_SPACE(rt->dst.dev)+rt->dst.header_len)) in ip_forward() 149 net, NULL, skb, skb->dev, rt->dst.dev, in ip_forward()
|
D | netfilter.c | 23 struct rtable *rt; in ip_route_me_harder() local 46 rt = ip_route_output_key(net, &fl4); in ip_route_me_harder() 47 if (IS_ERR(rt)) in ip_route_me_harder() 48 return PTR_ERR(rt); in ip_route_me_harder() 52 skb_dst_set(skb, &rt->dst); in ip_route_me_harder() 179 struct rtable *rt = ip_route_output_key(net, &fl->u.ip4); in nf_ip_route() local 180 if (IS_ERR(rt)) in nf_ip_route() 181 return PTR_ERR(rt); in nf_ip_route() 182 *dst = &rt->dst; in nf_ip_route()
|
D | fib_frontend.c | 282 struct rtable *rt; in fib_compute_spec_dst() local 286 rt = skb_rtable(skb); in fib_compute_spec_dst() 287 if ((rt->rt_flags & (RTCF_BROADCAST | RTCF_MULTICAST | RTCF_LOCAL)) == in fib_compute_spec_dst() 440 static int rtentry_to_fib_config(struct net *net, int cmd, struct rtentry *rt, in rtentry_to_fib_config() argument 449 if (rt->rt_dst.sa_family != AF_INET) in rtentry_to_fib_config() 461 addr = sk_extract_addr(&rt->rt_dst); in rtentry_to_fib_config() 462 if (!(rt->rt_flags & RTF_HOST)) { in rtentry_to_fib_config() 463 __be32 mask = sk_extract_addr(&rt->rt_genmask); in rtentry_to_fib_config() 465 if (rt->rt_genmask.sa_family != AF_INET) { in rtentry_to_fib_config() 466 if (mask || rt->rt_genmask.sa_family) in rtentry_to_fib_config() [all …]
|
/net/ipx/ |
D | ipx_route.c | 51 struct ipx_route *rt; in ipxrtr_add_route() local 55 rt = ipxrtr_lookup(network); in ipxrtr_add_route() 56 if (!rt) { in ipxrtr_add_route() 57 rt = kmalloc(sizeof(*rt), GFP_ATOMIC); in ipxrtr_add_route() 59 if (!rt) in ipxrtr_add_route() 62 atomic_set(&rt->refcnt, 1); in ipxrtr_add_route() 63 ipxrtr_hold(rt); in ipxrtr_add_route() 65 list_add(&rt->node, &ipx_routes); in ipxrtr_add_route() 73 rt->ir_net = network; in ipxrtr_add_route() 74 rt->ir_intrfc = intrfc; in ipxrtr_add_route() [all …]
|
D | ipx_proc.c | 81 struct ipx_route *rt; in ipx_seq_route_show() local 88 rt = list_entry(v, struct ipx_route, node); in ipx_seq_route_show() 90 seq_printf(seq, "%08X ", ntohl(rt->ir_net)); in ipx_seq_route_show() 91 if (rt->ir_routed) in ipx_seq_route_show() 93 ntohl(rt->ir_intrfc->if_netnum), in ipx_seq_route_show() 94 rt->ir_router_node[0], rt->ir_router_node[1], in ipx_seq_route_show() 95 rt->ir_router_node[2], rt->ir_router_node[3], in ipx_seq_route_show() 96 rt->ir_router_node[4], rt->ir_router_node[5]); in ipx_seq_route_show()
|
/net/mpls/ |
D | af_mpls.c | 36 static void rtmsg_lfib(int event, u32 label, struct mpls_route *rt, 42 struct mpls_route *rt = NULL; in mpls_route_input_rcu() local 47 rt = rcu_dereference(platform_label[index]); in mpls_route_input_rcu() 49 return rt; in mpls_route_input_rcu() 63 static u8 *__mpls_nh_via(struct mpls_route *rt, struct mpls_nh *nh) in __mpls_nh_via() argument 65 u8 *nh0_via = PTR_ALIGN((u8 *)&rt->rt_nh[rt->rt_nhn], VIA_ALEN_ALIGN); in __mpls_nh_via() 66 int nh_index = nh - rt->rt_nh; in __mpls_nh_via() 68 return nh0_via + rt->rt_max_alen * nh_index; in __mpls_nh_via() 71 static const u8 *mpls_nh_via(const struct mpls_route *rt, in mpls_nh_via() argument 74 return __mpls_nh_via((struct mpls_route *)rt, (struct mpls_nh *)nh); in mpls_nh_via() [all …]
|
D | internal.h | 80 #define for_nexthops(rt) { \ argument 82 for (nhsel = 0, nh = (rt)->rt_nh; \ 83 nhsel < (rt)->rt_nhn; \ 86 #define change_nexthops(rt) { \ argument 88 for (nhsel = 0, nh = (struct mpls_nh *)((rt)->rt_nh); \ 89 nhsel < (rt)->rt_nhn; \ 92 #define endfor_nexthops(rt) } argument
|
/net/sunrpc/ |
D | timer.c | 34 void rpc_init_rtt(struct rpc_rtt *rt, unsigned long timeo) in rpc_init_rtt() argument 39 rt->timeo = timeo; in rpc_init_rtt() 44 rt->srtt[i] = init; in rpc_init_rtt() 45 rt->sdrtt[i] = RPC_RTO_INIT; in rpc_init_rtt() 46 rt->ntimeouts[i] = 0; in rpc_init_rtt() 60 void rpc_update_rtt(struct rpc_rtt *rt, unsigned int timer, long m) in rpc_update_rtt() argument 74 srtt = (long *)&rt->srtt[timer]; in rpc_update_rtt() 81 sdrtt = (long *)&rt->sdrtt[timer]; in rpc_update_rtt() 109 unsigned long rpc_calc_rto(struct rpc_rtt *rt, unsigned int timer) in rpc_calc_rto() argument 114 return rt->timeo; in rpc_calc_rto() [all …]
|
/net/netfilter/ipvs/ |
D | ip_vs_xmit.c | 128 struct rtable *rt; in do_output_route4() local 137 rt = ip_route_output_key(net, &fl4); in do_output_route4() 138 if (IS_ERR(rt)) { in do_output_route4() 140 if (PTR_ERR(rt) == -EINVAL && *saddr && in do_output_route4() 149 ip_rt_put(rt); in do_output_route4() 156 return rt; in do_output_route4() 160 static inline int __ip_vs_is_local_route6(struct rt6_info *rt) in __ip_vs_is_local_route6() argument 162 return rt->dst.dev && rt->dst.dev->flags & IFF_LOOPBACK; in __ip_vs_is_local_route6() 266 struct rtable *rt; /* Route to the other host */ in __ip_vs_get_out_rt() local 273 rt = (struct rtable *) dest_dst->dst_cache; in __ip_vs_get_out_rt() [all …]
|
/net/bridge/ |
D | br_nf_core.c | 77 struct rtable *rt = &br->fake_rtable; in br_netfilter_rtable_init() local 79 atomic_set(&rt->dst.__refcnt, 1); in br_netfilter_rtable_init() 80 rt->dst.dev = br->dev; in br_netfilter_rtable_init() 81 rt->dst.path = &rt->dst; in br_netfilter_rtable_init() 82 dst_init_metrics(&rt->dst, br_dst_default_metrics, true); in br_netfilter_rtable_init() 83 rt->dst.flags = DST_NOXFRM | DST_FAKE_RTABLE; in br_netfilter_rtable_init() 84 rt->dst.ops = &fake_dst_ops; in br_netfilter_rtable_init()
|
/net/ipv6/netfilter/ |
D | ip6t_rpfilter.c | 32 struct rt6_info *rt; in rpfilter_lookup_reverse6() local 56 rt = (void *) ip6_route_lookup(net, &fl6, lookup_flags); in rpfilter_lookup_reverse6() 57 if (rt->dst.error) in rpfilter_lookup_reverse6() 60 if (rt->rt6i_flags & (RTF_REJECT|RTF_ANYCAST)) in rpfilter_lookup_reverse6() 63 if (rt->rt6i_flags & RTF_LOCAL) { in rpfilter_lookup_reverse6() 68 if (rt->rt6i_idev->dev == dev || (flags & XT_RPFILTER_LOOSE)) in rpfilter_lookup_reverse6() 71 ip6_rt_put(rt); in rpfilter_lookup_reverse6() 77 const struct rt6_info *rt = (const void *) skb_dst(skb); in rpfilter_is_local() local 78 return rt && (rt->rt6i_flags & RTF_LOCAL); in rpfilter_is_local()
|
/net/appletalk/ |
D | atalk_proc.c | 125 struct atalk_route *rt; in atalk_seq_route_show() local 133 rt = &atrtr_default; in atalk_seq_route_show() 135 ntohs(rt->gateway.s_net), rt->gateway.s_node, in atalk_seq_route_show() 136 rt->flags, rt->dev->name); in atalk_seq_route_show() 139 rt = v; in atalk_seq_route_show() 141 ntohs(rt->target.s_net), rt->target.s_node, in atalk_seq_route_show() 142 ntohs(rt->gateway.s_net), rt->gateway.s_node, in atalk_seq_route_show() 143 rt->flags, rt->dev->name); in atalk_seq_route_show()
|
D | ddp.c | 505 struct atalk_route *rt; in atrtr_create() local 521 for (rt = atalk_routes; rt; rt = rt->next) { in atrtr_create() 522 if (r->rt_flags != rt->flags) in atrtr_create() 525 if (ta->sat_addr.s_net == rt->target.s_net) { in atrtr_create() 526 if (!(rt->flags & RTF_HOST)) in atrtr_create() 528 if (ta->sat_addr.s_node == rt->target.s_node) in atrtr_create() 558 if (!rt) { in atrtr_create() 559 rt = kzalloc(sizeof(*rt), GFP_ATOMIC); in atrtr_create() 562 if (!rt) in atrtr_create() 565 rt->next = atalk_routes; in atrtr_create() [all …]
|