Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 214908
b: refs/heads/master
c: 13f5bf1
h: refs/heads/master
v: v3
  • Loading branch information
David S. Miller committed Oct 5, 2010
1 parent ffa707b commit 2d976c2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 24824a09e35402b8d58dcc5be803a5ad3937bdba
refs/heads/master: 13f5bf18ba657d2d17c8fcf584e50359c718dd4b
19 changes: 10 additions & 9 deletions trunk/net/netfilter/ipvs/ip_vs_proto_sctp.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ sctp_snat_handler(struct sk_buff *skb,
{
sctp_sctphdr_t *sctph;
unsigned int sctphoff;
struct sk_buff *iter;
__be32 crc32;

#ifdef CONFIG_IP_VS_IPV6
Expand Down Expand Up @@ -89,8 +90,8 @@ sctp_snat_handler(struct sk_buff *skb,

/* Calculate the checksum */
crc32 = sctp_start_cksum((u8 *) sctph, skb_headlen(skb) - sctphoff);
for (skb = skb_shinfo(skb)->frag_list; skb; skb = skb->next)
crc32 = sctp_update_cksum((u8 *) skb->data, skb_headlen(skb),
skb_walk_frags(skb, iter)
crc32 = sctp_update_cksum((u8 *) iter->data, skb_headlen(iter),
crc32);
crc32 = sctp_end_cksum(crc32);
sctph->checksum = crc32;
Expand All @@ -102,9 +103,9 @@ static int
sctp_dnat_handler(struct sk_buff *skb,
struct ip_vs_protocol *pp, struct ip_vs_conn *cp)
{

sctp_sctphdr_t *sctph;
unsigned int sctphoff;
struct sk_buff *iter;
__be32 crc32;

#ifdef CONFIG_IP_VS_IPV6
Expand Down Expand Up @@ -133,8 +134,8 @@ sctp_dnat_handler(struct sk_buff *skb,

/* Calculate the checksum */
crc32 = sctp_start_cksum((u8 *) sctph, skb_headlen(skb) - sctphoff);
for (skb = skb_shinfo(skb)->frag_list; skb; skb = skb->next)
crc32 = sctp_update_cksum((u8 *) skb->data, skb_headlen(skb),
skb_walk_frags(skb, iter)
crc32 = sctp_update_cksum((u8 *) iter->data, skb_headlen(iter),
crc32);
crc32 = sctp_end_cksum(crc32);
sctph->checksum = crc32;
Expand All @@ -145,9 +146,9 @@ sctp_dnat_handler(struct sk_buff *skb,
static int
sctp_csum_check(int af, struct sk_buff *skb, struct ip_vs_protocol *pp)
{
struct sk_buff *list = skb_shinfo(skb)->frag_list;
unsigned int sctphoff;
struct sctphdr *sh, _sctph;
struct sk_buff *iter;
__le32 cmp;
__le32 val;
__u32 tmp;
Expand All @@ -166,9 +167,9 @@ sctp_csum_check(int af, struct sk_buff *skb, struct ip_vs_protocol *pp)
cmp = sh->checksum;

tmp = sctp_start_cksum((__u8 *) sh, skb_headlen(skb));
for (; list; list = list->next)
tmp = sctp_update_cksum((__u8 *) list->data,
skb_headlen(list), tmp);
skb_walk_frags(skb, iter)
tmp = sctp_update_cksum((__u8 *) iter->data,
skb_headlen(iter), tmp);

val = sctp_end_cksum(tmp);

Expand Down

0 comments on commit 2d976c2

Please sign in to comment.