Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 41722
b: refs/heads/master
c: f6ab028
h: refs/heads/master
v: v3
  • Loading branch information
Al Viro authored and David S. Miller committed Dec 3, 2006
1 parent e2b3547 commit b22dbef
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b51655b958dfb1176bfcf99466231fdbef8751ff
refs/heads/master: f6ab028804bdc580fe0915494dbf31f5ea473ca7
1 change: 1 addition & 0 deletions trunk/include/net/checksum.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,5 @@ static inline __wsum csum_unfold(__sum16 n)
return (__force __wsum)n;
}

#define CSUM_MANGLED_0 ((__force __sum16)0xffff)
#endif
6 changes: 3 additions & 3 deletions trunk/net/ipv4/ipvs/ip_vs_proto_udp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/ipv4/netfilter/ip_nat_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/ipv4/netfilter/ip_nat_proto_udp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions trunk/net/ipv4/udp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand Down Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions trunk/net/ipv6/raw.c
Original file line number Diff line number Diff line change
Expand Up @@ -536,8 +536,8 @@ static int rawv6_push_pending_frames(struct sock *sk, struct flowi *fl,
&fl->fl6_dst,
total_len, fl->proto, tmp_csum);

if (tmp_csum == 0 && fl->proto == IPPROTO_UDP)
tmp_csum = -1;
if (csum == 0 && fl->proto == IPPROTO_UDP)
csum = CSUM_MANGLED_0;

if (skb_store_bits(skb, offset, &csum, 2))
BUG();
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/ipv6/udp.c
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ static int udp_v6_push_pending_frames(struct sock *sk, struct udp_sock *up)
uh->check = csum_ipv6_magic(&fl->fl6_src, &fl->fl6_dst,
up->len, fl->proto, csum );
if (uh->check == 0)
uh->check = -1;
uh->check = CSUM_MANGLED_0;

err = ip6_push_pending_frames(sk);
out:
Expand Down

0 comments on commit b22dbef

Please sign in to comment.