/kernel/linux/linux-5.10/net/netfilter/ipvs/ |
H A D | ip_vs_proto_udp.c | 139 struct udphdr *udph; in udp_snat_handler() local 151 if (skb_ensure_writable(skb, udphoff + sizeof(*udph))) in udp_snat_handler() 173 udph = (void *)skb_network_header(skb) + udphoff; in udp_snat_handler() 174 udph->source = cp->vport; in udp_snat_handler() 180 udp_partial_csum_update(cp->af, udph, &cp->daddr, &cp->vaddr, in udp_snat_handler() 183 } else if (!payload_csum && (udph->check != 0)) { in udp_snat_handler() 185 udp_fast_csum_update(cp->af, udph, &cp->daddr, &cp->vaddr, in udp_snat_handler() 192 udph->check = 0; in udp_snat_handler() 196 udph->check = csum_ipv6_magic(&cp->vaddr.in6, in udp_snat_handler() 202 udph in udp_snat_handler() 222 struct udphdr *udph; udp_dnat_handler() local [all...] |
/kernel/linux/linux-6.6/net/netfilter/ipvs/ |
H A D | ip_vs_proto_udp.c | 139 struct udphdr *udph; in udp_snat_handler() local 151 if (skb_ensure_writable(skb, udphoff + sizeof(*udph))) in udp_snat_handler() 173 udph = (void *)skb_network_header(skb) + udphoff; in udp_snat_handler() 174 udph->source = cp->vport; in udp_snat_handler() 180 udp_partial_csum_update(cp->af, udph, &cp->daddr, &cp->vaddr, in udp_snat_handler() 183 } else if (!payload_csum && (udph->check != 0)) { in udp_snat_handler() 185 udp_fast_csum_update(cp->af, udph, &cp->daddr, &cp->vaddr, in udp_snat_handler() 192 udph->check = 0; in udp_snat_handler() 196 udph->check = csum_ipv6_magic(&cp->vaddr.in6, in udp_snat_handler() 202 udph in udp_snat_handler() 222 struct udphdr *udph; udp_dnat_handler() local [all...] |
/kernel/linux/linux-5.10/net/sched/ |
H A D | act_csum.c | 256 struct udphdr *udph; in tcf_csum_ipv4_udp() local 265 * udph->len to get the real length without any protocol check, in tcf_csum_ipv4_udp() 266 * UDPLITE uses udph->len for another thing, in tcf_csum_ipv4_udp() 270 udph = tcf_csum_skb_nextlayer(skb, ihl, ipl, sizeof(*udph)); in tcf_csum_ipv4_udp() 271 if (udph == NULL) in tcf_csum_ipv4_udp() 275 ul = ntohs(udph->len); in tcf_csum_ipv4_udp() 277 if (udplite || udph->check) { in tcf_csum_ipv4_udp() 279 udph->check = 0; in tcf_csum_ipv4_udp() 283 skb->csum = csum_partial(udph, ip in tcf_csum_ipv4_udp() 312 struct udphdr *udph; tcf_csum_ipv6_udp() local [all...] |
/kernel/linux/linux-6.6/net/sched/ |
H A D | act_csum.c | 257 struct udphdr *udph; in tcf_csum_ipv4_udp() local 266 * udph->len to get the real length without any protocol check, in tcf_csum_ipv4_udp() 267 * UDPLITE uses udph->len for another thing, in tcf_csum_ipv4_udp() 271 udph = tcf_csum_skb_nextlayer(skb, ihl, ipl, sizeof(*udph)); in tcf_csum_ipv4_udp() 272 if (udph == NULL) in tcf_csum_ipv4_udp() 276 ul = ntohs(udph->len); in tcf_csum_ipv4_udp() 278 if (udplite || udph->check) { in tcf_csum_ipv4_udp() 280 udph->check = 0; in tcf_csum_ipv4_udp() 284 skb->csum = csum_partial(udph, ip in tcf_csum_ipv4_udp() 313 struct udphdr *udph; tcf_csum_ipv6_udp() local [all...] |
/kernel/linux/linux-6.6/tools/testing/selftests/bpf/progs/ |
H A D | decap_sanity.c | 36 struct udphdr udph; in decap_sanity() local 48 if (bpf_skb_load_bytes(skb, ETH_HLEN + sizeof(ip6h), &udph, sizeof(udph))) in decap_sanity() 51 if (udph.dest != __bpf_constant_htons(UDP_TEST_PORT)) in decap_sanity() 56 err = bpf_skb_adjust_room(skb, -(s32)(ETH_HLEN + sizeof(ip6h) + sizeof(udph)), in decap_sanity()
|
/kernel/linux/linux-5.10/net/ipv4/netfilter/ |
H A D | nf_nat_snmp_basic_main.c | 129 struct udphdr *udph = (struct udphdr *)((__be32 *)iph + iph->ihl); in snmp_translate() local 130 u16 datalen = ntohs(udph->len) - sizeof(struct udphdr); in snmp_translate() 131 char *data = (unsigned char *)udph + sizeof(struct udphdr); in snmp_translate() 146 ctx.begin = (unsigned char *)udph + sizeof(struct udphdr); in snmp_translate() 147 ctx.check = &udph->check; in snmp_translate() 167 const struct udphdr *udph = (struct udphdr *)((__be32 *)iph + iph->ihl); in help() local 170 if (udph->source == htons(SNMP_PORT) && dir != IP_CT_DIR_REPLY) in help() 172 if (udph->dest == htons(SNMP_TRAP_PORT) && dir != IP_CT_DIR_ORIGINAL) in help() 184 if (ntohs(udph->len) != skb->len - (iph->ihl << 2)) { in help()
|
/kernel/linux/linux-6.6/net/ipv4/netfilter/ |
H A D | nf_nat_snmp_basic_main.c | 129 struct udphdr *udph = (struct udphdr *)((__be32 *)iph + iph->ihl); in snmp_translate() local 130 u16 datalen = ntohs(udph->len) - sizeof(struct udphdr); in snmp_translate() 131 char *data = (unsigned char *)udph + sizeof(struct udphdr); in snmp_translate() 146 ctx.begin = (unsigned char *)udph + sizeof(struct udphdr); in snmp_translate() 147 ctx.check = &udph->check; in snmp_translate() 167 const struct udphdr *udph = (struct udphdr *)((__be32 *)iph + iph->ihl); in help() local 170 if (udph->source == htons(SNMP_PORT) && dir != IP_CT_DIR_REPLY) in help() 172 if (udph->dest == htons(SNMP_TRAP_PORT) && dir != IP_CT_DIR_ORIGINAL) in help() 184 if (ntohs(udph->len) != skb->len - (iph->ihl << 2)) { in help()
|
/kernel/linux/linux-5.10/drivers/net/ethernet/mellanox/mlx5/core/ |
H A D | en_selftest.c | 107 struct udphdr *udph; in mlx5e_test_get_udp_skb() local 128 udph = skb_put(skb, sizeof(struct udphdr)); in mlx5e_test_get_udp_skb() 136 udph->source = htons(9); in mlx5e_test_get_udp_skb() 137 udph->dest = htons(9); /* Discard Protocol */ in mlx5e_test_get_udp_skb() 138 udph->len = htons(sizeof(struct mlx5ehdr) + sizeof(struct udphdr)); in mlx5e_test_get_udp_skb() 139 udph->check = 0; in mlx5e_test_get_udp_skb() 188 struct udphdr *udph; in mlx5e_test_loopback_validate() local 204 udph = (struct udphdr *)((u8 *)iph + 4 * iph->ihl); in mlx5e_test_loopback_validate() 205 if (udph->dest != htons(9)) in mlx5e_test_loopback_validate() 208 mlxh = (struct mlx5ehdr *)((char *)udph in mlx5e_test_loopback_validate() [all...] |
/kernel/linux/linux-6.6/drivers/net/ethernet/mellanox/mlx5/core/ |
H A D | en_selftest.c | 84 struct udphdr *udph; in mlx5e_test_get_udp_skb() local 105 udph = skb_put(skb, sizeof(struct udphdr)); in mlx5e_test_get_udp_skb() 113 udph->source = htons(9); in mlx5e_test_get_udp_skb() 114 udph->dest = htons(9); /* Discard Protocol */ in mlx5e_test_get_udp_skb() 115 udph->len = htons(sizeof(struct mlx5ehdr) + sizeof(struct udphdr)); in mlx5e_test_get_udp_skb() 116 udph->check = 0; in mlx5e_test_get_udp_skb() 165 struct udphdr *udph; in mlx5e_test_loopback_validate() local 181 udph = (struct udphdr *)((u8 *)iph + 4 * iph->ihl); in mlx5e_test_loopback_validate() 182 if (udph->dest != htons(9)) in mlx5e_test_loopback_validate() 185 mlxh = (struct mlx5ehdr *)((char *)udph in mlx5e_test_loopback_validate() [all...] |
/kernel/linux/linux-5.10/tools/testing/selftests/net/ |
H A D | txring_overwrite.c | 43 struct udphdr *udph; in build_packet() local 65 udph = buffer + off; in build_packet() 66 udph->dest = htons(8000); in build_packet() 67 udph->source = htons(8001); in build_packet() 68 udph->len = htons(blen - off); in build_packet() 69 udph->check = 0; in build_packet() 71 off += sizeof(*udph); in build_packet()
|
H A D | psock_snd.c | 137 struct udphdr *udph = header; in build_udp_header() local 138 int len = sizeof(*udph) + payload_len; in build_udp_header() 140 udph->source = htons(9); in build_udp_header() 141 udph->dest = htons(cfg_port); in build_udp_header() 142 udph->len = htons(len); in build_udp_header() 145 udph->check = build_ip_csum(header - (2 * alen), alen, in build_udp_header() 146 htons(IPPROTO_UDP) + udph->len); in build_udp_header() 148 udph->check = 0; in build_udp_header() 150 return sizeof(*udph); in build_udp_header()
|
/kernel/linux/linux-6.6/tools/testing/selftests/net/ |
H A D | txring_overwrite.c | 43 struct udphdr *udph; in build_packet() local 65 udph = buffer + off; in build_packet() 66 udph->dest = htons(8000); in build_packet() 67 udph->source = htons(8001); in build_packet() 68 udph->len = htons(blen - off); in build_packet() 69 udph->check = 0; in build_packet() 71 off += sizeof(*udph); in build_packet()
|
H A D | psock_snd.c | 137 struct udphdr *udph = header; in build_udp_header() local 138 int len = sizeof(*udph) + payload_len; in build_udp_header() 140 udph->source = htons(9); in build_udp_header() 141 udph->dest = htons(cfg_port); in build_udp_header() 142 udph->len = htons(len); in build_udp_header() 145 udph->check = build_ip_csum(header - (2 * alen), alen, in build_udp_header() 146 htons(IPPROTO_UDP) + udph->len); in build_udp_header() 148 udph->check = 0; in build_udp_header() 150 return sizeof(*udph); in build_udp_header()
|
/kernel/linux/linux-5.10/net/netfilter/ |
H A D | nf_nat_helper.c | 145 struct udphdr *udph; in nf_nat_mangle_udp_packet() local 156 udph = (void *)skb->data + protoff; in nf_nat_mangle_udp_packet() 159 mangle_contents(skb, protoff + sizeof(*udph), in nf_nat_mangle_udp_packet() 164 udph->len = htons(datalen); in nf_nat_mangle_udp_packet() 167 if (!udph->check && skb->ip_summed != CHECKSUM_PARTIAL) in nf_nat_mangle_udp_packet() 171 udph, &udph->check, datalen, oldlen); in nf_nat_mangle_udp_packet()
|
H A D | nf_flow_table_ip.c | 54 struct udphdr *udph; in nf_flow_nat_ip_udp() local 56 if (skb_try_make_writable(skb, thoff + sizeof(*udph))) in nf_flow_nat_ip_udp() 59 udph = (void *)(skb_network_header(skb) + thoff); in nf_flow_nat_ip_udp() 60 if (udph->check || skb->ip_summed == CHECKSUM_PARTIAL) { in nf_flow_nat_ip_udp() 61 inet_proto_csum_replace4(&udph->check, skb, addr, in nf_flow_nat_ip_udp() 63 if (!udph->check) in nf_flow_nat_ip_udp() 64 udph->check = CSUM_MANGLED_0; in nf_flow_nat_ip_udp() 334 struct udphdr *udph; in nf_flow_nat_ipv6_udp() local 336 if (skb_try_make_writable(skb, thoff + sizeof(*udph))) in nf_flow_nat_ipv6_udp() 339 udph in nf_flow_nat_ipv6_udp() [all...] |
/kernel/linux/linux-6.6/net/netfilter/ |
H A D | nf_nat_helper.c | 145 struct udphdr *udph; in nf_nat_mangle_udp_packet() local 156 udph = (void *)skb->data + protoff; in nf_nat_mangle_udp_packet() 159 mangle_contents(skb, protoff + sizeof(*udph), in nf_nat_mangle_udp_packet() 164 udph->len = htons(datalen); in nf_nat_mangle_udp_packet() 167 if (!udph->check && skb->ip_summed != CHECKSUM_PARTIAL) in nf_nat_mangle_udp_packet() 171 udph, &udph->check, datalen, oldlen); in nf_nat_mangle_udp_packet()
|
/kernel/linux/linux-5.10/drivers/infiniband/sw/rxe/ |
H A D | rxe_icrc.c | 16 struct udphdr *udph; in rxe_icrc_hdr() local 38 udph = (struct udphdr *)(ip4h + 1); in rxe_icrc_hdr() 46 udph = (struct udphdr *)(ip6h + 1); in rxe_icrc_hdr() 52 udph->check = CSUM_MANGLED_0; in rxe_icrc_hdr()
|
H A D | rxe_net.c | 155 struct udphdr *udph; in rxe_udp_encap_recv() local 174 udph = udp_hdr(skb); in rxe_udp_encap_recv() 177 pkt->hdr = (u8 *)(udph + 1); in rxe_udp_encap_recv() 179 pkt->paylen = be16_to_cpu(udph->len) - sizeof(*udph); in rxe_udp_encap_recv() 236 struct udphdr *udph; in prepare_udp_hdr() local 238 __skb_push(skb, sizeof(*udph)); in prepare_udp_hdr() 240 udph = udp_hdr(skb); in prepare_udp_hdr() 242 udph->dest = dst_port; in prepare_udp_hdr() 243 udph in prepare_udp_hdr() [all...] |
/kernel/linux/linux-5.10/tools/testing/selftests/bpf/ |
H A D | test_flow_dissector.c | 211 const struct udphdr *udph, in build_udp_v4_csum() 219 pseudo_sum += udph->len; in build_udp_v4_csum() 220 return build_ip_csum((void *) udph, num_words, pseudo_sum); in build_udp_v4_csum() 224 const struct udphdr *udph, in build_udp_v6_csum() 233 return build_ip_csum((void *) udph, num_words, pseudo_sum); in build_udp_v6_csum() 239 struct udphdr *udph = header; in build_udp_header() local 240 int len = sizeof(*udph) + payload_len; in build_udp_header() 242 udph->source = htons(cfg_src_port); in build_udp_header() 243 udph->dest = htons(dport); in build_udp_header() 244 udph in build_udp_header() 210 build_udp_v4_csum(const struct iphdr *iph, const struct udphdr *udph, int num_words) build_udp_v4_csum() argument 223 build_udp_v6_csum(const struct ipv6hdr *ip6h, const struct udphdr *udph, int num_words) build_udp_v6_csum() argument [all...] |
/kernel/linux/linux-6.6/tools/testing/selftests/bpf/ |
H A D | test_flow_dissector.c | 211 const struct udphdr *udph, in build_udp_v4_csum() 219 pseudo_sum += udph->len; in build_udp_v4_csum() 220 return build_ip_csum((void *) udph, num_words, pseudo_sum); in build_udp_v4_csum() 224 const struct udphdr *udph, in build_udp_v6_csum() 233 return build_ip_csum((void *) udph, num_words, pseudo_sum); in build_udp_v6_csum() 239 struct udphdr *udph = header; in build_udp_header() local 240 int len = sizeof(*udph) + payload_len; in build_udp_header() 242 udph->source = htons(cfg_src_port); in build_udp_header() 243 udph->dest = htons(dport); in build_udp_header() 244 udph in build_udp_header() 210 build_udp_v4_csum(const struct iphdr *iph, const struct udphdr *udph, int num_words) build_udp_v4_csum() argument 223 build_udp_v6_csum(const struct ipv6hdr *ip6h, const struct udphdr *udph, int num_words) build_udp_v6_csum() argument [all...] |
/kernel/linux/linux-5.10/net/core/ |
H A D | netpoll.c | 404 struct udphdr *udph; in netpoll_send_udp() local 412 udp_len = len + sizeof(*udph); in netpoll_send_udp() 428 skb_push(skb, sizeof(*udph)); in netpoll_send_udp() 430 udph = udp_hdr(skb); in netpoll_send_udp() 431 udph->source = htons(np->local_port); in netpoll_send_udp() 432 udph->dest = htons(np->remote_port); in netpoll_send_udp() 433 udph->len = htons(udp_len); in netpoll_send_udp() 436 udph->check = 0; in netpoll_send_udp() 437 udph->check = csum_ipv6_magic(&np->local_ip.in6, in netpoll_send_udp() 440 csum_partial(udph, udp_le in netpoll_send_udp() [all...] |
/kernel/linux/linux-6.6/net/core/ |
H A D | netpoll.c | 404 struct udphdr *udph; in netpoll_send_udp() local 413 udp_len = len + sizeof(*udph); in netpoll_send_udp() 429 skb_push(skb, sizeof(*udph)); in netpoll_send_udp() 431 udph = udp_hdr(skb); in netpoll_send_udp() 432 udph->source = htons(np->local_port); in netpoll_send_udp() 433 udph->dest = htons(np->remote_port); in netpoll_send_udp() 434 udph->len = htons(udp_len); in netpoll_send_udp() 437 udph->check = 0; in netpoll_send_udp() 438 udph->check = csum_ipv6_magic(&np->local_ip.in6, in netpoll_send_udp() 441 csum_partial(udph, udp_le in netpoll_send_udp() [all...] |
/kernel/linux/linux-6.6/tools/testing/selftests/bpf/prog_tests/ |
H A D | xdp_metadata.c | 142 struct udphdr *udph; in generate_packet() local 160 udph = (void *)(iph + 1); in generate_packet() 169 iph->tot_len = htons(sizeof(*iph) + sizeof(*udph) + UDP_PAYLOAD_BYTES); in generate_packet() 178 udph->source = htons(AF_XDP_SOURCE_PORT); in generate_packet() 179 udph->dest = htons(dst_port); in generate_packet() 180 udph->len = htons(sizeof(*udph) + UDP_PAYLOAD_BYTES); in generate_packet() 181 udph->check = 0; in generate_packet() 183 memset(udph + 1, 0xAA, UDP_PAYLOAD_BYTES); in generate_packet() 185 tx_desc->len = sizeof(*eth) + sizeof(*iph) + sizeof(*udph) in generate_packet() [all...] |
/kernel/linux/linux-6.6/drivers/infiniband/sw/rxe/ |
H A D | rxe_net.c | 136 struct udphdr *udph; in rxe_udp_encap_recv() local 155 udph = udp_hdr(skb); in rxe_udp_encap_recv() 158 pkt->hdr = (u8 *)(udph + 1); in rxe_udp_encap_recv() 160 pkt->paylen = be16_to_cpu(udph->len) - sizeof(*udph); in rxe_udp_encap_recv() 214 struct udphdr *udph; in prepare_udp_hdr() local 216 __skb_push(skb, sizeof(*udph)); in prepare_udp_hdr() 218 udph = udp_hdr(skb); in prepare_udp_hdr() 220 udph->dest = dst_port; in prepare_udp_hdr() 221 udph in prepare_udp_hdr() [all...] |
H A D | rxe_icrc.c | 77 struct udphdr *udph; in rxe_icrc_hdr() local 99 udph = (struct udphdr *)(ip4h + 1); in rxe_icrc_hdr() 107 udph = (struct udphdr *)(ip6h + 1); in rxe_icrc_hdr() 113 udph->check = CSUM_MANGLED_0; in rxe_icrc_hdr()
|