return (__force __wsum)n;
}
+#define CSUM_MANGLED_0 ((__force __sum16)0xffff)
#endif
ip_vs_check_diff(oldport ^ htons(0xFFFF),
newport, uhdr->check));
if (!uhdr->check)
- uhdr->check = -1;
+ uhdr->check = CSUM_MANGLED_0;
}
static int
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);
cp->protocol,
(*pskb)->csum);
if (udph->check == 0)
- udph->check = -1;
+ udph->check = CSUM_MANGLED_0;
(*pskb)->ip_summed = CHECKSUM_UNNECESSARY;
}
return 1;
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),
*portptr ^ htons(0xFFFF), newport,
hdr->check, 0);
if (!hdr->check)
- hdr->check = -1;
+ hdr->check = CSUM_MANGLED_0;
}
*portptr = newport;
return 1;
uh->check = csum_tcpudp_magic(src, dst, len, IPPROTO_UDP, csum);
if (uh->check == 0)
- uh->check = -1;
+ uh->check = CSUM_MANGLED_0;
}
}
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);
&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();
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: