summaryrefslogtreecommitdiffstats
path: root/net/ipv4
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2006-11-16 02:36:50 -0800
committerDavid S. Miller <davem@sunset.davemloft.net>2006-12-02 21:23:39 -0800
commitf6ab028804bdc580fe0915494dbf31f5ea473ca7 (patch)
tree4bf0fedcfaab7103682bc6209f196104fa9df8fb /net/ipv4
parentb51655b958dfb1176bfcf99466231fdbef8751ff (diff)
downloadlinux-f6ab028804bdc580fe0915494dbf31f5ea473ca7.tar.gz
linux-f6ab028804bdc580fe0915494dbf31f5ea473ca7.tar.bz2
linux-f6ab028804bdc580fe0915494dbf31f5ea473ca7.zip
[NET]: Make mangling a checksum (0 -> 0xffff on the wire) explicit.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
-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
4 files changed, 7 insertions, 7 deletions
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,
ip_vs_check_diff(oldport ^ htons(0xFFFF),
newport, uhdr->check));
if (!uhdr->check)
- uhdr->check = -1;
+ uhdr->check = CSUM_MANGLED_0;
}
static int
@@ -173,7 +173,7 @@ udp_snat_handler(struct sk_buff **pskb,
cp->protocol,
(*pskb)->csum);
if (udph->check == 0)
- udph->check = -1;
+ udph->check = CSUM_MANGLED_0;
IP_VS_DBG(11, "O-pkt: %s O-csum=%d (+%zd)\n",
pp->name, udph->check,
(char*)&(udph->check) - (char*)udph);
@@ -228,7 +228,7 @@ udp_dnat_handler(struct sk_buff **pskb,
cp->protocol,
(*pskb)->csum);
if (udph->check == 0)
- udph->check = -1;
+ udph->check = CSUM_MANGLED_0;
(*pskb)->ip_summed = CHECKSUM_UNNECESSARY;
}
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,
csum_partial((char *)udph,
datalen, 0));
if (!udph->check)
- udph->check = -1;
+ udph->check = CSUM_MANGLED_0;
} else
udph->check = nf_proto_csum_update(*pskb,
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,
*portptr ^ htons(0xFFFF), newport,
hdr->check, 0);
if (!hdr->check)
- hdr->check = -1;
+ hdr->check = CSUM_MANGLED_0;
}
*portptr = newport;
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,
uh->check = csum_tcpudp_magic(src, dst, len, IPPROTO_UDP, csum);
if (uh->check == 0)
- uh->check = -1;
+ uh->check = CSUM_MANGLED_0;
}
}
@@ -490,7 +490,7 @@ int udp_push_pending_frames(struct sock *sk, struct udp_sock *up)
uh->check = csum_tcpudp_magic(fl->fl4_src, fl->fl4_dst, up->len,
sk->sk_protocol, csum );
if (uh->check == 0)
- uh->check = -1;
+ uh->check = CSUM_MANGLED_0;
send:
err = ip_push_pending_frames(sk);