/linux-4.1.27/net/netfilter/ipvs/ |
D | ip_vs_proto_udp.c | 130 struct udphdr *udph; in udp_snat_handler() local 142 if (!skb_make_writable(skb, udphoff+sizeof(*udph))) in udp_snat_handler() 164 udph = (void *)skb_network_header(skb) + udphoff; in udp_snat_handler() 165 udph->source = cp->vport; in udp_snat_handler() 171 udp_partial_csum_update(cp->af, udph, &cp->daddr, &cp->vaddr, in udp_snat_handler() 174 } else if (!payload_csum && (udph->check != 0)) { in udp_snat_handler() 176 udp_fast_csum_update(cp->af, udph, &cp->daddr, &cp->vaddr, in udp_snat_handler() 183 udph->check = 0; in udp_snat_handler() 187 udph->check = csum_ipv6_magic(&cp->vaddr.in6, in udp_snat_handler() 193 udph->check = csum_tcpudp_magic(cp->vaddr.ip, in udp_snat_handler() [all …]
|
/linux-4.1.27/net/sched/ |
D | act_csum.c | 219 struct udphdr *udph; in tcf_csum_ipv4_udp() local 230 udph = tcf_csum_skb_nextlayer(skb, ihl, ipl, sizeof(*udph)); in tcf_csum_ipv4_udp() 231 if (udph == NULL) in tcf_csum_ipv4_udp() 235 ul = ntohs(udph->len); in tcf_csum_ipv4_udp() 237 if (udplite || udph->check) { in tcf_csum_ipv4_udp() 239 udph->check = 0; in tcf_csum_ipv4_udp() 243 skb->csum = csum_partial(udph, ipl - ihl, 0); in tcf_csum_ipv4_udp() 244 else if ((ul >= sizeof(*udph)) && (ul <= ipl - ihl)) in tcf_csum_ipv4_udp() 245 skb->csum = csum_partial(udph, ul, 0); in tcf_csum_ipv4_udp() 252 skb->csum = csum_partial(udph, ul, 0); in tcf_csum_ipv4_udp() [all …]
|
D | act_nat.c | 169 struct udphdr *udph; in tcf_nat() local 171 if (!pskb_may_pull(skb, ihl + sizeof(*udph) + noff) || in tcf_nat() 173 !skb_clone_writable(skb, ihl + sizeof(*udph) + noff) && in tcf_nat() 177 udph = (void *)(skb_network_header(skb) + ihl); in tcf_nat() 178 if (udph->check || skb->ip_summed == CHECKSUM_PARTIAL) { in tcf_nat() 179 inet_proto_csum_replace4(&udph->check, skb, addr, in tcf_nat() 181 if (!udph->check) in tcf_nat() 182 udph->check = CSUM_MANGLED_0; in tcf_nat()
|
/linux-4.1.27/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.1.27/net/core/ |
D | netpoll.c | 377 struct udphdr *udph; in netpoll_send_udp() local 383 udp_len = len + sizeof(*udph); in netpoll_send_udp() 399 skb_push(skb, sizeof(*udph)); in netpoll_send_udp() 401 udph = udp_hdr(skb); in netpoll_send_udp() 402 udph->source = htons(np->local_port); in netpoll_send_udp() 403 udph->dest = htons(np->remote_port); in netpoll_send_udp() 404 udph->len = htons(udp_len); in netpoll_send_udp() 407 udph->check = 0; in netpoll_send_udp() 408 udph->check = csum_ipv6_magic(&np->local_ip.in6, in netpoll_send_udp() 411 csum_partial(udph, udp_len, 0)); in netpoll_send_udp() [all …]
|
D | pktgen.c | 2751 struct udphdr *udph; in fill_packet_ipv4() local 2813 udph = (struct udphdr *) skb_put(skb, sizeof(struct udphdr)); in fill_packet_ipv4() 2826 udph->source = htons(pkt_dev->cur_udp_src); in fill_packet_ipv4() 2827 udph->dest = htons(pkt_dev->cur_udp_dst); in fill_packet_ipv4() 2828 udph->len = htons(datalen + 8); /* DATA + udphdr */ in fill_packet_ipv4() 2829 udph->check = 0; in fill_packet_ipv4() 2860 udph->check = csum_tcpudp_magic(iph->saddr, iph->daddr, in fill_packet_ipv4() 2863 if (udph->check == 0) in fill_packet_ipv4() 2864 udph->check = CSUM_MANGLED_0; in fill_packet_ipv4() 2880 struct udphdr *udph; in fill_packet_ipv6() local [all …]
|
/linux-4.1.27/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.1.27/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.1.27/net/ipv4/ |
D | ipconfig.c | 617 struct udphdr udph; /* UDP header */ member 824 b->udph.source = htons(68); in ic_bootp_send_if() 825 b->udph.dest = htons(67); in ic_bootp_send_if() 826 b->udph.len = htons(sizeof(struct bootp_pkt) - sizeof(struct iphdr)); in ic_bootp_send_if() 989 if (b->udph.source != htons(67) || b->udph.dest != htons(68)) in ic_bootp_recv() 992 if (ntohs(h->tot_len) < ntohs(b->udph.len) + sizeof(struct iphdr)) in ic_bootp_recv() 995 len = ntohs(b->udph.len) - sizeof(struct udphdr); in ic_bootp_recv()
|