aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/ip_output.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2007-03-13 12:51:52 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-04-26 01:25:17 -0400
commit967b05f64e27d04a4c8879addd0e1c52137e2c9e (patch)
treec2c7ab3f0284903222d6d0864deaedbd4766b9b8 /net/ipv4/ip_output.c
parentea2ae17d6443abddc79480dc9f7af8feacabddc4 (diff)
[SK_BUFF]: Introduce skb_set_transport_header
For the cases where the transport header is being set to a offset from skb->data. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/ip_output.c')
-rw-r--r--net/ipv4/ip_output.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index 63c05be0764d..6d92358fc513 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -593,7 +593,7 @@ slow_path:
593 skb_reserve(skb2, ll_rs); 593 skb_reserve(skb2, ll_rs);
594 skb_put(skb2, len + hlen); 594 skb_put(skb2, len + hlen);
595 skb_reset_network_header(skb2); 595 skb_reset_network_header(skb2);
596 skb2->h.raw = skb2->data + hlen; 596 skb2->h.raw = skb2->nh.raw + hlen;
597 597
598 /* 598 /*
599 * Charge the memory for the fragment to any owner 599 * Charge the memory for the fragment to any owner
@@ -724,7 +724,7 @@ static inline int ip_ufo_append_data(struct sock *sk,
724 skb_reset_network_header(skb); 724 skb_reset_network_header(skb);
725 725
726 /* initialize protocol header pointer */ 726 /* initialize protocol header pointer */
727 skb->h.raw = skb->data + fragheaderlen; 727 skb->h.raw = skb->nh.raw + fragheaderlen;
728 728
729 skb->ip_summed = CHECKSUM_PARTIAL; 729 skb->ip_summed = CHECKSUM_PARTIAL;
730 skb->csum = 0; 730 skb->csum = 0;
@@ -1099,8 +1099,6 @@ ssize_t ip_append_page(struct sock *sk, struct page *page,
1099 } 1099 }
1100 if (len <= 0) { 1100 if (len <= 0) {
1101 struct sk_buff *skb_prev; 1101 struct sk_buff *skb_prev;
1102 char *data;
1103 struct iphdr *iph;
1104 int alloclen; 1102 int alloclen;
1105 1103
1106 skb_prev = skb; 1104 skb_prev = skb;
@@ -1123,16 +1121,15 @@ ssize_t ip_append_page(struct sock *sk, struct page *page,
1123 /* 1121 /*
1124 * Find where to start putting bytes. 1122 * Find where to start putting bytes.
1125 */ 1123 */
1126 data = skb_put(skb, fragheaderlen + fraggap); 1124 skb_put(skb, fragheaderlen + fraggap);
1127 skb_reset_network_header(skb); 1125 skb_reset_network_header(skb);
1128 iph = ip_hdr(skb); 1126 skb->h.raw = skb->nh.raw + fragheaderlen;
1129 data += fragheaderlen;
1130 skb->h.raw = data;
1131 1127
1132 if (fraggap) { 1128 if (fraggap) {
1133 skb->csum = skb_copy_and_csum_bits( 1129 skb->csum = skb_copy_and_csum_bits(skb_prev,
1134 skb_prev, maxfraglen, 1130 maxfraglen,
1135 data, fraggap, 0); 1131 skb->h.raw,
1132 fraggap, 0);
1136 skb_prev->csum = csum_sub(skb_prev->csum, 1133 skb_prev->csum = csum_sub(skb_prev->csum,
1137 skb->csum); 1134 skb->csum);
1138 pskb_trim_unique(skb_prev, maxfraglen); 1135 pskb_trim_unique(skb_prev, maxfraglen);