/linux-4.4.14/net/netfilter/ipvs/ |
D | ip_vs_proto_udp.c | 144 struct udphdr *udph; in udp_snat_handler() local 156 if (!skb_make_writable(skb, udphoff+sizeof(*udph))) in udp_snat_handler() 178 udph = (void *)skb_network_header(skb) + udphoff; in udp_snat_handler() 179 udph->source = cp->vport; in udp_snat_handler() 185 udp_partial_csum_update(cp->af, udph, &cp->daddr, &cp->vaddr, in udp_snat_handler() 188 } else if (!payload_csum && (udph->check != 0)) { in udp_snat_handler() 190 udp_fast_csum_update(cp->af, udph, &cp->daddr, &cp->vaddr, in udp_snat_handler() 197 udph->check = 0; in udp_snat_handler() 201 udph->check = csum_ipv6_magic(&cp->vaddr.in6, in udp_snat_handler() 207 udph->check = csum_tcpudp_magic(cp->vaddr.ip, in udp_snat_handler() [all …]
|
/linux-4.4.14/net/sched/ |
D | act_csum.c | 220 struct udphdr *udph; in tcf_csum_ipv4_udp() local 231 udph = tcf_csum_skb_nextlayer(skb, ihl, ipl, sizeof(*udph)); in tcf_csum_ipv4_udp() 232 if (udph == NULL) in tcf_csum_ipv4_udp() 236 ul = ntohs(udph->len); in tcf_csum_ipv4_udp() 238 if (udplite || udph->check) { in tcf_csum_ipv4_udp() 240 udph->check = 0; in tcf_csum_ipv4_udp() 244 skb->csum = csum_partial(udph, ipl - ihl, 0); in tcf_csum_ipv4_udp() 245 else if ((ul >= sizeof(*udph)) && (ul <= ipl - ihl)) in tcf_csum_ipv4_udp() 246 skb->csum = csum_partial(udph, ul, 0); in tcf_csum_ipv4_udp() 253 skb->csum = csum_partial(udph, ul, 0); in tcf_csum_ipv4_udp() [all …]
|
D | act_nat.c | 171 struct udphdr *udph; in tcf_nat() local 173 if (!pskb_may_pull(skb, ihl + sizeof(*udph) + noff) || in tcf_nat() 175 !skb_clone_writable(skb, ihl + sizeof(*udph) + noff) && in tcf_nat() 179 udph = (void *)(skb_network_header(skb) + ihl); in tcf_nat() 180 if (udph->check || skb->ip_summed == CHECKSUM_PARTIAL) { in tcf_nat() 181 inet_proto_csum_replace4(&udph->check, skb, addr, in tcf_nat() 183 if (!udph->check) in tcf_nat() 184 udph->check = CSUM_MANGLED_0; in tcf_nat()
|
/linux-4.4.14/net/netfilter/ |
D | nf_nat_helper.c | 156 struct udphdr *udph; in nf_nat_mangle_udp_packet() local 167 udph = (void *)skb->data + protoff; in nf_nat_mangle_udp_packet() 170 mangle_contents(skb, protoff + sizeof(*udph), in nf_nat_mangle_udp_packet() 175 udph->len = htons(datalen); in nf_nat_mangle_udp_packet() 178 if (!udph->check && skb->ip_summed != CHECKSUM_PARTIAL) in nf_nat_mangle_udp_packet() 182 l3proto->csum_recalc(skb, IPPROTO_UDP, udph, &udph->check, in nf_nat_mangle_udp_packet()
|
/linux-4.4.14/net/core/ |
D | netpoll.c | 382 struct udphdr *udph; in netpoll_send_udp() local 390 udp_len = len + sizeof(*udph); in netpoll_send_udp() 406 skb_push(skb, sizeof(*udph)); in netpoll_send_udp() 408 udph = udp_hdr(skb); in netpoll_send_udp() 409 udph->source = htons(np->local_port); in netpoll_send_udp() 410 udph->dest = htons(np->remote_port); in netpoll_send_udp() 411 udph->len = htons(udp_len); in netpoll_send_udp() 414 udph->check = 0; in netpoll_send_udp() 415 udph->check = csum_ipv6_magic(&np->local_ip.in6, in netpoll_send_udp() 418 csum_partial(udph, udp_len, 0)); in netpoll_send_udp() [all …]
|
D | pktgen.c | 2802 struct udphdr *udph; in fill_packet_ipv4() local 2864 udph = (struct udphdr *) skb_put(skb, sizeof(struct udphdr)); in fill_packet_ipv4() 2877 udph->source = htons(pkt_dev->cur_udp_src); in fill_packet_ipv4() 2878 udph->dest = htons(pkt_dev->cur_udp_dst); in fill_packet_ipv4() 2879 udph->len = htons(datalen + 8); /* DATA + udphdr */ in fill_packet_ipv4() 2880 udph->check = 0; in fill_packet_ipv4() 2911 udph->check = csum_tcpudp_magic(iph->saddr, iph->daddr, in fill_packet_ipv4() 2914 if (udph->check == 0) in fill_packet_ipv4() 2915 udph->check = CSUM_MANGLED_0; in fill_packet_ipv4() 2931 struct udphdr *udph; in fill_packet_ipv6() local [all …]
|
/linux-4.4.14/Documentation/networking/timestamping/ |
D | txtimestamp.c | 337 struct udphdr *udph; in do_test() local 354 udph = (void *) buf + off; in do_test() 355 udph->source = ntohs(9000); /* random spoof */ in do_test() 356 udph->dest = ntohs(dest_port); in do_test() 357 udph->len = ntohs(sizeof(*udph) + cfg_payload_len); in do_test() 358 udph->check = 0; /* not allowed for IPv6 */ in do_test()
|
/linux-4.4.14/net/ipv4/netfilter/ |
D | nf_nat_snmp_basic.c | 1185 struct udphdr *udph = (struct udphdr *)((__be32 *)iph + iph->ihl); in snmp_translate() local 1186 u_int16_t udplen = ntohs(udph->len); in snmp_translate() 1208 if (!snmp_parse_mangle((unsigned char *)udph + sizeof(struct udphdr), in snmp_translate() 1209 paylen, &map, &udph->check)) { in snmp_translate() 1225 const struct udphdr *udph = (struct udphdr *)((__be32 *)iph + iph->ihl); in help() local 1228 if (udph->source == htons(SNMP_PORT) && dir != IP_CT_DIR_REPLY) in help() 1230 if (udph->dest == htons(SNMP_TRAP_PORT) && dir != IP_CT_DIR_ORIGINAL) in help() 1243 if (ntohs(udph->len) != skb->len - (iph->ihl << 2)) { in help()
|
/linux-4.4.14/net/ipv4/ |
D | ipconfig.c | 621 struct udphdr udph; /* UDP header */ member 838 b->udph.source = htons(68); in ic_bootp_send_if() 839 b->udph.dest = htons(67); in ic_bootp_send_if() 840 b->udph.len = htons(sizeof(struct bootp_pkt) - sizeof(struct iphdr)); in ic_bootp_send_if() 1003 if (b->udph.source != htons(67) || b->udph.dest != htons(68)) in ic_bootp_recv() 1006 if (ntohs(h->tot_len) < ntohs(b->udph.len) + sizeof(struct iphdr)) in ic_bootp_recv() 1009 len = ntohs(b->udph.len) - sizeof(struct udphdr); in ic_bootp_recv()
|