aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/net/checksum.h1
-rw-r--r--net/ipv4/ipvs/ip_vs_proto_udp.c6
-rw-r--r--net/ipv4/netfilter/ip_nat_helper.c2
-rw-r--r--net/ipv4/netfilter/ip_nat_proto_udp.c2
-rw-r--r--net/ipv4/udp.c4
-rw-r--r--net/ipv6/raw.c4
-rw-r--r--net/ipv6/udp.c2
7 files changed, 11 insertions, 10 deletions
diff --git a/include/net/checksum.h b/include/net/checksum.h
index 2b3c8dc6c11d..124246172a88 100644
--- a/include/net/checksum.h
+++ b/include/net/checksum.h
@@ -92,4 +92,5 @@ static inline __wsum csum_unfold(__sum16 n)
92 return (__force __wsum)n; 92 return (__force __wsum)n;
93} 93}
94 94
95#define CSUM_MANGLED_0 ((__force __sum16)0xffff)
95#endif 96#endif
diff --git a/net/ipv4/ipvs/ip_vs_proto_udp.c b/net/ipv4/ipvs/ip_vs_proto_udp.c
index 261581e6a814..3647397e416d 100644
--- a/net/ipv4/ipvs/ip_vs_proto_udp.c
+++ b/net/ipv4/ipvs/ip_vs_proto_udp.c
@@ -125,7 +125,7 @@ udp_fast_csum_update(struct udphdr *uhdr, __be32 oldip, __be32 newip,
125 ip_vs_check_diff(oldport ^ htons(0xFFFF), 125 ip_vs_check_diff(oldport ^ htons(0xFFFF),
126 newport, uhdr->check)); 126 newport, uhdr->check));
127 if (!uhdr->check) 127 if (!uhdr->check)
128 uhdr->check = -1; 128 uhdr->check = CSUM_MANGLED_0;
129} 129}
130 130
131static int 131static int
@@ -173,7 +173,7 @@ udp_snat_handler(struct sk_buff **pskb,
173 cp->protocol, 173 cp->protocol,
174 (*pskb)->csum); 174 (*pskb)->csum);
175 if (udph->check == 0) 175 if (udph->check == 0)
176 udph->check = -1; 176 udph->check = CSUM_MANGLED_0;
177 IP_VS_DBG(11, "O-pkt: %s O-csum=%d (+%zd)\n", 177 IP_VS_DBG(11, "O-pkt: %s O-csum=%d (+%zd)\n",
178 pp->name, udph->check, 178 pp->name, udph->check,
179 (char*)&(udph->check) - (char*)udph); 179 (char*)&(udph->check) - (char*)udph);
@@ -228,7 +228,7 @@ udp_dnat_handler(struct sk_buff **pskb,
228 cp->protocol, 228 cp->protocol,
229 (*pskb)->csum); 229 (*pskb)->csum);
230 if (udph->check == 0) 230 if (udph->check == 0)
231 udph->check = -1; 231 udph->check = CSUM_MANGLED_0;
232 (*pskb)->ip_summed = CHECKSUM_UNNECESSARY; 232 (*pskb)->ip_summed = CHECKSUM_UNNECESSARY;
233 } 233 }
234 return 1; 234 return 1;
diff --git a/net/ipv4/netfilter/ip_nat_helper.c b/net/ipv4/netfilter/ip_nat_helper.c
index 3bf858480558..3e7fd64c2162 100644
--- a/net/ipv4/netfilter/ip_nat_helper.c
+++ b/net/ipv4/netfilter/ip_nat_helper.c
@@ -264,7 +264,7 @@ ip_nat_mangle_udp_packet(struct sk_buff **pskb,
264 csum_partial((char *)udph, 264 csum_partial((char *)udph,
265 datalen, 0)); 265 datalen, 0));
266 if (!udph->check) 266 if (!udph->check)
267 udph->check = -1; 267 udph->check = CSUM_MANGLED_0;
268 } else 268 } else
269 udph->check = nf_proto_csum_update(*pskb, 269 udph->check = nf_proto_csum_update(*pskb,
270 htons(oldlen) ^ htons(0xFFFF), 270 htons(oldlen) ^ htons(0xFFFF),
diff --git a/net/ipv4/netfilter/ip_nat_proto_udp.c b/net/ipv4/netfilter/ip_nat_proto_udp.c
index 4bbec7730d18..82f8a6ab07ec 100644
--- a/net/ipv4/netfilter/ip_nat_proto_udp.c
+++ b/net/ipv4/netfilter/ip_nat_proto_udp.c
@@ -121,7 +121,7 @@ udp_manip_pkt(struct sk_buff **pskb,
121 *portptr ^ htons(0xFFFF), newport, 121 *portptr ^ htons(0xFFFF), newport,
122 hdr->check, 0); 122 hdr->check, 0);
123 if (!hdr->check) 123 if (!hdr->check)
124 hdr->check = -1; 124 hdr->check = CSUM_MANGLED_0;
125 } 125 }
126 *portptr = newport; 126 *portptr = newport;
127 return 1; 127 return 1;
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index f9c4ed7207bb..dc19ba1e73b5 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -441,7 +441,7 @@ static void udp4_hwcsum_outgoing(struct sock *sk, struct sk_buff *skb,
441 441
442 uh->check = csum_tcpudp_magic(src, dst, len, IPPROTO_UDP, csum); 442 uh->check = csum_tcpudp_magic(src, dst, len, IPPROTO_UDP, csum);
443 if (uh->check == 0) 443 if (uh->check == 0)
444 uh->check = -1; 444 uh->check = CSUM_MANGLED_0;
445 } 445 }
446} 446}
447 447
@@ -490,7 +490,7 @@ int udp_push_pending_frames(struct sock *sk, struct udp_sock *up)
490 uh->check = csum_tcpudp_magic(fl->fl4_src, fl->fl4_dst, up->len, 490 uh->check = csum_tcpudp_magic(fl->fl4_src, fl->fl4_dst, up->len,
491 sk->sk_protocol, csum ); 491 sk->sk_protocol, csum );
492 if (uh->check == 0) 492 if (uh->check == 0)
493 uh->check = -1; 493 uh->check = CSUM_MANGLED_0;
494 494
495send: 495send:
496 err = ip_push_pending_frames(sk); 496 err = ip_push_pending_frames(sk);
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c
index 9b21d67ca48c..c2e629d6aea4 100644
--- a/net/ipv6/raw.c
+++ b/net/ipv6/raw.c
@@ -536,8 +536,8 @@ static int rawv6_push_pending_frames(struct sock *sk, struct flowi *fl,
536 &fl->fl6_dst, 536 &fl->fl6_dst,
537 total_len, fl->proto, tmp_csum); 537 total_len, fl->proto, tmp_csum);
538 538
539 if (tmp_csum == 0 && fl->proto == IPPROTO_UDP) 539 if (csum == 0 && fl->proto == IPPROTO_UDP)
540 tmp_csum = -1; 540 csum = CSUM_MANGLED_0;
541 541
542 if (skb_store_bits(skb, offset, &csum, 2)) 542 if (skb_store_bits(skb, offset, &csum, 2))
543 BUG(); 543 BUG();
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index 0d22008d522e..bb45b9b7cbd9 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -536,7 +536,7 @@ static int udp_v6_push_pending_frames(struct sock *sk, struct udp_sock *up)
536 uh->check = csum_ipv6_magic(&fl->fl6_src, &fl->fl6_dst, 536 uh->check = csum_ipv6_magic(&fl->fl6_src, &fl->fl6_dst,
537 up->len, fl->proto, csum ); 537 up->len, fl->proto, csum );
538 if (uh->check == 0) 538 if (uh->check == 0)
539 uh->check = -1; 539 uh->check = CSUM_MANGLED_0;
540 540
541 err = ip6_push_pending_frames(sk); 541 err = ip6_push_pending_frames(sk);
542out: 542out: