aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/skbuff.c
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2006-08-29 19:44:56 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2006-09-22 17:53:53 -0400
commit84fa7933a33f806bbbaae6775e87459b1ec584c0 (patch)
tree5be404225d90f640997b12f631e9b496b3fd0d61 /net/core/skbuff.c
parent8584d6df39db5601965f9bc5e3bf2fea833ad7bb (diff)
[NET]: Replace CHECKSUM_HW by CHECKSUM_PARTIAL/CHECKSUM_COMPLETE
Replace CHECKSUM_HW by CHECKSUM_PARTIAL (for outgoing packets, whose checksum still needs to be completed) and CHECKSUM_COMPLETE (for incoming packets, device supplied full checksum). Patch originally from Herbert Xu, updated by myself for 2.6.18-rc3. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/skbuff.c')
-rw-r--r--net/core/skbuff.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index c54f3664bce5..8a476f1956e5 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -1397,7 +1397,7 @@ void skb_copy_and_csum_dev(const struct sk_buff *skb, u8 *to)
1397 unsigned int csum; 1397 unsigned int csum;
1398 long csstart; 1398 long csstart;
1399 1399
1400 if (skb->ip_summed == CHECKSUM_HW) 1400 if (skb->ip_summed == CHECKSUM_PARTIAL)
1401 csstart = skb->h.raw - skb->data; 1401 csstart = skb->h.raw - skb->data;
1402 else 1402 else
1403 csstart = skb_headlen(skb); 1403 csstart = skb_headlen(skb);
@@ -1411,7 +1411,7 @@ void skb_copy_and_csum_dev(const struct sk_buff *skb, u8 *to)
1411 csum = skb_copy_and_csum_bits(skb, csstart, to + csstart, 1411 csum = skb_copy_and_csum_bits(skb, csstart, to + csstart,
1412 skb->len - csstart, 0); 1412 skb->len - csstart, 0);
1413 1413
1414 if (skb->ip_summed == CHECKSUM_HW) { 1414 if (skb->ip_summed == CHECKSUM_PARTIAL) {
1415 long csstuff = csstart + skb->csum; 1415 long csstuff = csstart + skb->csum;
1416 1416
1417 *((unsigned short *)(to + csstuff)) = csum_fold(csum); 1417 *((unsigned short *)(to + csstuff)) = csum_fold(csum);
@@ -1898,10 +1898,10 @@ int skb_append_datato_frags(struct sock *sk, struct sk_buff *skb,
1898 * @len: length of data pulled 1898 * @len: length of data pulled
1899 * 1899 *
1900 * This function performs an skb_pull on the packet and updates 1900 * This function performs an skb_pull on the packet and updates
1901 * update the CHECKSUM_HW checksum. It should be used on receive 1901 * update the CHECKSUM_COMPLETE checksum. It should be used on
1902 * path processing instead of skb_pull unless you know that the 1902 * receive path processing instead of skb_pull unless you know
1903 * checksum difference is zero (e.g., a valid IP header) or you 1903 * that the checksum difference is zero (e.g., a valid IP header)
1904 * are setting ip_summed to CHECKSUM_NONE. 1904 * or you are setting ip_summed to CHECKSUM_NONE.
1905 */ 1905 */
1906unsigned char *skb_pull_rcsum(struct sk_buff *skb, unsigned int len) 1906unsigned char *skb_pull_rcsum(struct sk_buff *skb, unsigned int len)
1907{ 1907{
@@ -1994,7 +1994,7 @@ struct sk_buff *skb_segment(struct sk_buff *skb, int features)
1994 frag = skb_shinfo(nskb)->frags; 1994 frag = skb_shinfo(nskb)->frags;
1995 k = 0; 1995 k = 0;
1996 1996
1997 nskb->ip_summed = CHECKSUM_HW; 1997 nskb->ip_summed = CHECKSUM_PARTIAL;
1998 nskb->csum = skb->csum; 1998 nskb->csum = skb->csum;
1999 memcpy(skb_put(nskb, hsize), skb->data + offset, hsize); 1999 memcpy(skb_put(nskb, hsize), skb->data + offset, hsize);
2000 2000