/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 | 238 int *ignored, struct ip_vs_iphdr *iph) in ip_vs_sched_persist() argument 251 if (likely(!ip_vs_iph_inverse(iph))) { in ip_vs_sched_persist() 252 src_addr = &iph->saddr; in ip_vs_sched_persist() 253 dst_addr = &iph->daddr; in ip_vs_sched_persist() 255 src_addr = &iph->daddr; in ip_vs_sched_persist() 256 dst_addr = &iph->saddr; in ip_vs_sched_persist() 289 int protocol = iph->protocol; in ip_vs_sched_persist() 336 dest = sched->schedule(svc, skb, iph); in ip_vs_sched_persist() 374 && iph->protocol == IPPROTO_UDP) ? in ip_vs_sched_persist() 380 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() 86 struct iphdr *iph; in xfrm4_beet_input() local 111 skb_push(skb, sizeof(*iph)); in xfrm4_beet_input() [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 | ip_input.c | 265 const struct iphdr *iph; in ip_rcv_options() local 280 iph = ip_hdr(skb); in ip_rcv_options() 282 opt->optlen = iph->ihl*4 - sizeof(struct iphdr); in ip_rcv_options() 296 &iph->saddr, in ip_rcv_options() 297 &iph->daddr); in ip_rcv_options() 313 const struct iphdr *iph = ip_hdr(skb); in ip_rcv_finish() local 327 !ip_is_fragment(iph)) { in ip_rcv_finish() 329 int protocol = iph->protocol; in ip_rcv_finish() 335 iph = ip_hdr(skb); in ip_rcv_finish() 344 int err = ip_route_input_noref(skb, iph->daddr, iph->saddr, in ip_rcv_finish() [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 | xfrm4_input.c | 29 const struct iphdr *iph = ip_hdr(skb); in xfrm4_rcv_encap_finish() local 31 if (ip_route_input_noref(skb, iph->daddr, iph->saddr, in xfrm4_rcv_encap_finish() 32 iph->tos, skb->dev)) in xfrm4_rcv_encap_finish() 43 struct iphdr *iph = ip_hdr(skb); in xfrm4_transport_finish() local 45 iph->protocol = XFRM_MODE_SKB_CB(skb)->protocol; in xfrm4_transport_finish() 49 return -iph->protocol; in xfrm4_transport_finish() 53 iph->tot_len = htons(skb->len); in xfrm4_transport_finish() 54 ip_send_check(iph); in xfrm4_transport_finish() 73 struct iphdr *iph; in xfrm4_udp_encap_rcv() local 132 iph = ip_hdr(skb); in xfrm4_udp_encap_rcv() [all …]
|
D | ah4.c | 78 static int ip_clear_mutable_options(const struct iphdr *iph, __be32 *daddr) in ip_clear_mutable_options() argument 80 unsigned char *optptr = (unsigned char *)(iph+1); in ip_clear_mutable_options() 81 int l = iph->ihl*4 - sizeof(struct iphdr); in ip_clear_mutable_options() 121 struct iphdr *iph; in ah_output_done() local 129 iph = AH_SKB_CB(skb)->tmp; in ah_output_done() 130 icv = ah_tmp_icv(ahp->ahash, iph, ihl); in ah_output_done() 133 top_iph->tos = iph->tos; in ah_output_done() 134 top_iph->ttl = iph->ttl; in ah_output_done() 135 top_iph->frag_off = iph->frag_off; in ah_output_done() 137 top_iph->daddr = iph->daddr; in ah_output_done() [all …]
|
D | ip_gre.c | 138 const struct iphdr *iph; in ipgre_err() local 179 iph = (const struct iphdr *)(icmp_hdr(skb) + 1); in ipgre_err() 181 iph->daddr, iph->saddr, tpi->key); in ipgre_err() 188 !ip6_err_gen_icmpv6_unreach(skb, iph->ihl * 4 + tpi->hdr_len, in ipgre_err() 193 if (t->parms.iph.daddr == 0 || in ipgre_err() 194 ipv4_is_multicast(t->parms.iph.daddr)) in ipgre_err() 197 if (t->parms.iph.ttl == 0 && type == ICMP_TIME_EXCEEDED) in ipgre_err() 223 const struct iphdr *iph = (struct iphdr *)skb->data; in gre_err() local 230 iph->ihl * 4) < 0) { in gre_err() 253 const struct iphdr *iph; in __ipgre_rcv() local [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_vti.c | 56 const struct iphdr *iph = ip_hdr(skb); in vti_input() local 61 iph->saddr, iph->daddr, 0); in vti_input() 187 if (!vti_state_check(dst->xfrm, parms->iph.daddr, parms->iph.saddr)) { in vti_xmit() 286 const struct iphdr *iph = (const struct iphdr *)skb->data; in vti4_err() local 287 int protocol = iph->protocol; in vti4_err() 291 iph->daddr, iph->saddr, 0); in vti4_err() 299 esph = (struct ip_esp_hdr *)(skb->data+(iph->ihl<<2)); in vti4_err() 303 ah = (struct ip_auth_hdr *)(skb->data+(iph->ihl<<2)); in vti4_err() 307 ipch = (struct ip_comp_hdr *)(skb->data+(iph->ihl<<2)); in vti4_err() 324 x = xfrm_state_lookup(net, mark, (const xfrm_address_t *)&iph->daddr, in vti4_err() [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_fragment.c | 100 struct iphdr *iph; member 127 return qp->id == arg->iph->id && in ip4_frag_match() 128 qp->saddr == arg->iph->saddr && in ip4_frag_match() 129 qp->daddr == arg->iph->daddr && in ip4_frag_match() 130 qp->protocol == arg->iph->protocol && in ip4_frag_match() 144 qp->protocol = arg->iph->protocol; in ip4_frag_init() 145 qp->id = arg->iph->id; in ip4_frag_init() 146 qp->ecn = ip4_frag_ecn(arg->iph->tos); in ip4_frag_init() 147 qp->saddr = arg->iph->saddr; in ip4_frag_init() 148 qp->daddr = arg->iph->daddr; in ip4_frag_init() [all …]
|
D | ip_options.c | 46 unsigned char *iph = skb_network_header(skb); in ip_options_build() local 49 memcpy(iph+sizeof(struct iphdr), opt->__data, opt->optlen); in ip_options_build() 53 memcpy(iph+opt->srr+iph[opt->srr+1]-4, &daddr, 4); in ip_options_build() 57 ip_rt_get_source(iph+opt->rr+iph[opt->rr+2]-5, skb, rt); in ip_options_build() 59 ip_rt_get_source(iph+opt->ts+iph[opt->ts+2]-9, skb, rt); in ip_options_build() 64 memcpy(iph+opt->ts+iph[opt->ts+2]-5, &midtime, 4); in ip_options_build() 69 memset(iph+opt->rr, IPOPT_NOP, iph[opt->rr+1]); in ip_options_build() 74 memset(iph+opt->ts, IPOPT_NOP, iph[opt->ts+1]); in ip_options_build() 263 unsigned char *iph; in ip_options_compile() local 271 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 | 141 static int ipv6_exthdrs_len(struct ipv6hdr *iph, in ipv6_exthdrs_len() argument 144 struct ipv6_opt_hdr *opth = (void *)iph; in ipv6_exthdrs_len() 145 int len = 0, proto, optlen = sizeof(*iph); in ipv6_exthdrs_len() 147 proto = iph->nexthdr; in ipv6_exthdrs_len() 170 struct ipv6hdr *iph; in ipv6_gro_receive() local 178 hlen = off + sizeof(*iph); in ipv6_gro_receive() 179 iph = skb_gro_header_fast(skb, off); in ipv6_gro_receive() 181 iph = skb_gro_header_slow(skb, hlen, off); in ipv6_gro_receive() 182 if (unlikely(!iph)) in ipv6_gro_receive() 187 skb_gro_pull(skb, sizeof(*iph)); in ipv6_gro_receive() [all …]
|
/net/sched/ |
D | act_nat.c | 95 struct iphdr *iph; in tcf_nat() local 122 if (!pskb_may_pull(skb, sizeof(*iph) + noff)) in tcf_nat() 125 iph = ip_hdr(skb); in tcf_nat() 128 addr = iph->saddr; in tcf_nat() 130 addr = iph->daddr; in tcf_nat() 133 if (skb_try_make_writable(skb, sizeof(*iph) + noff)) in tcf_nat() 140 iph = ip_hdr(skb); in tcf_nat() 142 iph->saddr = new_addr; in tcf_nat() 144 iph->daddr = new_addr; in tcf_nat() 146 csum_replace4(&iph->check, addr, new_addr); in tcf_nat() [all …]
|
D | act_csum.c | 181 const struct iphdr *iph; in tcf_csum_ipv4_tcp() local 190 iph = ip_hdr(skb); in tcf_csum_ipv4_tcp() 194 iph->saddr, iph->daddr, skb->csum); in tcf_csum_ipv4_tcp() 230 const struct iphdr *iph; in tcf_csum_ipv4_udp() local 247 iph = ip_hdr(skb); in tcf_csum_ipv4_udp() 268 udph->check = csum_tcpudp_magic(iph->saddr, iph->daddr, in tcf_csum_ipv4_udp() 269 ul, iph->protocol, in tcf_csum_ipv4_udp() 339 const struct iphdr *iph; in tcf_csum_ipv4() local 344 if (!pskb_may_pull(skb, sizeof(*iph) + ntkoff)) in tcf_csum_ipv4() 347 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 | 269 const struct iphdr *iph = ip_hdr(skb); in tproxy_handle_time_wait4() local 283 sk2 = nf_tproxy_get_sock_v4(net, skb, hp, iph->protocol, in tproxy_handle_time_wait4() 284 iph->saddr, laddr ? laddr : iph->daddr, in tproxy_handle_time_wait4() 309 const struct iphdr *iph = ip_hdr(skb); in tproxy_tg4() local 321 sk = nf_tproxy_get_sock_v4(net, skb, hp, iph->protocol, in tproxy_tg4() 322 iph->saddr, iph->daddr, in tproxy_tg4() 326 laddr = tproxy_laddr4(skb, laddr, iph->daddr); in tproxy_tg4() 337 sk = nf_tproxy_get_sock_v4(net, skb, hp, iph->protocol, in tproxy_tg4() 338 iph->saddr, laddr, in tproxy_tg4() 349 iph->protocol, &iph->daddr, ntohs(hp->dest), in tproxy_tg4() [all …]
|
D | xt_HL.c | 31 struct iphdr *iph; in ttl_tg() local 38 iph = ip_hdr(skb); in ttl_tg() 45 new_ttl = iph->ttl + info->ttl; in ttl_tg() 50 new_ttl = iph->ttl - info->ttl; in ttl_tg() 55 new_ttl = iph->ttl; in ttl_tg() 59 if (new_ttl != iph->ttl) { in ttl_tg() 60 csum_replace2(&iph->check, htons(iph->ttl << 8), in ttl_tg() 62 iph->ttl = new_ttl; in ttl_tg()
|
/net/ipv4/netfilter/ |
D | ipt_SYNPROXY.c | 24 struct iphdr *iph; in synproxy_build_ip() local 27 iph = (struct iphdr *)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_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 | iptable_mangle.c | 46 const struct iphdr *iph; in ipt_mangle_out() local 59 iph = ip_hdr(skb); in ipt_mangle_out() 60 saddr = iph->saddr; in ipt_mangle_out() 61 daddr = iph->daddr; in ipt_mangle_out() 62 tos = iph->tos; in ipt_mangle_out() 67 iph = ip_hdr(skb); in ipt_mangle_out() 69 if (iph->saddr != saddr || in ipt_mangle_out() 70 iph->daddr != daddr || in ipt_mangle_out() 72 iph->tos != tos) { in ipt_mangle_out()
|
/net/ipv6/netfilter/ |
D | ip6t_SYNPROXY.c | 27 struct ipv6hdr *iph; in synproxy_build_ip() local 30 iph = (struct ipv6hdr *)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() 92 struct ipv6hdr *iph, *niph; in synproxy_send_client_synack() local 97 iph = ipv6_hdr(skb); in synproxy_send_client_synack() [all …]
|