diff options
author | Patrick McHardy <kaber@trash.net> | 2006-08-05 03:58:33 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-09-22 17:53:54 -0400 |
commit | 4cf411de49c65140b3c259748629b561c0d3340f (patch) | |
tree | 71dbc9fbbb0b64e805033665e3653d991abb0f7e /net/netfilter | |
parent | 84fa7933a33f806bbbaae6775e87459b1ec584c0 (diff) |
[NETFILTER]: Get rid of HW checksum invalidation
Update hardware checksums incrementally to avoid breaking GSO.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/netfilter')
-rw-r--r-- | net/netfilter/core.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/net/netfilter/core.c b/net/netfilter/core.c index 5d29d5e2362..27f639f3ac2 100644 --- a/net/netfilter/core.c +++ b/net/netfilter/core.c | |||
@@ -222,6 +222,28 @@ copy_skb: | |||
222 | } | 222 | } |
223 | EXPORT_SYMBOL(skb_make_writable); | 223 | EXPORT_SYMBOL(skb_make_writable); |
224 | 224 | ||
225 | u_int16_t nf_csum_update(u_int32_t oldval, u_int32_t newval, u_int32_t csum) | ||
226 | { | ||
227 | u_int32_t diff[] = { oldval, newval }; | ||
228 | |||
229 | return csum_fold(csum_partial((char *)diff, sizeof(diff), ~csum)); | ||
230 | } | ||
231 | EXPORT_SYMBOL(nf_csum_update); | ||
232 | |||
233 | u_int16_t nf_proto_csum_update(struct sk_buff *skb, | ||
234 | u_int32_t oldval, u_int32_t newval, | ||
235 | u_int16_t csum, int pseudohdr) | ||
236 | { | ||
237 | if (skb->ip_summed != CHECKSUM_PARTIAL) { | ||
238 | csum = nf_csum_update(oldval, newval, csum); | ||
239 | if (skb->ip_summed == CHECKSUM_COMPLETE && pseudohdr) | ||
240 | skb->csum = nf_csum_update(oldval, newval, skb->csum); | ||
241 | } else if (pseudohdr) | ||
242 | csum = ~nf_csum_update(oldval, newval, ~csum); | ||
243 | |||
244 | return csum; | ||
245 | } | ||
246 | EXPORT_SYMBOL(nf_proto_csum_update); | ||
225 | 247 | ||
226 | /* This does not belong here, but locally generated errors need it if connection | 248 | /* This does not belong here, but locally generated errors need it if connection |
227 | tracking in use: without this, connection may not be in hash table, and hence | 249 | tracking in use: without this, connection may not be in hash table, and hence |