Home
last modified time | relevance | path

Searched refs:fl4 (Results 1 – 25 of 39) sorted by relevance

12

/net/ipv4/
Droute.c502 static void ip_rt_fix_tos(struct flowi4 *fl4) in ip_rt_fix_tos() argument
504 __u8 tos = RT_FL_TOS(fl4); in ip_rt_fix_tos()
506 fl4->flowi4_tos = tos & IPTOS_RT_MASK; in ip_rt_fix_tos()
508 fl4->flowi4_scope = RT_SCOPE_LINK; in ip_rt_fix_tos()
511 static void __build_flow_key(const struct net *net, struct flowi4 *fl4, in __build_flow_key() argument
527 flowi4_init_output(fl4, oif, mark, tos & IPTOS_RT_MASK, scope, in __build_flow_key()
532 static void build_skb_flow_key(struct flowi4 *fl4, const struct sk_buff *skb, in build_skb_flow_key() argument
542 __build_flow_key(net, fl4, sk, iph, oif, tos, prot, mark, 0); in build_skb_flow_key()
545 static void build_sk_flow_key(struct flowi4 *fl4, const struct sock *sk) in build_sk_flow_key() argument
555 flowi4_init_output(fl4, sk->sk_bound_dev_if, READ_ONCE(sk->sk_mark), in build_sk_flow_key()
[all …]
Dnetfilter.c24 struct flowi4 fl4 = {}; in ip_route_me_harder() local
44 fl4.daddr = iph->daddr; in ip_route_me_harder()
45 fl4.saddr = saddr; in ip_route_me_harder()
46 fl4.flowi4_tos = RT_TOS(iph->tos); in ip_route_me_harder()
47 fl4.flowi4_oif = sk ? sk->sk_bound_dev_if : 0; in ip_route_me_harder()
48 fl4.flowi4_l3mdev = l3mdev_master_ifindex(dev); in ip_route_me_harder()
49 fl4.flowi4_mark = skb->mark; in ip_route_me_harder()
50 fl4.flowi4_flags = flags; in ip_route_me_harder()
51 fib4_rules_early_flow_dissect(net, skb, &fl4, &flkeys); in ip_route_me_harder()
52 rt = ip_route_output_key(net, &fl4); in ip_route_me_harder()
[all …]
Dxfrm4_policy.c20 static struct dst_entry *__xfrm4_dst_lookup(struct net *net, struct flowi4 *fl4, in __xfrm4_dst_lookup() argument
28 memset(fl4, 0, sizeof(*fl4)); in __xfrm4_dst_lookup()
29 fl4->daddr = daddr->a4; in __xfrm4_dst_lookup()
30 fl4->flowi4_tos = tos; in __xfrm4_dst_lookup()
31 fl4->flowi4_l3mdev = l3mdev_master_ifindex_by_index(net, oif); in __xfrm4_dst_lookup()
32 fl4->flowi4_mark = mark; in __xfrm4_dst_lookup()
34 fl4->saddr = saddr->a4; in __xfrm4_dst_lookup()
36 rt = __ip_route_output_key(net, fl4); in __xfrm4_dst_lookup()
48 struct flowi4 fl4; in xfrm4_dst_lookup() local
50 return __xfrm4_dst_lookup(net, &fl4, tos, oif, saddr, daddr, mark); in xfrm4_dst_lookup()
[all …]
Dicmp.c309 struct flowi4 *fl4, int type, int code) in icmpv4_xrlim_allow() argument
324 peer = inet_getpeer_v4(net->ipv4.peers, fl4->daddr, vif, 1); in icmpv4_xrlim_allow()
366 struct flowi4 *fl4, in icmp_push_reply() argument
371 if (ip_append_data(sk, fl4, icmp_glue_bits, icmp_param, in icmp_push_reply()
390 ip_push_pending_frames(sk, fl4); in icmp_push_reply()
403 struct flowi4 fl4; in icmp_reply() local
439 memset(&fl4, 0, sizeof(fl4)); in icmp_reply()
440 fl4.daddr = daddr; in icmp_reply()
441 fl4.saddr = saddr; in icmp_reply()
442 fl4.flowi4_mark = mark; in icmp_reply()
[all …]
Ddatagram.c23 struct flowi4 *fl4; in __ip4_datagram_connect() local
48 fl4 = &inet->cork.fl.u.ip4; in __ip4_datagram_connect()
49 rt = ip_route_connect(fl4, usin->sin_addr.s_addr, saddr, oif, in __ip4_datagram_connect()
65 inet->inet_saddr = fl4->saddr; /* Update source address */ in __ip4_datagram_connect()
67 inet->inet_rcv_saddr = fl4->saddr; in __ip4_datagram_connect()
71 inet->inet_daddr = fl4->daddr; in __ip4_datagram_connect()
106 struct flowi4 fl4; in ip4_datagram_release_cb() local
119 rt = ip_route_output_ports(sock_net(sk), &fl4, sk, daddr, in ip4_datagram_release_cb()
Dfib_frontend.c210 struct flowi4 fl4 = { .daddr = addr }; in __inet_dev_addr_type() local
225 if (!fib_table_lookup(table, &fl4, &res, FIB_LOOKUP_NOREF)) { in __inet_dev_addr_type()
292 struct flowi4 fl4 = { in fib_compute_spec_dst() local
300 if (!fib_lookup(net, &fl4, &res, 0)) in fib_compute_spec_dst()
352 struct flowi4 fl4; in __fib_validate_source() local
355 fl4.flowi4_oif = 0; in __fib_validate_source()
356 fl4.flowi4_l3mdev = l3mdev_master_ifindex_rcu(dev); in __fib_validate_source()
357 fl4.flowi4_iif = oif ? : LOOPBACK_IFINDEX; in __fib_validate_source()
358 fl4.daddr = src; in __fib_validate_source()
359 fl4.saddr = dst; in __fib_validate_source()
[all …]
Dip_output.c446 static void ip_copy_addrs(struct iphdr *iph, const struct flowi4 *fl4) in ip_copy_addrs() argument
448 BUILD_BUG_ON(offsetof(typeof(*fl4), daddr) != in ip_copy_addrs()
449 offsetof(typeof(*fl4), saddr) + sizeof(fl4->saddr)); in ip_copy_addrs()
451 iph->saddr = fl4->saddr; in ip_copy_addrs()
452 iph->daddr = fl4->daddr; in ip_copy_addrs()
462 struct flowi4 *fl4; in __ip_queue_xmit() local
472 fl4 = &fl->u.ip4; in __ip_queue_xmit()
491 rt = ip_route_output_ports(net, fl4, sk, in __ip_queue_xmit()
519 ip_copy_addrs(iph, fl4); in __ip_queue_xmit()
952 struct flowi4 *fl4, in __ip_append_data() argument
[all …]
Draw.c319 static int raw_send_hdrinc(struct sock *sk, struct flowi4 *fl4, in raw_send_hdrinc() argument
334 ip_local_error(sk, EMSGSIZE, fl4->daddr, inet->inet_dport, in raw_send_hdrinc()
391 iph->saddr = fl4->saddr; in raw_send_hdrinc()
424 static int raw_probe_proto_opt(struct raw_frag_vec *rfv, struct flowi4 *fl4) in raw_probe_proto_opt() argument
428 if (fl4->flowi4_proto != IPPROTO_ICMP) in raw_probe_proto_opt()
438 fl4->fl4_icmp_type = rfv->hdr.icmph.type; in raw_probe_proto_opt()
439 fl4->fl4_icmp_code = rfv->hdr.icmph.code; in raw_probe_proto_opt()
481 struct flowi4 fl4; in raw_sendmsg() local
601 flowi4_init_output(&fl4, ipc.oif, ipc.sockc.mark, tos, scope, in raw_sendmsg()
607 fl4.fl4_icmp_type = 0; in raw_sendmsg()
[all …]
Dip_tunnel.c292 struct flowi4 fl4; in ip_tunnel_bind_dev() local
295 ip_tunnel_init_flow(&fl4, iph->protocol, iph->daddr, in ip_tunnel_bind_dev()
299 rt = ip_route_output_key(tunnel->net, &fl4); in ip_tunnel_bind_dev()
593 struct flowi4 fl4; in ip_md_tunnel_xmit() local
612 ip_tunnel_init_flow(&fl4, proto, key->u.ipv4.dst, key->u.ipv4.src, in ip_md_tunnel_xmit()
620 if (ip_tunnel_encap(skb, &tun_info->encap, &proto, &fl4) < 0) in ip_md_tunnel_xmit()
625 rt = dst_cache_get_ip4(&tun_info->dst_cache, &fl4.saddr); in ip_md_tunnel_xmit()
627 rt = ip_route_output_key(tunnel->net, &fl4); in ip_md_tunnel_xmit()
634 fl4.saddr); in ip_md_tunnel_xmit()
669 iptunnel_xmit(NULL, rt, skb, fl4.saddr, fl4.daddr, proto, tos, ttl, in ip_md_tunnel_xmit()
[all …]
Dfib_rules.c181 struct flowi4 *fl4 = &fl->u.ip4; in fib4_rule_match() local
182 __be32 daddr = fl4->daddr; in fib4_rule_match()
183 __be32 saddr = fl4->saddr; in fib4_rule_match()
189 if (r->dscp && r->dscp != inet_dsfield_to_dscp(fl4->flowi4_tos)) in fib4_rule_match()
192 if (rule->ip_proto && (rule->ip_proto != fl4->flowi4_proto)) in fib4_rule_match()
196 !fib_rule_port_inrange(&rule->sport_range, fl4->fl4_sport)) in fib4_rule_match()
200 !fib_rule_port_inrange(&rule->dport_range, fl4->fl4_dport)) in fib4_rule_match()
Dping.c636 struct flowi4 *fl4) in ping_v4_push_pending_frames() argument
647 return ip_push_pending_frames(sk, fl4); in ping_v4_push_pending_frames()
699 struct flowi4 fl4; in ping_v4_sendmsg() local
782 flowi4_init_output(&fl4, ipc.oif, ipc.sockc.mark, tos, scope, in ping_v4_sendmsg()
786 fl4.fl4_icmp_type = user_icmph.type; in ping_v4_sendmsg()
787 fl4.fl4_icmp_code = user_icmph.code; in ping_v4_sendmsg()
789 security_sk_classify_flow(sk, flowi4_to_flowi_common(&fl4)); in ping_v4_sendmsg()
790 rt = ip_route_output_flow(net, &fl4, sk); in ping_v4_sendmsg()
809 ipc.addr = fl4.daddr; in ping_v4_sendmsg()
822 err = ip_append_data(sk, &fl4, ping_getfrag, &pfh, len, in ping_v4_sendmsg()
[all …]
Dsyncookies.c333 struct flowi4 fl4; in cookie_v4_check() local
414 flowi4_init_output(&fl4, ireq->ir_iif, ireq->ir_mark, in cookie_v4_check()
419 security_req_classify_flow(req, flowi4_to_flowi_common(&fl4)); in cookie_v4_check()
420 rt = ip_route_output_key(sock_net(sk), &fl4); in cookie_v4_check()
448 inet_sk(ret)->cork.fl.u.ip4 = fl4; in cookie_v4_check()
Dinet_connection_sock.c808 struct flowi4 *fl4, in inet_csk_route_req() argument
819 flowi4_init_output(fl4, ireq->ir_iif, ireq->ir_mark, in inet_csk_route_req()
825 security_req_classify_flow(req, flowi4_to_flowi_common(fl4)); in inet_csk_route_req()
826 rt = ip_route_output_flow(net, fl4, sk); in inet_csk_route_req()
851 struct flowi4 *fl4; in inet_csk_route_child_sock() local
855 fl4 = &newinet->cork.fl.u.ip4; in inet_csk_route_child_sock()
857 flowi4_init_output(fl4, ireq->ir_iif, ireq->ir_mark, in inet_csk_route_child_sock()
863 security_req_classify_flow(req, flowi4_to_flowi_common(fl4)); in inet_csk_route_child_sock()
864 rt = ip_route_output_flow(net, fl4, sk); in inet_csk_route_child_sock()
1491 struct flowi4 *fl4; in inet_csk_rebuild_route() local
[all …]
Dudp.c908 static int udp_send_skb(struct sk_buff *skb, struct flowi4 *fl4, in udp_send_skb() argument
926 uh->dest = fl4->fl4_dport; in udp_send_skb()
972 udp4_hwcsum(skb, fl4->saddr, fl4->daddr); in udp_send_skb()
979 uh->check = csum_tcpudp_magic(fl4->saddr, fl4->daddr, len, in udp_send_skb()
1006 struct flowi4 *fl4 = &inet->cork.fl.u.ip4; in udp_push_pending_frames() local
1010 skb = ip_finish_skb(sk, fl4); in udp_push_pending_frames()
1014 err = udp_send_skb(skb, fl4, &inet->cork.base); in udp_push_pending_frames()
1066 struct flowi4 *fl4; in udp_sendmsg() local
1097 fl4 = &inet->cork.fl.u.ip4; in udp_sendmsg()
1236 fl4 = &fl4_stack; in udp_sendmsg()
[all …]
Dfib_semantics.c1158 struct flowi4 fl4 = { in fib_check_nh_v4_gw() local
1166 if (fl4.flowi4_scope < RT_SCOPE_LINK) in fib_check_nh_v4_gw()
1167 fl4.flowi4_scope = RT_SCOPE_LINK; in fib_check_nh_v4_gw()
1173 err = fib_table_lookup(tbl, &fl4, &res, in fib_check_nh_v4_gw()
1182 err = fib_lookup(net, &fl4, &res, in fib_check_nh_v4_gw()
2254 struct flowi4 *fl4, const struct sk_buff *skb) in fib_select_path() argument
2256 if (fl4->flowi4_oif) in fib_select_path()
2261 int h = fib_multipath_hash(net, fl4, skb, NULL); in fib_select_path()
2270 fib_select_default(fl4, res); in fib_select_path()
2273 if (!fl4->saddr) { in fib_select_path()
[all …]
Dfou_core.c1017 struct flowi4 *fl4, u8 *protocol, __be16 sport) in fou_build_udp() argument
1030 fl4->saddr, fl4->daddr, skb->len); in fou_build_udp()
1036 u8 *protocol, struct flowi4 *fl4) in fou_build_header() argument
1047 fou_build_udp(skb, e, fl4, protocol, sport); in fou_build_header()
1053 u8 *protocol, struct flowi4 *fl4) in gue_build_header() argument
1064 fou_build_udp(skb, e, fl4, protocol, sport); in gue_build_header()
/net/ipv4/netfilter/
Dnf_dup_ipv4.c28 struct flowi4 fl4; in nf_dup_ipv4_route() local
30 memset(&fl4, 0, sizeof(fl4)); in nf_dup_ipv4_route()
32 fl4.flowi4_oif = oif; in nf_dup_ipv4_route()
34 fl4.daddr = gw->s_addr; in nf_dup_ipv4_route()
35 fl4.flowi4_tos = RT_TOS(iph->tos); in nf_dup_ipv4_route()
36 fl4.flowi4_scope = RT_SCOPE_UNIVERSE; in nf_dup_ipv4_route()
37 fl4.flowi4_flags = FLOWI_FLAG_KNOWN_NH; in nf_dup_ipv4_route()
38 rt = ip_route_output_key(net, &fl4); in nf_dup_ipv4_route()
Dnft_fib_ipv4.c65 struct flowi4 fl4 = { in nft_fib4_eval() local
88 fl4.flowi4_l3mdev = l3mdev_master_ifindex_rcu(oif); in nft_fib4_eval()
111 fl4.flowi4_mark = pkt->skb->mark; in nft_fib4_eval()
113 fl4.flowi4_tos = iph->tos & DSCP_BITS; in nft_fib4_eval()
116 fl4.daddr = iph->daddr; in nft_fib4_eval()
117 fl4.saddr = get_saddr(iph->saddr); in nft_fib4_eval()
121 fl4.flowi4_iif = nft_out(pkt)->ifindex; in nft_fib4_eval()
123 fl4.daddr = iph->saddr; in nft_fib4_eval()
124 fl4.saddr = get_saddr(iph->daddr); in nft_fib4_eval()
129 if (fib_lookup(nft_net(pkt), &fl4, &res, FIB_LOOKUP_IGNORE_LINKSTATE)) in nft_fib4_eval()
Dipt_rpfilter.c32 static bool rpfilter_lookup_reverse(struct net *net, struct flowi4 *fl4, in rpfilter_lookup_reverse() argument
37 if (fib_lookup(net, fl4, &res, FIB_LOOKUP_IGNORE_LINKSTATE)) in rpfilter_lookup_reverse()
/net/sctp/
Dprotocol.c287 static void sctp_v4_dst_saddr(union sctp_addr *saddr, struct flowi4 *fl4, in sctp_v4_dst_saddr() argument
292 saddr->v4.sin_addr.s_addr = fl4->saddr; in sctp_v4_dst_saddr()
423 struct flowi4 *fl4 = &_fl.u.ip4; in sctp_v4_get_dst() local
434 fl4->daddr = daddr->v4.sin_addr.s_addr; in sctp_v4_get_dst()
435 fl4->fl4_dport = daddr->v4.sin_port; in sctp_v4_get_dst()
436 fl4->flowi4_proto = IPPROTO_SCTP; in sctp_v4_get_dst()
438 fl4->flowi4_tos = RT_TOS(tos); in sctp_v4_get_dst()
439 fl4->flowi4_scope = ip_sock_rt_scope(asoc->base.sk); in sctp_v4_get_dst()
440 fl4->flowi4_oif = asoc->base.sk->sk_bound_dev_if; in sctp_v4_get_dst()
441 fl4->fl4_sport = htons(asoc->base.bind_addr.port); in sctp_v4_get_dst()
[all …]
/net/core/
Dlwt_bpf.c201 struct flowi4 fl4 = {}; in bpf_lwt_xmit_reroute() local
204 fl4.flowi4_oif = oif; in bpf_lwt_xmit_reroute()
205 fl4.flowi4_mark = skb->mark; in bpf_lwt_xmit_reroute()
206 fl4.flowi4_uid = sock_net_uid(net, sk); in bpf_lwt_xmit_reroute()
207 fl4.flowi4_tos = RT_TOS(iph->tos); in bpf_lwt_xmit_reroute()
208 fl4.flowi4_flags = FLOWI_FLAG_ANYSRC; in bpf_lwt_xmit_reroute()
209 fl4.flowi4_proto = iph->protocol; in bpf_lwt_xmit_reroute()
210 fl4.daddr = iph->daddr; in bpf_lwt_xmit_reroute()
211 fl4.saddr = iph->saddr; in bpf_lwt_xmit_reroute()
213 rt = ip_route_output_key(net, &fl4); in bpf_lwt_xmit_reroute()
/net/dccp/
Dipv4.c52 struct flowi4 *fl4; in dccp_v4_connect() local
77 fl4 = &inet->cork.fl.u.ip4; in dccp_v4_connect()
78 rt = ip_route_connect(fl4, nexthop, inet->inet_saddr, in dccp_v4_connect()
90 daddr = fl4->daddr; in dccp_v4_connect()
93 err = inet_bhash2_update_saddr(sk, &fl4->saddr, AF_INET); in dccp_v4_connect()
119 rt = ip_route_newports(fl4, rt, orig_sport, orig_dport, in dccp_v4_connect()
471 struct flowi4 fl4 = { in dccp_v4_route_skb() local
482 security_skb_classify_flow(skb, flowi4_to_flowi_common(&fl4)); in dccp_v4_route_skb()
483 rt = ip_route_output_flow(net, &fl4, sk); in dccp_v4_route_skb()
497 struct flowi4 fl4; in dccp_v4_send_response() local
[all …]
/net/netfilter/
Dxt_TCPMSS.c52 struct flowi4 *fl4 = &fl.u.ip4; in tcpmss_reverse_mtu() local
53 memset(fl4, 0, sizeof(*fl4)); in tcpmss_reverse_mtu()
54 fl4->daddr = ip_hdr(skb)->saddr; in tcpmss_reverse_mtu()
/net/netfilter/ipvs/
Dip_vs_xmit.c126 struct flowi4 fl4; in do_output_route4() local
130 memset(&fl4, 0, sizeof(fl4)); in do_output_route4()
131 fl4.daddr = daddr; in do_output_route4()
132 fl4.flowi4_flags = (rt_mode & IP_VS_RT_MODE_KNOWN_NH) ? in do_output_route4()
136 rt = ip_route_output_key(net, &fl4); in do_output_route4()
142 flowi4_update_output(&fl4, 0, daddr, 0); in do_output_route4()
147 } else if (!*saddr && rt_mode & IP_VS_RT_MODE_CONNECT && fl4.saddr) { in do_output_route4()
149 *saddr = fl4.saddr; in do_output_route4()
150 flowi4_update_output(&fl4, 0, daddr, fl4.saddr); in do_output_route4()
154 *saddr = fl4.saddr; in do_output_route4()
/net/ipv6/
Dsit.c865 struct flowi4 fl4; in ipip6_tunnel_xmit() local
936 flowi4_init_output(&fl4, tunnel->parms.link, tunnel->fwmark, in ipip6_tunnel_xmit()
941 rt = dst_cache_get_ip4(&tunnel->dst_cache, &fl4.saddr); in ipip6_tunnel_xmit()
943 rt = ip_route_output_flow(tunnel->net, &fl4, NULL); in ipip6_tunnel_xmit()
948 dst_cache_set_ip4(&tunnel->dst_cache, &rt->dst, fl4.saddr); in ipip6_tunnel_xmit()
1027 if (ip_tunnel_encap(skb, &tunnel->encap, &protocol, &fl4) < 0) { in ipip6_tunnel_xmit()
1034 iptunnel_xmit(NULL, rt, skb, fl4.saddr, fl4.daddr, protocol, tos, ttl, in ipip6_tunnel_xmit()
1103 struct flowi4 fl4; in ipip6_tunnel_bind_dev() local
1108 struct rtable *rt = ip_route_output_ports(tunnel->net, &fl4, in ipip6_tunnel_bind_dev()

12