diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2006-11-20 21:07:29 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-12-03 00:27:18 -0500 |
commit | ff1dcadb1b55dbf471c5ed109dbbdf06bd19ef3b (patch) | |
tree | cbcd17d33ecc52c90d218b43c5aec430be448058 /net | |
parent | 5b14027bf2132c0631ea9f3be11ced89a5057220 (diff) |
[NET]: Split skb->csum
... into anonymous union of __wsum and __u32 (csum and csum_offset resp.)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/core/dev.c | 4 | ||||
-rw-r--r-- | net/core/skbuff.c | 2 | ||||
-rw-r--r-- | net/ipv4/tcp_ipv4.c | 4 | ||||
-rw-r--r-- | net/ipv4/udp.c | 2 | ||||
-rw-r--r-- | net/ipv6/tcp_ipv6.c | 4 |
5 files changed, 8 insertions, 8 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index 1a36b17f4b51..59d058a3b504 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -1191,9 +1191,9 @@ int skb_checksum_help(struct sk_buff *skb) | |||
1191 | 1191 | ||
1192 | offset = skb->tail - skb->h.raw; | 1192 | offset = skb->tail - skb->h.raw; |
1193 | BUG_ON(offset <= 0); | 1193 | BUG_ON(offset <= 0); |
1194 | BUG_ON(skb->csum + 2 > offset); | 1194 | BUG_ON(skb->csum_offset + 2 > offset); |
1195 | 1195 | ||
1196 | *(__sum16*)(skb->h.raw + skb->csum) = csum_fold(csum); | 1196 | *(__sum16*)(skb->h.raw + skb->csum_offset) = csum_fold(csum); |
1197 | 1197 | ||
1198 | out_set_summed: | 1198 | out_set_summed: |
1199 | skb->ip_summed = CHECKSUM_NONE; | 1199 | skb->ip_summed = CHECKSUM_NONE; |
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 07c25d601922..a90bc439488e 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c | |||
@@ -1414,7 +1414,7 @@ void skb_copy_and_csum_dev(const struct sk_buff *skb, u8 *to) | |||
1414 | skb->len - csstart, 0); | 1414 | skb->len - csstart, 0); |
1415 | 1415 | ||
1416 | if (skb->ip_summed == CHECKSUM_PARTIAL) { | 1416 | if (skb->ip_summed == CHECKSUM_PARTIAL) { |
1417 | long csstuff = csstart + skb->csum; | 1417 | long csstuff = csstart + skb->csum_offset; |
1418 | 1418 | ||
1419 | *((__sum16 *)(to + csstuff)) = csum_fold(csum); | 1419 | *((__sum16 *)(to + csstuff)) = csum_fold(csum); |
1420 | } | 1420 | } |
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index e9d467124c4d..4913f25e5ad5 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c | |||
@@ -504,7 +504,7 @@ void tcp_v4_send_check(struct sock *sk, int len, struct sk_buff *skb) | |||
504 | if (skb->ip_summed == CHECKSUM_PARTIAL) { | 504 | if (skb->ip_summed == CHECKSUM_PARTIAL) { |
505 | th->check = ~tcp_v4_check(th, len, | 505 | th->check = ~tcp_v4_check(th, len, |
506 | inet->saddr, inet->daddr, 0); | 506 | inet->saddr, inet->daddr, 0); |
507 | skb->csum = offsetof(struct tcphdr, check); | 507 | skb->csum_offset = offsetof(struct tcphdr, check); |
508 | } else { | 508 | } else { |
509 | th->check = tcp_v4_check(th, len, inet->saddr, inet->daddr, | 509 | th->check = tcp_v4_check(th, len, inet->saddr, inet->daddr, |
510 | csum_partial((char *)th, | 510 | csum_partial((char *)th, |
@@ -526,7 +526,7 @@ int tcp_v4_gso_send_check(struct sk_buff *skb) | |||
526 | 526 | ||
527 | th->check = 0; | 527 | th->check = 0; |
528 | th->check = ~tcp_v4_check(th, skb->len, iph->saddr, iph->daddr, 0); | 528 | th->check = ~tcp_v4_check(th, skb->len, iph->saddr, iph->daddr, 0); |
529 | skb->csum = offsetof(struct tcphdr, check); | 529 | skb->csum_offset = offsetof(struct tcphdr, check); |
530 | skb->ip_summed = CHECKSUM_PARTIAL; | 530 | skb->ip_summed = CHECKSUM_PARTIAL; |
531 | return 0; | 531 | return 0; |
532 | } | 532 | } |
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 28e4cf662ce0..1807a30694d9 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c | |||
@@ -422,7 +422,7 @@ static void udp4_hwcsum_outgoing(struct sock *sk, struct sk_buff *skb, | |||
422 | /* | 422 | /* |
423 | * Only one fragment on the socket. | 423 | * Only one fragment on the socket. |
424 | */ | 424 | */ |
425 | skb->csum = offsetof(struct udphdr, check); | 425 | skb->csum_offset = offsetof(struct udphdr, check); |
426 | uh->check = ~csum_tcpudp_magic(src, dst, len, IPPROTO_UDP, 0); | 426 | uh->check = ~csum_tcpudp_magic(src, dst, len, IPPROTO_UDP, 0); |
427 | } else { | 427 | } else { |
428 | /* | 428 | /* |
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index 0adb337c4b7e..517c50024bfc 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c | |||
@@ -948,7 +948,7 @@ static void tcp_v6_send_check(struct sock *sk, int len, struct sk_buff *skb) | |||
948 | 948 | ||
949 | if (skb->ip_summed == CHECKSUM_PARTIAL) { | 949 | if (skb->ip_summed == CHECKSUM_PARTIAL) { |
950 | th->check = ~csum_ipv6_magic(&np->saddr, &np->daddr, len, IPPROTO_TCP, 0); | 950 | th->check = ~csum_ipv6_magic(&np->saddr, &np->daddr, len, IPPROTO_TCP, 0); |
951 | skb->csum = offsetof(struct tcphdr, check); | 951 | skb->csum_offset = offsetof(struct tcphdr, check); |
952 | } else { | 952 | } else { |
953 | th->check = csum_ipv6_magic(&np->saddr, &np->daddr, len, IPPROTO_TCP, | 953 | th->check = csum_ipv6_magic(&np->saddr, &np->daddr, len, IPPROTO_TCP, |
954 | csum_partial((char *)th, th->doff<<2, | 954 | csum_partial((char *)th, th->doff<<2, |
@@ -970,7 +970,7 @@ static int tcp_v6_gso_send_check(struct sk_buff *skb) | |||
970 | th->check = 0; | 970 | th->check = 0; |
971 | th->check = ~csum_ipv6_magic(&ipv6h->saddr, &ipv6h->daddr, skb->len, | 971 | th->check = ~csum_ipv6_magic(&ipv6h->saddr, &ipv6h->daddr, skb->len, |
972 | IPPROTO_TCP, 0); | 972 | IPPROTO_TCP, 0); |
973 | skb->csum = offsetof(struct tcphdr, check); | 973 | skb->csum_offset = offsetof(struct tcphdr, check); |
974 | skb->ip_summed = CHECKSUM_PARTIAL; | 974 | skb->ip_summed = CHECKSUM_PARTIAL; |
975 | return 0; | 975 | return 0; |
976 | } | 976 | } |