/net/netfilter/ipvs/ |
D | ip_vs_proto_ah_esp.c | 45 const struct ip_vs_iphdr *iph, in ah_esp_conn_fill_param_proto() argument 48 if (likely(!ip_vs_iph_inverse(iph))) in ah_esp_conn_fill_param_proto() 50 &iph->saddr, htons(PORT_ISAKMP), in ah_esp_conn_fill_param_proto() 51 &iph->daddr, htons(PORT_ISAKMP), p); in ah_esp_conn_fill_param_proto() 54 &iph->daddr, htons(PORT_ISAKMP), in ah_esp_conn_fill_param_proto() 55 &iph->saddr, htons(PORT_ISAKMP), p); in ah_esp_conn_fill_param_proto() 60 const struct ip_vs_iphdr *iph) in ah_esp_conn_in_get() argument 65 ah_esp_conn_fill_param_proto(ipvs, af, iph, &p); in ah_esp_conn_in_get() 74 ip_vs_iph_icmp(iph) ? "ICMP+" : "", in ah_esp_conn_in_get() 75 ip_vs_proto_get(iph->protocol)->name, in ah_esp_conn_in_get() [all …]
|
D | ip_vs_core.c | 234 int *ignored, struct ip_vs_iphdr *iph) in ip_vs_sched_persist() argument 247 if (likely(!ip_vs_iph_inverse(iph))) { in ip_vs_sched_persist() 248 src_addr = &iph->saddr; in ip_vs_sched_persist() 249 dst_addr = &iph->daddr; in ip_vs_sched_persist() 251 src_addr = &iph->daddr; in ip_vs_sched_persist() 252 dst_addr = &iph->saddr; in ip_vs_sched_persist() 285 int protocol = iph->protocol; in ip_vs_sched_persist() 332 dest = sched->schedule(svc, skb, iph); in ip_vs_sched_persist() 370 && iph->protocol == IPPROTO_UDP) ? in ip_vs_sched_persist() 376 ip_vs_conn_fill_param(svc->ipvs, svc->af, iph->protocol, src_addr, in ip_vs_sched_persist() [all …]
|
/net/ipv4/ |
D | xfrm4_mode_beet.c | 22 struct iphdr *iph = ip_hdr(skb); in xfrm4_beet_make_header() local 24 iph->ihl = 5; in xfrm4_beet_make_header() 25 iph->version = 4; in xfrm4_beet_make_header() 27 iph->protocol = XFRM_MODE_SKB_CB(skb)->protocol; in xfrm4_beet_make_header() 28 iph->tos = XFRM_MODE_SKB_CB(skb)->tos; in xfrm4_beet_make_header() 30 iph->id = XFRM_MODE_SKB_CB(skb)->id; in xfrm4_beet_make_header() 31 iph->frag_off = XFRM_MODE_SKB_CB(skb)->frag_off; in xfrm4_beet_make_header() 32 iph->ttl = XFRM_MODE_SKB_CB(skb)->ttl; in xfrm4_beet_make_header() 85 struct iphdr *iph; in xfrm4_beet_input() local 110 skb_push(skb, sizeof(*iph)); in xfrm4_beet_input() [all …]
|
D | ip_input.c | 265 const struct iphdr *iph; in ip_rcv_options() local 279 iph = ip_hdr(skb); in ip_rcv_options() 281 opt->optlen = iph->ihl*4 - sizeof(struct iphdr); in ip_rcv_options() 295 &iph->saddr, in ip_rcv_options() 296 &iph->daddr); in ip_rcv_options() 312 const struct iphdr *iph = ip_hdr(skb); in ip_rcv_finish() local 328 !ip_is_fragment(iph)) { in ip_rcv_finish() 330 int protocol = iph->protocol; in ip_rcv_finish() 338 iph = ip_hdr(skb); in ip_rcv_finish() 347 err = ip_route_input_noref(skb, iph->daddr, iph->saddr, in ip_rcv_finish() [all …]
|
D | ipip.c | 137 const struct iphdr *iph = (const struct iphdr *)skb->data; in ipip_err() local 171 iph->daddr, iph->saddr, 0); in ipip_err() 179 iph->protocol, 0); in ipip_err() 184 ipv4_redirect(skb, net, t->parms.link, 0, iph->protocol, 0); in ipip_err() 188 if (t->parms.iph.daddr == 0) { in ipip_err() 193 if (t->parms.iph.ttl == 0 && type == ICMP_TIME_EXCEEDED) in ipip_err() 224 const struct iphdr *iph; in ipip_tunnel_rcv() local 226 iph = ip_hdr(skb); in ipip_tunnel_rcv() 228 iph->saddr, iph->daddr, 0); in ipip_tunnel_rcv() 232 if (tunnel->parms.iph.protocol != ipproto && in ipip_tunnel_rcv() [all …]
|
D | netfilter.c | 22 const struct iphdr *iph = ip_hdr(skb); in ip_route_me_harder() local 25 __be32 saddr = iph->saddr; in ip_route_me_harder() 41 fl4.daddr = iph->daddr; in ip_route_me_harder() 43 fl4.flowi4_tos = RT_TOS(iph->tos); in ip_route_me_harder() 101 const struct iphdr *iph = ip_hdr(skb); in nf_ip_saveroute() local 103 rt_info->tos = iph->tos; in nf_ip_saveroute() 104 rt_info->daddr = iph->daddr; in nf_ip_saveroute() 105 rt_info->saddr = iph->saddr; in nf_ip_saveroute() 116 const struct iphdr *iph = ip_hdr(skb); in nf_ip_reroute() local 118 if (!(iph->tos == rt_info->tos && in nf_ip_reroute() [all …]
|
D | ah4.c | 79 static int ip_clear_mutable_options(const struct iphdr *iph, __be32 *daddr) in ip_clear_mutable_options() argument 81 unsigned char *optptr = (unsigned char *)(iph+1); in ip_clear_mutable_options() 82 int l = iph->ihl*4 - sizeof(struct iphdr); in ip_clear_mutable_options() 122 struct iphdr *iph; in ah_output_done() local 130 iph = AH_SKB_CB(skb)->tmp; in ah_output_done() 131 icv = ah_tmp_icv(ahp->ahash, iph, ihl); in ah_output_done() 134 top_iph->tos = iph->tos; in ah_output_done() 135 top_iph->ttl = iph->ttl; in ah_output_done() 136 top_iph->frag_off = iph->frag_off; in ah_output_done() 138 top_iph->daddr = iph->daddr; in ah_output_done() [all …]
|
D | xfrm4_input.c | 36 const struct iphdr *iph = ip_hdr(skb); in xfrm4_rcv_encap_finish() local 38 if (ip_route_input_noref(skb, iph->daddr, iph->saddr, in xfrm4_rcv_encap_finish() 39 iph->tos, skb->dev)) in xfrm4_rcv_encap_finish() 55 struct iphdr *iph = ip_hdr(skb); in xfrm4_transport_finish() local 57 iph->protocol = XFRM_MODE_SKB_CB(skb)->protocol; in xfrm4_transport_finish() 61 return -iph->protocol; in xfrm4_transport_finish() 65 iph->tot_len = htons(skb->len); in xfrm4_transport_finish() 66 ip_send_check(iph); in xfrm4_transport_finish() 91 struct iphdr *iph; in xfrm4_udp_encap_rcv() local 150 iph = ip_hdr(skb); in xfrm4_udp_encap_rcv() [all …]
|
D | ip_output.c | 90 void ip_send_check(struct iphdr *iph) in ip_send_check() argument 92 iph->check = 0; in ip_send_check() 93 iph->check = ip_fast_csum((unsigned char *)iph, iph->ihl); in ip_send_check() 99 struct iphdr *iph = ip_hdr(skb); in __ip_local_out() local 101 iph->tot_len = htons(skb->len); in __ip_local_out() 102 ip_send_check(iph); in __ip_local_out() 149 struct iphdr *iph; in ip_build_and_send_pkt() local 154 iph = ip_hdr(skb); in ip_build_and_send_pkt() 155 iph->version = 4; in ip_build_and_send_pkt() 156 iph->ihl = 5; in ip_build_and_send_pkt() [all …]
|
D | ip_gre.c | 142 const struct iphdr *iph; in ipgre_err() local 185 iph = (const struct iphdr *)(icmp_hdr(skb) + 1); in ipgre_err() 187 iph->daddr, iph->saddr, tpi->key); in ipgre_err() 194 !ip6_err_gen_icmpv6_unreach(skb, iph->ihl * 4 + tpi->hdr_len, in ipgre_err() 199 if (t->parms.iph.daddr == 0 || in ipgre_err() 200 ipv4_is_multicast(t->parms.iph.daddr)) in ipgre_err() 203 if (t->parms.iph.ttl == 0 && type == ICMP_TIME_EXCEEDED) in ipgre_err() 229 const struct iphdr *iph = (struct iphdr *)skb->data; in gre_err() local 235 iph->ihl * 4) < 0) in gre_err() 260 const struct iphdr *iph; in erspan_rcv() local [all …]
|
D | ip_vti.c | 56 const struct iphdr *iph = ip_hdr(skb); in vti_input() local 61 iph->saddr, iph->daddr, 0); in vti_input() 81 const struct iphdr *iph = ip_hdr(skb); in vti_input_ipip() local 86 iph->saddr, iph->daddr, 0); in vti_input_ipip() 253 if (!vti_state_check(dst->xfrm, parms->iph.daddr, parms->iph.saddr)) { in vti_xmit() 352 const struct iphdr *iph = (const struct iphdr *)skb->data; in vti4_err() local 353 int protocol = iph->protocol; in vti4_err() 357 iph->daddr, iph->saddr, 0); in vti4_err() 365 esph = (struct ip_esp_hdr *)(skb->data+(iph->ihl<<2)); in vti4_err() 369 ah = (struct ip_auth_hdr *)(skb->data+(iph->ihl<<2)); in vti4_err() [all …]
|
D | ip_tunnel.c | 109 if (local != t->parms.iph.saddr || in ip_tunnel_lookup() 110 remote != t->parms.iph.daddr || in ip_tunnel_lookup() 124 if (remote != t->parms.iph.daddr || in ip_tunnel_lookup() 125 t->parms.iph.saddr != 0 || in ip_tunnel_lookup() 142 if ((local != t->parms.iph.saddr || t->parms.iph.daddr != 0) && in ip_tunnel_lookup() 143 (local != t->parms.iph.daddr || !ipv4_is_multicast(local))) in ip_tunnel_lookup() 163 t->parms.iph.saddr != 0 || in ip_tunnel_lookup() 164 t->parms.iph.daddr != 0 || in ip_tunnel_lookup() 196 if (parms->iph.daddr && !ipv4_is_multicast(parms->iph.daddr)) in ip_bucket() 197 remote = parms->iph.daddr; in ip_bucket() [all …]
|
D | ip_options.c | 47 unsigned char *iph = skb_network_header(skb); in ip_options_build() local 50 memcpy(iph+sizeof(struct iphdr), opt->__data, opt->optlen); in ip_options_build() 54 memcpy(iph+opt->srr+iph[opt->srr+1]-4, &daddr, 4); in ip_options_build() 58 ip_rt_get_source(iph+opt->rr+iph[opt->rr+2]-5, skb, rt); in ip_options_build() 60 ip_rt_get_source(iph+opt->ts+iph[opt->ts+2]-9, skb, rt); in ip_options_build() 65 memcpy(iph+opt->ts+iph[opt->ts+2]-5, &midtime, 4); in ip_options_build() 70 memset(iph+opt->rr, IPOPT_NOP, iph[opt->rr+1]); in ip_options_build() 75 memset(iph+opt->ts, IPOPT_NOP, iph[opt->ts+1]); in ip_options_build() 262 unsigned char *iph; in __ip_options_compile() local 270 iph = optptr - sizeof(struct iphdr); in __ip_options_compile() [all …]
|
/net/ipv6/ |
D | sit.c | 102 if (local == t->parms.iph.saddr && in ipip6_tunnel_lookup() 103 remote == t->parms.iph.daddr && in ipip6_tunnel_lookup() 109 if (remote == t->parms.iph.daddr && in ipip6_tunnel_lookup() 115 if (local == t->parms.iph.saddr && in ipip6_tunnel_lookup() 129 __be32 remote = parms->iph.daddr; in __ipip6_bucket() 130 __be32 local = parms->iph.saddr; in __ipip6_bucket() 198 memcpy(dev->dev_addr, &t->parms.iph.saddr, 4); in ipip6_tunnel_create() 199 memcpy(dev->broadcast, &t->parms.iph.daddr, 4); in ipip6_tunnel_create() 224 __be32 remote = parms->iph.daddr; in ipip6_tunnel_locate() 225 __be32 local = parms->iph.saddr; in ipip6_tunnel_locate() [all …]
|
D | ip6_offload.c | 142 static int ipv6_exthdrs_len(struct ipv6hdr *iph, in ipv6_exthdrs_len() argument 145 struct ipv6_opt_hdr *opth = (void *)iph; in ipv6_exthdrs_len() 146 int len = 0, proto, optlen = sizeof(*iph); in ipv6_exthdrs_len() 148 proto = iph->nexthdr; in ipv6_exthdrs_len() 171 struct ipv6hdr *iph; in ipv6_gro_receive() local 179 hlen = off + sizeof(*iph); in ipv6_gro_receive() 180 iph = skb_gro_header_fast(skb, off); in ipv6_gro_receive() 182 iph = skb_gro_header_slow(skb, hlen, off); in ipv6_gro_receive() 183 if (unlikely(!iph)) in ipv6_gro_receive() 188 skb_gro_pull(skb, sizeof(*iph)); in ipv6_gro_receive() [all …]
|
/net/sched/ |
D | act_nat.c | 93 struct iphdr *iph; in tcf_nat() local 120 if (!pskb_may_pull(skb, sizeof(*iph) + noff)) in tcf_nat() 123 iph = ip_hdr(skb); in tcf_nat() 126 addr = iph->saddr; in tcf_nat() 128 addr = iph->daddr; in tcf_nat() 131 if (skb_try_make_writable(skb, sizeof(*iph) + noff)) in tcf_nat() 138 iph = ip_hdr(skb); in tcf_nat() 140 iph->saddr = new_addr; in tcf_nat() 142 iph->daddr = new_addr; in tcf_nat() 144 csum_replace4(&iph->check, addr, new_addr); in tcf_nat() [all …]
|
D | act_csum.c | 180 const struct iphdr *iph; in tcf_csum_ipv4_tcp() local 189 iph = ip_hdr(skb); in tcf_csum_ipv4_tcp() 193 iph->saddr, iph->daddr, skb->csum); in tcf_csum_ipv4_tcp() 229 const struct iphdr *iph; in tcf_csum_ipv4_udp() local 246 iph = ip_hdr(skb); in tcf_csum_ipv4_udp() 267 udph->check = csum_tcpudp_magic(iph->saddr, iph->daddr, in tcf_csum_ipv4_udp() 268 ul, iph->protocol, in tcf_csum_ipv4_udp() 358 const struct iphdr *iph; in tcf_csum_ipv4() local 363 if (!pskb_may_pull(skb, sizeof(*iph) + ntkoff)) in tcf_csum_ipv4() 366 iph = ip_hdr(skb); in tcf_csum_ipv4() [all …]
|
/net/netfilter/ |
D | xt_iprange.c | 23 const struct iphdr *iph = ip_hdr(skb); in iprange_mt4() local 27 m = ntohl(iph->saddr) < ntohl(info->src_min.ip); in iprange_mt4() 28 m |= ntohl(iph->saddr) > ntohl(info->src_max.ip); in iprange_mt4() 32 &iph->saddr, in iprange_mt4() 40 m = ntohl(iph->daddr) < ntohl(info->dst_min.ip); in iprange_mt4() 41 m |= ntohl(iph->daddr) > ntohl(info->dst_max.ip); in iprange_mt4() 45 &iph->daddr, in iprange_mt4() 72 const struct ipv6hdr *iph = ipv6_hdr(skb); in iprange_mt6() local 76 m = iprange_ipv6_lt(&iph->saddr, &info->src_min.in6); in iprange_mt6() 77 m |= iprange_ipv6_lt(&info->src_max.in6, &iph->saddr); in iprange_mt6() [all …]
|
D | xt_TPROXY.c | 267 const struct iphdr *iph = ip_hdr(skb); in tproxy_handle_time_wait4() local 281 sk2 = nf_tproxy_get_sock_v4(net, skb, hp, iph->protocol, in tproxy_handle_time_wait4() 282 iph->saddr, laddr ? laddr : iph->daddr, in tproxy_handle_time_wait4() 307 const struct iphdr *iph = ip_hdr(skb); in tproxy_tg4() local 319 sk = nf_tproxy_get_sock_v4(net, skb, hp, iph->protocol, in tproxy_tg4() 320 iph->saddr, iph->daddr, in tproxy_tg4() 324 laddr = tproxy_laddr4(skb, laddr, iph->daddr); in tproxy_tg4() 335 sk = nf_tproxy_get_sock_v4(net, skb, hp, iph->protocol, in tproxy_tg4() 336 iph->saddr, laddr, in tproxy_tg4() 347 iph->protocol, &iph->daddr, ntohs(hp->dest), in tproxy_tg4() [all …]
|
/net/ipv4/netfilter/ |
D | ipt_SYNPROXY.c | 24 struct iphdr *iph; in synproxy_build_ip() local 27 iph = skb_put(skb, sizeof(*iph)); in synproxy_build_ip() 28 iph->version = 4; in synproxy_build_ip() 29 iph->ihl = sizeof(*iph) / 4; in synproxy_build_ip() 30 iph->tos = 0; in synproxy_build_ip() 31 iph->id = 0; in synproxy_build_ip() 32 iph->frag_off = htons(IP_DF); in synproxy_build_ip() 33 iph->ttl = net->ipv4.sysctl_ip_default_ttl; in synproxy_build_ip() 34 iph->protocol = IPPROTO_TCP; in synproxy_build_ip() 35 iph->check = 0; in synproxy_build_ip() [all …]
|
D | nft_fib_ipv4.c | 38 struct iphdr *iph, _iph; in nft_fib4_eval_type() local 46 iph = skb_header_pointer(pkt->skb, noff, sizeof(_iph), &_iph); in nft_fib4_eval_type() 47 if (!iph) { in nft_fib4_eval_type() 53 addr = iph->daddr; in nft_fib4_eval_type() 55 addr = iph->saddr; in nft_fib4_eval_type() 72 struct iphdr *iph, _iph; in nft_fib4_eval() local 105 iph = skb_header_pointer(pkt->skb, noff, sizeof(_iph), &_iph); in nft_fib4_eval() 106 if (!iph) { in nft_fib4_eval() 111 if (ipv4_is_zeronet(iph->saddr)) { in nft_fib4_eval() 112 if (ipv4_is_lbcast(iph->daddr) || in nft_fib4_eval() [all …]
|
D | nft_chain_route_ipv4.c | 33 const struct iphdr *iph; in nf_route_table_hook() local 44 iph = ip_hdr(skb); in nf_route_table_hook() 45 saddr = iph->saddr; in nf_route_table_hook() 46 daddr = iph->daddr; in nf_route_table_hook() 47 tos = iph->tos; in nf_route_table_hook() 51 iph = ip_hdr(skb); in nf_route_table_hook() 53 if (iph->saddr != saddr || in nf_route_table_hook() 54 iph->daddr != daddr || in nf_route_table_hook() 56 iph->tos != tos) { in nf_route_table_hook()
|
D | nf_socket_ipv4.c | 101 const struct iphdr *iph = ip_hdr(skb); in nf_sk_lookup_slow_v4() local 111 if (iph->protocol == IPPROTO_UDP || iph->protocol == IPPROTO_TCP) { in nf_sk_lookup_slow_v4() 116 iph->protocol == IPPROTO_UDP ? in nf_sk_lookup_slow_v4() 121 protocol = iph->protocol; in nf_sk_lookup_slow_v4() 122 saddr = iph->saddr; in nf_sk_lookup_slow_v4() 124 daddr = iph->daddr; in nf_sk_lookup_slow_v4() 127 doff = iph->protocol == IPPROTO_TCP ? in nf_sk_lookup_slow_v4() 131 } else if (iph->protocol == IPPROTO_ICMP) { in nf_sk_lookup_slow_v4() 146 ((iph->protocol != IPPROTO_ICMP && in nf_sk_lookup_slow_v4() 148 (iph->protocol == IPPROTO_ICMP && in nf_sk_lookup_slow_v4() [all …]
|
/net/ipv6/netfilter/ |
D | nft_fib_ipv6.c | 29 struct ipv6hdr *iph) in nft_fib6_flowi_init() argument 34 fl6->daddr = iph->daddr; in nft_fib6_flowi_init() 35 fl6->saddr = iph->saddr; in nft_fib6_flowi_init() 37 fl6->daddr = iph->saddr; in nft_fib6_flowi_init() 38 fl6->saddr = iph->daddr; in nft_fib6_flowi_init() 52 fl6->flowlabel = (*(__be32 *)iph) & IPV6_FLOWINFO_MASK; in nft_fib6_flowi_init() 59 struct ipv6hdr *iph) in __nft_fib6_eval_type() argument 81 nft_fib6_flowi_init(&fl6, priv, pkt, dev, iph); in __nft_fib6_eval_type() 137 struct ipv6hdr *iph, _iph; in nft_fib6_eval_type() local 139 iph = skb_header_pointer(pkt->skb, noff, sizeof(_iph), &_iph); in nft_fib6_eval_type() [all …]
|
D | ip6t_SYNPROXY.c | 27 struct ipv6hdr *iph; in synproxy_build_ip() local 30 iph = skb_put(skb, sizeof(*iph)); in synproxy_build_ip() 31 ip6_flow_hdr(iph, 0, 0); in synproxy_build_ip() 32 iph->hop_limit = net->ipv6.devconf_all->hop_limit; in synproxy_build_ip() 33 iph->nexthdr = IPPROTO_TCP; in synproxy_build_ip() 34 iph->saddr = *saddr; in synproxy_build_ip() 35 iph->daddr = *daddr; in synproxy_build_ip() 37 return iph; in synproxy_build_ip() 91 struct ipv6hdr *iph, *niph; in synproxy_send_client_synack() local 96 iph = ipv6_hdr(skb); in synproxy_send_client_synack() [all …]
|