diff options
author | Patrick McHardy <kaber@trash.net> | 2006-08-29 19:44:56 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-09-22 17:53:53 -0400 |
commit | 84fa7933a33f806bbbaae6775e87459b1ec584c0 (patch) | |
tree | 5be404225d90f640997b12f631e9b496b3fd0d61 /net/ipv4/udp.c | |
parent | 8584d6df39db5601965f9bc5e3bf2fea833ad7bb (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/ipv4/udp.c')
-rw-r--r-- | net/ipv4/udp.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index a4d005eccc7f..87152510980c 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c | |||
@@ -429,7 +429,7 @@ static int udp_push_pending_frames(struct sock *sk, struct udp_sock *up) | |||
429 | /* | 429 | /* |
430 | * Only one fragment on the socket. | 430 | * Only one fragment on the socket. |
431 | */ | 431 | */ |
432 | if (skb->ip_summed == CHECKSUM_HW) { | 432 | if (skb->ip_summed == CHECKSUM_PARTIAL) { |
433 | skb->csum = offsetof(struct udphdr, check); | 433 | skb->csum = offsetof(struct udphdr, check); |
434 | uh->check = ~csum_tcpudp_magic(fl->fl4_src, fl->fl4_dst, | 434 | uh->check = ~csum_tcpudp_magic(fl->fl4_src, fl->fl4_dst, |
435 | up->len, IPPROTO_UDP, 0); | 435 | up->len, IPPROTO_UDP, 0); |
@@ -448,7 +448,7 @@ static int udp_push_pending_frames(struct sock *sk, struct udp_sock *up) | |||
448 | * fragments on the socket so that all csums of sk_buffs | 448 | * fragments on the socket so that all csums of sk_buffs |
449 | * should be together. | 449 | * should be together. |
450 | */ | 450 | */ |
451 | if (skb->ip_summed == CHECKSUM_HW) { | 451 | if (skb->ip_summed == CHECKSUM_PARTIAL) { |
452 | int offset = (unsigned char *)uh - skb->data; | 452 | int offset = (unsigned char *)uh - skb->data; |
453 | skb->csum = skb_checksum(skb, offset, skb->len - offset, 0); | 453 | skb->csum = skb_checksum(skb, offset, skb->len - offset, 0); |
454 | 454 | ||
@@ -1088,7 +1088,7 @@ static void udp_checksum_init(struct sk_buff *skb, struct udphdr *uh, | |||
1088 | { | 1088 | { |
1089 | if (uh->check == 0) { | 1089 | if (uh->check == 0) { |
1090 | skb->ip_summed = CHECKSUM_UNNECESSARY; | 1090 | skb->ip_summed = CHECKSUM_UNNECESSARY; |
1091 | } else if (skb->ip_summed == CHECKSUM_HW) { | 1091 | } else if (skb->ip_summed == CHECKSUM_COMPLETE) { |
1092 | if (!udp_check(uh, ulen, saddr, daddr, skb->csum)) | 1092 | if (!udp_check(uh, ulen, saddr, daddr, skb->csum)) |
1093 | skb->ip_summed = CHECKSUM_UNNECESSARY; | 1093 | skb->ip_summed = CHECKSUM_UNNECESSARY; |
1094 | } | 1094 | } |