aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/ip_output.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2007-04-10 23:50:43 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-04-26 01:24:59 -0400
commitd56f90a7c96da5187f0cdf07ee7434fe6aa78bbc (patch)
tree3b9073cecfbb3b6a1e25ab2b5dd2a22a43aef238 /net/ipv4/ip_output.c
parentbbe735e4247dba32568a305553b010081c8dea99 (diff)
[SK_BUFF]: Introduce skb_network_header()
For the places where we need a pointer to the network header, it is still legal to touch skb->nh.raw directly if just adding to, subtracting from or setting it to another layer header. 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.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index 669f5d97c6eb..eae228469627 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -503,7 +503,7 @@ int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff*))
503 frag->h.raw = frag->data; 503 frag->h.raw = frag->data;
504 __skb_push(frag, hlen); 504 __skb_push(frag, hlen);
505 skb_reset_network_header(frag); 505 skb_reset_network_header(frag);
506 memcpy(frag->nh.raw, iph, hlen); 506 memcpy(skb_network_header(frag), iph, hlen);
507 iph = frag->nh.iph; 507 iph = frag->nh.iph;
508 iph->tot_len = htons(frag->len); 508 iph->tot_len = htons(frag->len);
509 ip_copy_metadata(frag, skb); 509 ip_copy_metadata(frag, skb);
@@ -607,7 +607,7 @@ slow_path:
607 * Copy the packet header into the new buffer. 607 * Copy the packet header into the new buffer.
608 */ 608 */
609 609
610 memcpy(skb2->nh.raw, skb->data, hlen); 610 memcpy(skb_network_header(skb2), skb->data, hlen);
611 611
612 /* 612 /*
613 * Copy a block of the IP datagram. 613 * Copy a block of the IP datagram.
@@ -1198,7 +1198,7 @@ int ip_push_pending_frames(struct sock *sk)
1198 tail_skb = &(skb_shinfo(skb)->frag_list); 1198 tail_skb = &(skb_shinfo(skb)->frag_list);
1199 1199
1200 /* move skb->data to ip header from ext header */ 1200 /* move skb->data to ip header from ext header */
1201 if (skb->data < skb->nh.raw) 1201 if (skb->data < skb_network_header(skb))
1202 __skb_pull(skb, skb_network_offset(skb)); 1202 __skb_pull(skb, skb_network_offset(skb));
1203 while ((tmp_skb = __skb_dequeue(&sk->sk_write_queue)) != NULL) { 1203 while ((tmp_skb = __skb_dequeue(&sk->sk_write_queue)) != NULL) {
1204 __skb_pull(tmp_skb, skb->h.raw - skb->nh.raw); 1204 __skb_pull(tmp_skb, skb->h.raw - skb->nh.raw);