diff options
| author | David S. Miller <davem@davemloft.net> | 2009-06-09 03:23:58 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2009-06-09 03:23:58 -0400 |
| commit | 343a99724e4431d8618bea2eb7552e12c965425a (patch) | |
| tree | 757ebed1108b3609e4617e905ed48ab08f6fc00c | |
| parent | 4d9092bb41c8fdca45513461587d8b4ad3918f74 (diff) | |
netfilter: Use frag list abstraction interfaces.
Signed-off-by: David S. Miller <davem@davemloft.net>
| -rw-r--r-- | net/ipv4/netfilter/nf_nat_proto_sctp.c | 5 | ||||
| -rw-r--r-- | net/ipv6/netfilter/nf_conntrack_reasm.c | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/net/ipv4/netfilter/nf_nat_proto_sctp.c b/net/ipv4/netfilter/nf_nat_proto_sctp.c index 65e470bc6123..6983e41c0b0f 100644 --- a/net/ipv4/netfilter/nf_nat_proto_sctp.c +++ b/net/ipv4/netfilter/nf_nat_proto_sctp.c | |||
| @@ -33,6 +33,7 @@ sctp_manip_pkt(struct sk_buff *skb, | |||
| 33 | enum nf_nat_manip_type maniptype) | 33 | enum nf_nat_manip_type maniptype) |
| 34 | { | 34 | { |
| 35 | const struct iphdr *iph = (struct iphdr *)(skb->data + iphdroff); | 35 | const struct iphdr *iph = (struct iphdr *)(skb->data + iphdroff); |
| 36 | struct sk_buff *frag; | ||
| 36 | sctp_sctphdr_t *hdr; | 37 | sctp_sctphdr_t *hdr; |
| 37 | unsigned int hdroff = iphdroff + iph->ihl*4; | 38 | unsigned int hdroff = iphdroff + iph->ihl*4; |
| 38 | __be32 oldip, newip; | 39 | __be32 oldip, newip; |
| @@ -57,8 +58,8 @@ sctp_manip_pkt(struct sk_buff *skb, | |||
| 57 | } | 58 | } |
| 58 | 59 | ||
| 59 | crc32 = sctp_start_cksum((u8 *)hdr, skb_headlen(skb) - hdroff); | 60 | crc32 = sctp_start_cksum((u8 *)hdr, skb_headlen(skb) - hdroff); |
| 60 | for (skb = skb_shinfo(skb)->frag_list; skb; skb = skb->next) | 61 | skb_walk_frags(skb, frag); |
| 61 | crc32 = sctp_update_cksum((u8 *)skb->data, skb_headlen(skb), | 62 | crc32 = sctp_update_cksum((u8 *)frag->data, skb_headlen(frag), |
| 62 | crc32); | 63 | crc32); |
| 63 | crc32 = sctp_end_cksum(crc32); | 64 | crc32 = sctp_end_cksum(crc32); |
| 64 | hdr->checksum = crc32; | 65 | hdr->checksum = crc32; |
diff --git a/net/ipv6/netfilter/nf_conntrack_reasm.c b/net/ipv6/netfilter/nf_conntrack_reasm.c index 058a5e4a60c3..f3aba255ad9f 100644 --- a/net/ipv6/netfilter/nf_conntrack_reasm.c +++ b/net/ipv6/netfilter/nf_conntrack_reasm.c | |||
| @@ -409,7 +409,7 @@ nf_ct_frag6_reasm(struct nf_ct_frag6_queue *fq, struct net_device *dev) | |||
| 409 | /* If the first fragment is fragmented itself, we split | 409 | /* If the first fragment is fragmented itself, we split |
| 410 | * it to two chunks: the first with data and paged part | 410 | * it to two chunks: the first with data and paged part |
| 411 | * and the second, holding only fragments. */ | 411 | * and the second, holding only fragments. */ |
| 412 | if (skb_shinfo(head)->frag_list) { | 412 | if (skb_has_frags(head)) { |
| 413 | struct sk_buff *clone; | 413 | struct sk_buff *clone; |
| 414 | int i, plen = 0; | 414 | int i, plen = 0; |
| 415 | 415 | ||
| @@ -420,7 +420,7 @@ nf_ct_frag6_reasm(struct nf_ct_frag6_queue *fq, struct net_device *dev) | |||
| 420 | clone->next = head->next; | 420 | clone->next = head->next; |
| 421 | head->next = clone; | 421 | head->next = clone; |
| 422 | skb_shinfo(clone)->frag_list = skb_shinfo(head)->frag_list; | 422 | skb_shinfo(clone)->frag_list = skb_shinfo(head)->frag_list; |
| 423 | skb_shinfo(head)->frag_list = NULL; | 423 | skb_frag_list_init(head); |
| 424 | for (i=0; i<skb_shinfo(head)->nr_frags; i++) | 424 | for (i=0; i<skb_shinfo(head)->nr_frags; i++) |
| 425 | plen += skb_shinfo(head)->frags[i].size; | 425 | plen += skb_shinfo(head)->frags[i].size; |
| 426 | clone->len = clone->data_len = head->data_len - plen; | 426 | clone->len = clone->data_len = head->data_len - plen; |
