Home
last modified time | relevance | path

Searched refs:iph (Results 1 – 25 of 148) sorted by relevance

123456

/net/xfrm/
Dxfrm_inout.h11 const struct iphdr *iph = ip_hdr(skb); in xfrm4_extract_header() local
13 XFRM_MODE_SKB_CB(skb)->ihl = sizeof(*iph); in xfrm4_extract_header()
14 XFRM_MODE_SKB_CB(skb)->id = iph->id; in xfrm4_extract_header()
15 XFRM_MODE_SKB_CB(skb)->frag_off = iph->frag_off; in xfrm4_extract_header()
16 XFRM_MODE_SKB_CB(skb)->tos = iph->tos; in xfrm4_extract_header()
17 XFRM_MODE_SKB_CB(skb)->ttl = iph->ttl; in xfrm4_extract_header()
18 XFRM_MODE_SKB_CB(skb)->optlen = iph->ihl * 4 - sizeof(*iph); in xfrm4_extract_header()
26 struct ipv6hdr *iph = ipv6_hdr(skb); in xfrm6_extract_header() local
28 XFRM_MODE_SKB_CB(skb)->ihl = sizeof(*iph); in xfrm6_extract_header()
31 XFRM_MODE_SKB_CB(skb)->tos = ipv6_get_dsfield(iph); in xfrm6_extract_header()
[all …]
/net/netfilter/ipvs/
Dip_vs_proto_ah_esp.c41 const struct ip_vs_iphdr *iph, in ah_esp_conn_fill_param_proto() argument
44 if (likely(!ip_vs_iph_inverse(iph))) in ah_esp_conn_fill_param_proto()
46 &iph->saddr, htons(PORT_ISAKMP), in ah_esp_conn_fill_param_proto()
47 &iph->daddr, htons(PORT_ISAKMP), p); in ah_esp_conn_fill_param_proto()
50 &iph->daddr, htons(PORT_ISAKMP), in ah_esp_conn_fill_param_proto()
51 &iph->saddr, htons(PORT_ISAKMP), p); in ah_esp_conn_fill_param_proto()
56 const struct ip_vs_iphdr *iph) in ah_esp_conn_in_get() argument
61 ah_esp_conn_fill_param_proto(ipvs, af, iph, &p); in ah_esp_conn_in_get()
70 ip_vs_iph_icmp(iph) ? "ICMP+" : "", in ah_esp_conn_in_get()
71 ip_vs_proto_get(iph->protocol)->name, in ah_esp_conn_in_get()
[all …]
Dip_vs_core.c255 int *ignored, struct ip_vs_iphdr *iph) in ip_vs_sched_persist() argument
268 if (likely(!ip_vs_iph_inverse(iph))) { in ip_vs_sched_persist()
269 src_addr = &iph->saddr; in ip_vs_sched_persist()
270 dst_addr = &iph->daddr; in ip_vs_sched_persist()
272 src_addr = &iph->daddr; in ip_vs_sched_persist()
273 dst_addr = &iph->saddr; in ip_vs_sched_persist()
306 int protocol = iph->protocol; in ip_vs_sched_persist()
353 dest = sched->schedule(svc, skb, iph); in ip_vs_sched_persist()
391 && iph->protocol == IPPROTO_UDP) ? in ip_vs_sched_persist()
397 ip_vs_conn_fill_param(svc->ipvs, svc->af, iph->protocol, src_addr, in ip_vs_sched_persist()
[all …]
/net/ipv4/
Dip_input.c263 const struct iphdr *iph; in ip_rcv_options() local
277 iph = ip_hdr(skb); in ip_rcv_options()
279 opt->optlen = iph->ihl*4 - sizeof(struct iphdr); in ip_rcv_options()
293 &iph->saddr, in ip_rcv_options()
294 &iph->daddr); in ip_rcv_options()
308 static bool ip_can_use_hint(const struct sk_buff *skb, const struct iphdr *iph, in ip_can_use_hint() argument
311 return hint && !skb_dst(skb) && ip_hdr(hint)->daddr == iph->daddr && in ip_can_use_hint()
312 ip_hdr(hint)->tos == iph->tos; in ip_can_use_hint()
321 const struct iphdr *iph = ip_hdr(skb); in ip_rcv_finish_core() local
327 if (ip_can_use_hint(skb, iph, hint)) { in ip_rcv_finish_core()
[all …]
Dah4.c80 static int ip_clear_mutable_options(const struct iphdr *iph, __be32 *daddr) in ip_clear_mutable_options() argument
82 unsigned char *optptr = (unsigned char *)(iph+1); in ip_clear_mutable_options()
83 int l = iph->ihl*4 - sizeof(struct iphdr); in ip_clear_mutable_options()
123 struct iphdr *iph; in ah_output_done() local
131 iph = AH_SKB_CB(skb)->tmp; in ah_output_done()
132 icv = ah_tmp_icv(ahp->ahash, iph, ihl); in ah_output_done()
135 top_iph->tos = iph->tos; in ah_output_done()
136 top_iph->ttl = iph->ttl; in ah_output_done()
137 top_iph->frag_off = iph->frag_off; in ah_output_done()
139 top_iph->daddr = iph->daddr; in ah_output_done()
[all …]
Dipip.c132 const struct iphdr *iph = (const struct iphdr *)skb->data; in ipip_err() local
139 iph->daddr, iph->saddr, 0); in ipip_err()
173 ipv4_update_pmtu(skb, net, info, t->parms.link, iph->protocol); in ipip_err()
178 ipv4_redirect(skb, net, t->parms.link, iph->protocol); in ipip_err()
182 if (t->parms.iph.daddr == 0) { in ipip_err()
187 if (t->parms.iph.ttl == 0 && type == ICMP_TIME_EXCEEDED) in ipip_err()
218 const struct iphdr *iph; in ipip_tunnel_rcv() local
220 iph = ip_hdr(skb); in ipip_tunnel_rcv()
222 iph->saddr, iph->daddr, 0); in ipip_tunnel_rcv()
226 if (tunnel->parms.iph.protocol != ipproto && in ipip_tunnel_rcv()
[all …]
Dxfrm4_input.c31 const struct iphdr *iph = ip_hdr(skb); in xfrm4_rcv_encap_finish() local
33 if (ip_route_input_noref(skb, iph->daddr, iph->saddr, in xfrm4_rcv_encap_finish()
34 iph->tos, skb->dev)) in xfrm4_rcv_encap_finish()
50 struct iphdr *iph = ip_hdr(skb); in xfrm4_transport_finish() local
52 iph->protocol = XFRM_MODE_SKB_CB(skb)->protocol; in xfrm4_transport_finish()
56 return -iph->protocol; in xfrm4_transport_finish()
60 iph->tot_len = htons(skb->len); in xfrm4_transport_finish()
61 ip_send_check(iph); in xfrm4_transport_finish()
90 struct iphdr *iph; in xfrm4_udp_encap_rcv() local
149 iph = ip_hdr(skb); in xfrm4_udp_encap_rcv()
[all …]
Dip_output.c93 void ip_send_check(struct iphdr *iph) in ip_send_check() argument
95 iph->check = 0; in ip_send_check()
96 iph->check = ip_fast_csum((unsigned char *)iph, iph->ihl); in ip_send_check()
102 struct iphdr *iph = ip_hdr(skb); in __ip_local_out() local
106 iph_set_totlen(iph, skb->len); in __ip_local_out()
107 ip_send_check(iph); in __ip_local_out()
156 struct iphdr *iph; in ip_build_and_send_pkt() local
161 iph = ip_hdr(skb); in ip_build_and_send_pkt()
162 iph->version = 4; in ip_build_and_send_pkt()
163 iph->ihl = 5; in ip_build_and_send_pkt()
[all …]
Dip_gre.c140 const struct iphdr *iph; in ipgre_err() local
154 iph = (const struct iphdr *)(icmp_hdr(skb) + 1); in ipgre_err()
156 iph->daddr, iph->saddr, tpi->key); in ipgre_err()
193 !ip6_err_gen_icmpv6_unreach(skb, iph->ihl * 4 + tpi->hdr_len, in ipgre_err()
198 if (t->parms.iph.daddr == 0 || in ipgre_err()
199 ipv4_is_multicast(t->parms.iph.daddr)) in ipgre_err()
202 if (t->parms.iph.ttl == 0 && type == ICMP_TIME_EXCEEDED) in ipgre_err()
230 const struct iphdr *iph = (struct iphdr *)skb->data; in gre_err() local
236 iph->ihl * 4) < 0) in gre_err()
270 const struct iphdr *iph; in erspan_rcv() local
[all …]
Dip_tunnel.c97 if (local != t->parms.iph.saddr || in ip_tunnel_lookup()
98 remote != t->parms.iph.daddr || in ip_tunnel_lookup()
112 if (remote != t->parms.iph.daddr || in ip_tunnel_lookup()
113 t->parms.iph.saddr != 0 || in ip_tunnel_lookup()
130 if ((local != t->parms.iph.saddr || t->parms.iph.daddr != 0) && in ip_tunnel_lookup()
131 (local != t->parms.iph.daddr || !ipv4_is_multicast(local))) in ip_tunnel_lookup()
148 t->parms.iph.saddr != 0 || in ip_tunnel_lookup()
149 t->parms.iph.daddr != 0 || in ip_tunnel_lookup()
181 if (parms->iph.daddr && !ipv4_is_multicast(parms->iph.daddr)) in ip_bucket()
182 remote = parms->iph.daddr; in ip_bucket()
[all …]
Dip_vti.c51 const struct iphdr *iph = ip_hdr(skb); in vti_input() local
56 iph->saddr, iph->daddr, 0); in vti_input()
223 if (!vti_state_check(dst->xfrm, parms->iph.daddr, parms->iph.saddr)) { in vti_xmit()
322 const struct iphdr *iph = (const struct iphdr *)skb->data; in vti4_err() local
323 int protocol = iph->protocol; in vti4_err()
327 iph->daddr, iph->saddr, 0); in vti4_err()
335 esph = (struct ip_esp_hdr *)(skb->data+(iph->ihl<<2)); in vti4_err()
339 ah = (struct ip_auth_hdr *)(skb->data+(iph->ihl<<2)); in vti4_err()
343 ipch = (struct ip_comp_hdr *)(skb->data+(iph->ihl<<2)); in vti4_err()
361 x = xfrm_state_lookup(net, mark, (const xfrm_address_t *)&iph->daddr, in vti4_err()
[all …]
Dip_fragment.c136 const struct iphdr *iph; in ip_expire() local
177 iph = ip_hdr(head); in ip_expire()
178 err = ip_route_input_noref(head, iph->daddr, iph->saddr, in ip_expire()
179 iph->tos, head->dev); in ip_expire()
205 static struct ipq *ip_find(struct net *net, struct iphdr *iph, in ip_find() argument
209 .saddr = iph->saddr, in ip_find()
210 .daddr = iph->daddr, in ip_find()
213 .id = iph->id, in ip_find()
214 .protocol = iph->protocol, in ip_find()
416 struct iphdr *iph; in ip_frag_reasm() local
[all …]
/net/ipv6/
Dsit.c108 if (local == t->parms.iph.saddr && in ipip6_tunnel_lookup()
109 remote == t->parms.iph.daddr && in ipip6_tunnel_lookup()
116 if (remote == t->parms.iph.daddr && in ipip6_tunnel_lookup()
123 if (local == t->parms.iph.saddr && in ipip6_tunnel_lookup()
138 __be32 remote = parms->iph.daddr; in __ipip6_bucket()
139 __be32 local = parms->iph.saddr; in __ipip6_bucket()
207 __dev_addr_set(dev, &t->parms.iph.saddr, 4); in ipip6_tunnel_create()
208 memcpy(dev->broadcast, &t->parms.iph.daddr, 4); in ipip6_tunnel_create()
231 __be32 remote = parms->iph.daddr; in ipip6_tunnel_locate()
232 __be32 local = parms->iph.saddr; in ipip6_tunnel_locate()
[all …]
Dip6_offload.c200 static int ipv6_exthdrs_len(struct ipv6hdr *iph, in ipv6_exthdrs_len() argument
203 struct ipv6_opt_hdr *opth = (void *)iph; in ipv6_exthdrs_len()
204 int len = 0, proto, optlen = sizeof(*iph); in ipv6_exthdrs_len()
206 proto = iph->nexthdr; in ipv6_exthdrs_len()
229 struct ipv6hdr *iph; in ipv6_gro_receive() local
237 hlen = off + sizeof(*iph); in ipv6_gro_receive()
238 iph = skb_gro_header(skb, hlen, off); in ipv6_gro_receive()
239 if (unlikely(!iph)) in ipv6_gro_receive()
245 flush += ntohs(iph->payload_len) != skb->len - hlen; in ipv6_gro_receive()
247 proto = iph->nexthdr; in ipv6_gro_receive()
[all …]
/net/ipv6/netfilter/
Dnft_fib_ipv6.c25 struct ipv6hdr *iph) in nft_fib6_flowi_init() argument
30 fl6->daddr = iph->daddr; in nft_fib6_flowi_init()
31 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()
54 fl6->flowlabel = (*(__be32 *)iph) & IPV6_FLOWINFO_MASK; in nft_fib6_flowi_init()
61 struct ipv6hdr *iph) in __nft_fib6_eval_type() argument
78 nft_fib6_flowi_init(&fl6, priv, pkt, dev, iph); in __nft_fib6_eval_type()
133 struct ipv6hdr *iph, _iph; in nft_fib6_eval_type() local
135 iph = skb_header_pointer(pkt->skb, noff, sizeof(_iph), &_iph); in nft_fib6_eval_type()
[all …]
Dip6t_rpfilter.c36 struct ipv6hdr *iph = ipv6_hdr(skb); in rpfilter_lookup_reverse6() local
41 .flowlabel = (* (__be32 *) iph) & IPV6_FLOWINFO_MASK, in rpfilter_lookup_reverse6()
42 .flowi6_proto = iph->nexthdr, in rpfilter_lookup_reverse6()
44 .daddr = iph->saddr, in rpfilter_lookup_reverse6()
48 if (rpfilter_addr_unicast(&iph->daddr)) { in rpfilter_lookup_reverse6()
49 memcpy(&fl6.saddr, &iph->daddr, sizeof(struct in6_addr)); in rpfilter_lookup_reverse6()
57 if (rpfilter_addr_linklocal(&iph->saddr)) { in rpfilter_lookup_reverse6()
94 struct ipv6hdr *iph; in rpfilter_mt() local
100 iph = ipv6_hdr(skb); in rpfilter_mt()
101 saddrtype = ipv6_addr_type(&iph->saddr); in rpfilter_mt()
/net/sched/
Dact_nat.c120 struct iphdr *iph; in tcf_nat_act() local
145 if (!pskb_may_pull(skb, sizeof(*iph) + noff)) in tcf_nat_act()
148 iph = ip_hdr(skb); in tcf_nat_act()
151 addr = iph->saddr; in tcf_nat_act()
153 addr = iph->daddr; in tcf_nat_act()
156 if (skb_try_make_writable(skb, sizeof(*iph) + noff)) in tcf_nat_act()
163 iph = ip_hdr(skb); in tcf_nat_act()
165 iph->saddr = new_addr; in tcf_nat_act()
167 iph->daddr = new_addr; in tcf_nat_act()
169 csum_replace4(&iph->check, addr, new_addr); in tcf_nat_act()
[all …]
Dact_csum.c209 const struct iphdr *iph; in tcf_csum_ipv4_tcp() local
218 iph = ip_hdr(skb); in tcf_csum_ipv4_tcp()
222 iph->saddr, iph->daddr, skb->csum); in tcf_csum_ipv4_tcp()
258 const struct iphdr *iph; in tcf_csum_ipv4_udp() local
275 iph = ip_hdr(skb); in tcf_csum_ipv4_udp()
296 udph->check = csum_tcpudp_magic(iph->saddr, iph->daddr, in tcf_csum_ipv4_udp()
297 ul, iph->protocol, in tcf_csum_ipv4_udp()
386 const struct iphdr *iph; in tcf_csum_ipv4() local
391 if (!pskb_may_pull(skb, sizeof(*iph) + ntkoff)) in tcf_csum_ipv4()
394 iph = ip_hdr(skb); in tcf_csum_ipv4()
[all …]
/net/netfilter/
Dxt_iprange.c20 const struct iphdr *iph = ip_hdr(skb); in iprange_mt4() local
24 m = ntohl(iph->saddr) < ntohl(info->src_min.ip); in iprange_mt4()
25 m |= ntohl(iph->saddr) > ntohl(info->src_max.ip); in iprange_mt4()
29 &iph->saddr, in iprange_mt4()
37 m = ntohl(iph->daddr) < ntohl(info->dst_min.ip); in iprange_mt4()
38 m |= ntohl(iph->daddr) > ntohl(info->dst_max.ip); in iprange_mt4()
42 &iph->daddr, in iprange_mt4()
69 const struct ipv6hdr *iph = ipv6_hdr(skb); in iprange_mt6() local
73 m = iprange_ipv6_lt(&iph->saddr, &info->src_min.in6); in iprange_mt6()
74 m |= iprange_ipv6_lt(&info->src_max.in6, &iph->saddr); in iprange_mt6()
[all …]
Dnf_synproxy_core.c399 struct iphdr *iph; in synproxy_build_ip() local
402 iph = skb_put(skb, sizeof(*iph)); in synproxy_build_ip()
403 iph->version = 4; in synproxy_build_ip()
404 iph->ihl = sizeof(*iph) / 4; in synproxy_build_ip()
405 iph->tos = 0; in synproxy_build_ip()
406 iph->id = 0; in synproxy_build_ip()
407 iph->frag_off = htons(IP_DF); in synproxy_build_ip()
408 iph->ttl = READ_ONCE(net->ipv4.sysctl_ip_default_ttl); in synproxy_build_ip()
409 iph->protocol = IPPROTO_TCP; in synproxy_build_ip()
410 iph->check = 0; in synproxy_build_ip()
[all …]
Dnf_flow_table_ip.c62 static void nf_flow_nat_ip_l4proto(struct sk_buff *skb, struct iphdr *iph, in nf_flow_nat_ip_l4proto() argument
66 switch (iph->protocol) { in nf_flow_nat_ip_l4proto()
77 struct sk_buff *skb, struct iphdr *iph, in nf_flow_snat_ip() argument
84 addr = iph->saddr; in nf_flow_snat_ip()
86 iph->saddr = new_addr; in nf_flow_snat_ip()
89 addr = iph->daddr; in nf_flow_snat_ip()
91 iph->daddr = new_addr; in nf_flow_snat_ip()
94 csum_replace4(&iph->check, addr, new_addr); in nf_flow_snat_ip()
96 nf_flow_nat_ip_l4proto(skb, iph, thoff, addr, new_addr); in nf_flow_snat_ip()
100 struct sk_buff *skb, struct iphdr *iph, in nf_flow_dnat_ip() argument
[all …]
Dxt_HL.c28 struct iphdr *iph; in ttl_tg() local
32 if (skb_ensure_writable(skb, sizeof(*iph))) in ttl_tg()
35 iph = ip_hdr(skb); in ttl_tg()
42 new_ttl = iph->ttl + info->ttl; in ttl_tg()
47 new_ttl = iph->ttl - info->ttl; in ttl_tg()
52 new_ttl = iph->ttl; in ttl_tg()
56 if (new_ttl != iph->ttl) { in ttl_tg()
57 csum_replace2(&iph->check, htons(iph->ttl << 8), in ttl_tg()
59 iph->ttl = new_ttl; in ttl_tg()
/net/ipv4/netfilter/
Dnft_fib_ipv4.c34 struct iphdr *iph, _iph; in nft_fib4_eval_type() local
42 iph = skb_header_pointer(pkt->skb, noff, sizeof(_iph), &_iph); in nft_fib4_eval_type()
43 if (!iph) { in nft_fib4_eval_type()
49 addr = iph->daddr; in nft_fib4_eval_type()
51 addr = iph->saddr; in nft_fib4_eval_type()
63 struct iphdr *iph, _iph; in nft_fib4_eval() local
96 iph = skb_header_pointer(pkt->skb, noff, sizeof(_iph), &_iph); in nft_fib4_eval()
97 if (!iph) { in nft_fib4_eval()
102 if (ipv4_is_zeronet(iph->saddr)) { in nft_fib4_eval()
103 if (ipv4_is_lbcast(iph->daddr) || in nft_fib4_eval()
[all …]
Dnf_socket_ipv4.c89 const struct iphdr *iph = ip_hdr(skb); in nf_sk_lookup_slow_v4() local
98 if (iph->protocol == IPPROTO_UDP || iph->protocol == IPPROTO_TCP) { in nf_sk_lookup_slow_v4()
103 iph->protocol == IPPROTO_UDP ? in nf_sk_lookup_slow_v4()
108 protocol = iph->protocol; in nf_sk_lookup_slow_v4()
109 saddr = iph->saddr; in nf_sk_lookup_slow_v4()
111 daddr = iph->daddr; in nf_sk_lookup_slow_v4()
114 doff = iph->protocol == IPPROTO_TCP ? in nf_sk_lookup_slow_v4()
118 } else if (iph->protocol == IPPROTO_ICMP) { in nf_sk_lookup_slow_v4()
133 ((iph->protocol != IPPROTO_ICMP && in nf_sk_lookup_slow_v4()
135 (iph->protocol == IPPROTO_ICMP && in nf_sk_lookup_slow_v4()
[all …]
Diptable_mangle.c40 const struct iphdr *iph; in ipt_mangle_out() local
48 iph = ip_hdr(skb); in ipt_mangle_out()
49 saddr = iph->saddr; in ipt_mangle_out()
50 daddr = iph->daddr; in ipt_mangle_out()
51 tos = iph->tos; in ipt_mangle_out()
56 iph = ip_hdr(skb); in ipt_mangle_out()
58 if (iph->saddr != saddr || in ipt_mangle_out()
59 iph->daddr != daddr || in ipt_mangle_out()
61 iph->tos != tos) { in ipt_mangle_out()

123456