| /linux/include/net/netfilter/ |
| H A D | nf_queue.h | 64 static inline u32 hash_v6(const struct ipv6hdr *ip6h, u32 initval) in hash_v6() argument 68 if ((__force u32)ip6h->saddr.s6_addr32[3] < in hash_v6() 69 (__force u32)ip6h->daddr.s6_addr32[3]) { in hash_v6() 70 a = (__force u32) ip6h->saddr.s6_addr32[3]; in hash_v6() 71 b = (__force u32) ip6h->daddr.s6_addr32[3]; in hash_v6() 73 b = (__force u32) ip6h->saddr.s6_addr32[3]; in hash_v6() 74 a = (__force u32) ip6h->daddr.s6_addr32[3]; in hash_v6() 77 if ((__force u32)ip6h->saddr.s6_addr32[1] < in hash_v6() 78 (__force u32)ip6h->daddr.s6_addr32[1]) in hash_v6() 79 c = (__force u32) ip6h->saddr.s6_addr32[1]; in hash_v6() [all …]
|
| /linux/samples/bpf/ |
| H A D | xdp_tx_iptunnel_kern.c | 159 struct ipv6hdr *ip6h = data + sizeof(struct ethhdr); in handle_ipv6() local 164 if (ip6h + 1 > data_end) in handle_ipv6() 167 dport = get_dport(ip6h + 1, data_end, ip6h->nexthdr); in handle_ipv6() 171 vip.protocol = ip6h->nexthdr; in handle_ipv6() 173 memcpy(vip.daddr.v6, ip6h->daddr.s6_addr32, sizeof(vip.daddr)); in handle_ipv6() 175 payload_len = ip6h->payload_len; in handle_ipv6() 191 ip6h = data + sizeof(*new_eth); in handle_ipv6() 192 old_eth = data + sizeof(*ip6h); in handle_ipv6() 196 ip6h + 1 > data_end) in handle_ipv6() 201 ip6h->version = 6; in handle_ipv6() [all …]
|
| H A D | xdp_fwd_kern.c | 49 struct ipv6hdr *ip6h; in xdp_fwd_flags() local 83 ip6h = data + nh_off; in xdp_fwd_flags() 84 if (ip6h + 1 > data_end) in xdp_fwd_flags() 87 if (ip6h->hop_limit <= 1) in xdp_fwd_flags() 91 fib_params.flowinfo = *(__be32 *)ip6h & IPV6_FLOWINFO_MASK; in xdp_fwd_flags() 92 fib_params.l4_protocol = ip6h->nexthdr; in xdp_fwd_flags() 95 fib_params.tot_len = ntohs(ip6h->payload_len); in xdp_fwd_flags() 96 *src = ip6h->saddr; in xdp_fwd_flags() 97 *dst = ip6h->daddr; in xdp_fwd_flags() 136 ip6h->hop_limit--; in xdp_fwd_flags()
|
| H A D | parse_varlen.c | 80 struct ipv6hdr *ip6h; in parse_ipv6() local 85 ip6h = data + nh_off; in parse_ipv6() 86 if (ip6h + 1 > data_end) in parse_ipv6() 89 nexthdr = ip6h->nexthdr; in parse_ipv6() 98 ip6h = data + nh_off + ihl_len; in parse_ipv6() 99 if (ip6h + 1 > data_end) in parse_ipv6() 102 nexthdr = ip6h->nexthdr; in parse_ipv6()
|
| /linux/tools/testing/selftests/bpf/progs/ |
| H A D | test_xdp.c | 159 struct ipv6hdr *ip6h = data + sizeof(struct ethhdr); in handle_ipv6() local 164 if (ip6h + 1 > data_end) in handle_ipv6() 167 dport = get_dport(ip6h + 1, data_end, ip6h->nexthdr); in handle_ipv6() 171 vip.protocol = ip6h->nexthdr; in handle_ipv6() 173 memcpy(vip.daddr.v6, ip6h->daddr.s6_addr32, sizeof(vip.daddr)); in handle_ipv6() 175 payload_len = ip6h->payload_len; in handle_ipv6() 189 ip6h = data + sizeof(*new_eth); in handle_ipv6() 190 old_eth = data + sizeof(*ip6h); in handle_ipv6() 193 ip6h + 1 > data_end) in handle_ipv6() 198 ip6h->version = 6; in handle_ipv6() [all …]
|
| H A D | test_xdp_loop.c | 155 struct ipv6hdr *ip6h = data + sizeof(struct ethhdr); in handle_ipv6() local 160 if (ip6h + 1 > data_end) in handle_ipv6() 163 dport = get_dport(ip6h + 1, data_end, ip6h->nexthdr); in handle_ipv6() 167 vip.protocol = ip6h->nexthdr; in handle_ipv6() 169 memcpy(vip.daddr.v6, ip6h->daddr.s6_addr32, sizeof(vip.daddr)); in handle_ipv6() 171 payload_len = ip6h->payload_len; in handle_ipv6() 185 ip6h = data + sizeof(*new_eth); in handle_ipv6() 186 old_eth = data + sizeof(*ip6h); in handle_ipv6() 189 ip6h + 1 > data_end) in handle_ipv6() 194 ip6h->version = 6; in handle_ipv6() [all …]
|
| H A D | cgroup_skb_sk_lookup_kern.c | 30 const struct ipv6hdr *ip6h, in set_tuple() argument 33 set_ip(tuple->ipv6.saddr, &ip6h->daddr); in set_tuple() 34 set_ip(tuple->ipv6.daddr, &ip6h->saddr); in set_tuple() 40 const struct ipv6hdr *ip6h, in is_allowed_peer_cg() argument 48 set_tuple(&tuple, ip6h, tcph); in is_allowed_peer_cg() 69 struct ipv6hdr ip6h; in ingress_lookup() local 79 if (bpf_skb_load_bytes(skb, 0, &ip6h, sizeof(ip6h))) in ingress_lookup() 82 if (ip6h.nexthdr != IPPROTO_TCP) in ingress_lookup() 85 if (bpf_skb_load_bytes(skb, sizeof(ip6h), &tcph, sizeof(tcph))) in ingress_lookup() 94 return is_allowed_peer_cg(skb, &ip6h, &tcph); in ingress_lookup()
|
| H A D | test_xdp_dynptr.c | 168 struct ipv6hdr *ip6h; in handle_ipv6() local 178 ip6h = bpf_dynptr_slice(xdp_ptr, ethhdr_sz, ip6h_buffer_udp, sizeof(ip6h_buffer_udp)); in handle_ipv6() 180 ip6h = bpf_dynptr_slice(xdp_ptr, ethhdr_sz, ip6h_buffer_tcp, sizeof(ip6h_buffer_tcp)); in handle_ipv6() 182 if (!ip6h) in handle_ipv6() 185 dport = get_dport(ip6h + 1, ip6h->nexthdr); in handle_ipv6() 189 vip.protocol = ip6h->nexthdr; in handle_ipv6() 191 memcpy(vip.daddr.v6, ip6h->daddr.s6_addr32, sizeof(vip.daddr)); in handle_ipv6() 193 payload_len = ip6h->payload_len; in handle_ipv6() 208 ip6h = (struct ipv6hdr *)(new_eth + 1); in handle_ipv6() 209 old_eth = (struct ethhdr *)(ip6h + 1); in handle_ipv6() [all …]
|
| H A D | icmp_send.c | 26 struct ipv6hdr *ip6h; in egress() local 48 ip6h = data; in egress() 49 if ((void *)(ip6h + 1) > data_end || in egress() 50 ip6h->nexthdr != IPPROTO_TCP) in egress() 53 if (ip6h->daddr.in6_u.u6_addr32[0] != 0 || in egress() 54 ip6h->daddr.in6_u.u6_addr32[1] != 0 || in egress() 55 ip6h->daddr.in6_u.u6_addr32[2] != 0 || in egress() 56 ip6h->daddr.in6_u.u6_addr32[3] != bpf_htonl(SERVER_IP6_LO)) in egress() 59 tcph = (void *)(ip6h + 1); in egress()
|
| H A D | test_xdp_noinline.c | 285 struct ipv6hdr *ip6h; in encap_v6() local 295 ip6h = data + sizeof(struct eth_hdr); in encap_v6() 298 old_eth + 1 > data_end || ip6h + 1 > data_end) in encap_v6() 303 ip6h->version = 6; in encap_v6() 304 ip6h->priority = 0; in encap_v6() 305 memset(ip6h->flow_lbl, 0, sizeof(ip6h->flow_lbl)); in encap_v6() 307 ip6h->nexthdr = IPPROTO_IPV6; in encap_v6() 309 ip6h->payload_len = in encap_v6() 311 ip6h->hop_limit = 4; in encap_v6() 313 ip6h->saddr.in6_u.u6_addr32[0] = 1; in encap_v6() [all …]
|
| H A D | decap_sanity.c | 35 struct ipv6hdr ip6h; in decap_sanity() local 42 if (bpf_skb_load_bytes(skb, ETH_HLEN, &ip6h, sizeof(ip6h))) in decap_sanity() 45 if (ip6h.nexthdr != IPPROTO_UDP) in decap_sanity() 48 if (bpf_skb_load_bytes(skb, ETH_HLEN + sizeof(ip6h), &udph, sizeof(udph))) in decap_sanity() 56 err = bpf_skb_adjust_room(skb, -(s32)(ETH_HLEN + sizeof(ip6h) + sizeof(udph)), in decap_sanity()
|
| H A D | xdp_flowtable.c | 114 struct ipv6hdr *ip6h = data + sizeof(*eth); in xdp_flowtable_do_lookup() 116 ports = (struct flow_ports___local *)(ip6h + 1); in xdp_flowtable_do_lookup() 120 if (ip6h->hop_limit <= 1) in xdp_flowtable_do_lookup() 124 ip6h->nexthdr)) in xdp_flowtable_do_lookup() 128 tuple.l4_protocol = ip6h->nexthdr; in xdp_flowtable_do_lookup() 129 tuple.tot_len = bpf_ntohs(ip6h->payload_len); in xdp_flowtable_do_lookup() 130 *src = ip6h->saddr; in xdp_flowtable_do_lookup() 131 *dst = ip6h->daddr; in xdp_flowtable_do_lookup() 111 struct ipv6hdr *ip6h = data + sizeof(*eth); xdp_flowtable_do_lookup() local
|
| H A D | bpf_flow.c | 327 struct ipv6hdr *ip6h, _ip6h; in PROG() local 329 ip6h = bpf_flow_dissect_get_header(skb, sizeof(*ip6h), &_ip6h); in PROG() 330 if (!ip6h) in PROG() 334 memcpy(&keys->ipv6_src, &ip6h->saddr, 2*sizeof(ip6h->saddr)); in PROG() 337 keys->ip_proto = ip6h->nexthdr; in PROG() 338 keys->flow_label = ip6_flowlabel(ip6h); in PROG() 343 return parse_ipv6_proto(skb, ip6h->nexthdr); in PROG() 349 struct ipv6_opt_hdr *ip6h, _ip6h; in PROG() local 351 ip6h = bpf_flow_dissect_get_header(skb, sizeof(*ip6h), &_ip6h); in PROG() 352 if (!ip6h) in PROG() [all …]
|
| H A D | ip_check_defrag.c | 30 static bool is_frag_v6(struct ipv6hdr *ip6h) in is_frag_v4() 37 return ip6h->nexthdr == NEXTHDR_FRAGMENT; in is_frag_v6() 65 struct ipv6hdr *ip6h; in handle_v4() 71 ip6h = bpf_dynptr_slice(&ptr, 0, ip6h_buf, sizeof(ip6h_buf)); in handle_v6() 72 if (!ip6h) in handle_v6() 76 if (is_frag_v6(ip6h)) { in handle_v6() 35 is_frag_v6(struct ipv6hdr * ip6h) is_frag_v6() argument 70 struct ipv6hdr *ip6h; handle_v6() local
|
| /linux/net/ipv6/ila/ |
| H A D | ila_common.c | 36 static __wsum get_csum_diff(struct ipv6hdr *ip6h, struct ila_params *p) in get_csum_diff() argument 38 return get_csum_diff_iaddr(ila_a2i(&ip6h->daddr), p); in get_csum_diff() 79 struct ipv6hdr *ip6h = ipv6_hdr(skb); in ila_csum_adjust_transport() local 82 switch (ip6h->nexthdr) { in ila_csum_adjust_transport() 88 ip6h = ipv6_hdr(skb); in ila_csum_adjust_transport() 89 diff = get_csum_diff(ip6h, p); in ila_csum_adjust_transport() 100 ip6h = ipv6_hdr(skb); in ila_csum_adjust_transport() 101 diff = get_csum_diff(ip6h, p); in ila_csum_adjust_transport() 115 ip6h = ipv6_hdr(skb); in ila_csum_adjust_transport() 116 diff = get_csum_diff(ip6h, p); in ila_csum_adjust_transport() [all …]
|
| /linux/net/netfilter/ |
| H A D | nf_flow_table_ip.c | 167 struct ipv6hdr *ip6h; in nf_flow_tuple_encap() local 202 ip6h = (struct ipv6hdr *)(skb_network_header(skb) + offset); in nf_flow_tuple_encap() 204 tuple->tun.dst_v6 = ip6h->daddr; in nf_flow_tuple_encap() 205 tuple->tun.src_v6 = ip6h->saddr; in nf_flow_tuple_encap() 342 struct ipv6hdr *ip6h; in nf_flow_ip6_tunnel_proto() local 344 if (!pskb_may_pull(skb, sizeof(*ip6h) + ctx->offset)) in nf_flow_ip6_tunnel_proto() 347 ip6h = (struct ipv6hdr *)(skb_network_header(skb) + ctx->offset); in nf_flow_ip6_tunnel_proto() 348 if (ip6h->hop_limit <= 1) in nf_flow_ip6_tunnel_proto() 351 if (ipv6_ext_hdr(ip6h->nexthdr)) in nf_flow_ip6_tunnel_proto() 354 if (ip6h->nexthdr == IPPROTO_IPV6) { in nf_flow_ip6_tunnel_proto() [all …]
|
| H A D | xt_HL.c | 68 struct ipv6hdr *ip6h; in hl_tg6() local 72 if (skb_ensure_writable(skb, sizeof(*ip6h))) in hl_tg6() 75 ip6h = ipv6_hdr(skb); in hl_tg6() 82 new_hl = ip6h->hop_limit + info->hop_limit; in hl_tg6() 87 new_hl = ip6h->hop_limit - info->hop_limit; in hl_tg6() 92 new_hl = ip6h->hop_limit; in hl_tg6() 96 ip6h->hop_limit = new_hl; in hl_tg6()
|
| /linux/net/ipv6/ |
| H A D | mcast_snoop.c | 16 const struct ipv6hdr *ip6h; in ipv6_mc_check_ip6hdr() local 18 unsigned int offset = skb_network_offset(skb) + sizeof(*ip6h); in ipv6_mc_check_ip6hdr() 23 ip6h = ipv6_hdr(skb); in ipv6_mc_check_ip6hdr() 25 if (ip6h->version != 6) in ipv6_mc_check_ip6hdr() 28 len = offset + ntohs(ip6h->payload_len); in ipv6_mc_check_ip6hdr() 39 const struct ipv6hdr *ip6h; in ipv6_mc_check_exthdrs() local 44 ip6h = ipv6_hdr(skb); in ipv6_mc_check_exthdrs() 46 if (ip6h->nexthdr != IPPROTO_HOPOPTS) in ipv6_mc_check_exthdrs() 49 nexthdr = ip6h->nexthdr; in ipv6_mc_check_exthdrs() 50 offset = skb_network_offset(skb) + sizeof(*ip6h); in ipv6_mc_check_exthdrs()
|
| H A D | ip6_udp_tunnel.c | 87 struct ipv6hdr *ip6h; in udp_tunnel6_xmit_skb() local 102 __skb_push(skb, sizeof(*ip6h)); in udp_tunnel6_xmit_skb() 104 ip6h = ipv6_hdr(skb); in udp_tunnel6_xmit_skb() 105 ip6_flow_hdr(ip6h, prio, label); in udp_tunnel6_xmit_skb() 106 ip6h->payload_len = htons(skb->len); in udp_tunnel6_xmit_skb() 107 ip6h->nexthdr = IPPROTO_UDP; in udp_tunnel6_xmit_skb() 108 ip6h->hop_limit = ttl; in udp_tunnel6_xmit_skb() 109 ip6h->daddr = *daddr; in udp_tunnel6_xmit_skb() 110 ip6h->saddr = *saddr; in udp_tunnel6_xmit_skb()
|
| H A D | ndisc_snoop.c | 11 const struct ipv6hdr *ip6h; in ndisc_check_ip6hdr() local 14 offset = skb_network_offset(skb) + sizeof(*ip6h); in ndisc_check_ip6hdr() 18 ip6h = ipv6_hdr(skb); in ndisc_check_ip6hdr() 20 if (ip6h->version != 6) in ndisc_check_ip6hdr() 23 if (ip6h->nexthdr != IPPROTO_ICMPV6) in ndisc_check_ip6hdr() 27 if (ip6h->hop_limit != 255) in ndisc_check_ip6hdr() 30 len = offset + ntohs(ip6h->payload_len); in ndisc_check_ip6hdr()
|
| /linux/net/ipv6/netfilter/ |
| H A D | nf_reject_ipv6.c | 31 const struct ipv6hdr *ip6h = ipv6_hdr(skb); in nf_reject_v6_csum_ok() local 34 u8 proto = ip6h->nexthdr; in nf_reject_v6_csum_ok() 39 if (ip6h->payload_len && in nf_reject_v6_csum_ok() 40 pskb_trim_rcsum(skb, ntohs(ip6h->payload_len) + sizeof(*ip6h))) in nf_reject_v6_csum_ok() 43 ip6h = ipv6_hdr(skb); in nf_reject_v6_csum_ok() 44 thoff = ipv6_skip_exthdr(skb, ((u8*)(ip6h+1) - skb->data), &proto, &fo); in nf_reject_v6_csum_ok() 110 const struct ipv6hdr *ip6h = ipv6_hdr(skb); in nf_skb_is_icmp6_unreach() local 111 u8 proto = ip6h->nexthdr; in nf_skb_is_icmp6_unreach() 116 thoff = ipv6_skip_exthdr(skb, ((u8 *)(ip6h + 1) - skb->data), &proto, &fo); in nf_skb_is_icmp6_unreach() 246 struct ipv6hdr *ip6h; in nf_reject_ip6hdr_put() local [all …]
|
| /linux/lib/tests/ |
| H A D | blackhole_dev_kunit.c | 29 struct ipv6hdr *ip6h; in test_blackholedev() local 52 ip6h = (struct ipv6hdr *)skb_push(skb, sizeof(struct ipv6hdr)); in test_blackholedev() 54 ip6h->hop_limit = 32; in test_blackholedev() 55 ip6h->payload_len = htons(data_len + sizeof(struct udphdr)); in test_blackholedev() 56 ip6h->nexthdr = IPPROTO_UDP; in test_blackholedev() 57 ip6h->saddr = in6addr_loopback; in test_blackholedev() 58 ip6h->daddr = in6addr_loopback; in test_blackholedev()
|
| /linux/tools/testing/selftests/net/ |
| H A D | skf_net_off.c | 122 struct ipv6hdr ip6h = {0}; in tun_write() local 135 ip6h.version = 6; in tun_write() 136 ip6h.payload_len = htons(sizeof(uh) + sizeof(uint32_t)); in tun_write() 137 ip6h.nexthdr = IPPROTO_UDP; in tun_write() 138 ip6h.hop_limit = 8; in tun_write() 139 if (inet_pton(AF_INET6, "fdab::2", &ip6h.saddr) != 1) in tun_write() 141 if (inet_pton(AF_INET6, "fdab::1", &ip6h.daddr) != 1) in tun_write() 146 uh.len = ip6h.payload_len; in tun_write() 155 iov[2].iov_base = &ip6h; in tun_write() 156 iov[2].iov_len = sizeof(ip6h); in tun_write()
|
| /linux/drivers/infiniband/core/ |
| H A D | lag.c | 14 struct ipv6hdr *ip6h; in rdma_build_skb() local 58 ip6h = ipv6_hdr(skb); in rdma_build_skb() 59 ip6h->version = 6; in rdma_build_skb() 60 ip6h->nexthdr = IPPROTO_UDP; in rdma_build_skb() 61 memcpy(&ip6h->flow_lbl, &ah_attr->grh.flow_label, in rdma_build_skb() 62 sizeof(*ip6h->flow_lbl)); in rdma_build_skb() 63 memcpy(&ip6h->saddr, ah_attr->grh.sgid_attr->gid.raw, in rdma_build_skb() 65 memcpy(&ip6h->daddr, ah_attr->grh.dgid.raw, in rdma_build_skb()
|
| /linux/net/sched/ |
| H A D | act_csum.c | 188 const struct ipv6hdr *ip6h; in tcf_csum_ipv6_icmp() local 194 ip6h = ipv6_hdr(skb); in tcf_csum_ipv6_icmp() 197 icmp6h->icmp6_cksum = csum_ipv6_magic(&ip6h->saddr, &ip6h->daddr, in tcf_csum_ipv6_icmp() 234 const struct ipv6hdr *ip6h; in tcf_csum_ipv6_tcp() local 243 ip6h = ipv6_hdr(skb); in tcf_csum_ipv6_tcp() 246 tcph->check = csum_ipv6_magic(&ip6h->saddr, &ip6h->daddr, in tcf_csum_ipv6_tcp() 317 const struct ipv6hdr *ip6h; in tcf_csum_ipv6_udp() local 336 ip6h = ipv6_hdr(skb); in tcf_csum_ipv6_udp() 357 udph->check = csum_ipv6_magic(&ip6h->saddr, &ip6h->daddr, ul, in tcf_csum_ipv6_udp() 490 struct ipv6hdr *ip6h; in tcf_csum_ipv6() local [all …]
|