diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2007-04-10 23:50:43 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-04-26 01:24:59 -0400 |
commit | d56f90a7c96da5187f0cdf07ee7434fe6aa78bbc (patch) | |
tree | 3b9073cecfbb3b6a1e25ab2b5dd2a22a43aef238 /net/core/dev.c | |
parent | bbe735e4247dba32568a305553b010081c8dea99 (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/core/dev.c')
-rw-r--r-- | net/core/dev.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index 1b0758254ba0..54ffe9db9b02 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -1068,8 +1068,8 @@ static void dev_queue_xmit_nit(struct sk_buff *skb, struct net_device *dev) | |||
1068 | */ | 1068 | */ |
1069 | skb_reset_mac_header(skb2); | 1069 | skb_reset_mac_header(skb2); |
1070 | 1070 | ||
1071 | if (skb2->nh.raw < skb2->data || | 1071 | if (skb_network_header(skb2) < skb2->data || |
1072 | skb2->nh.raw > skb2->tail) { | 1072 | skb_network_header(skb2) > skb2->tail) { |
1073 | if (net_ratelimit()) | 1073 | if (net_ratelimit()) |
1074 | printk(KERN_CRIT "protocol %04x is " | 1074 | printk(KERN_CRIT "protocol %04x is " |
1075 | "buggy, dev %s\n", | 1075 | "buggy, dev %s\n", |
@@ -1207,7 +1207,7 @@ struct sk_buff *skb_gso_segment(struct sk_buff *skb, int features) | |||
1207 | BUG_ON(skb_shinfo(skb)->frag_list); | 1207 | BUG_ON(skb_shinfo(skb)->frag_list); |
1208 | 1208 | ||
1209 | skb_reset_mac_header(skb); | 1209 | skb_reset_mac_header(skb); |
1210 | skb->mac_len = skb->nh.raw - skb->data; | 1210 | skb->mac_len = skb->nh.raw - skb->mac.raw; |
1211 | __skb_pull(skb, skb->mac_len); | 1211 | __skb_pull(skb, skb->mac_len); |
1212 | 1212 | ||
1213 | if (unlikely(skb->ip_summed != CHECKSUM_PARTIAL)) { | 1213 | if (unlikely(skb->ip_summed != CHECKSUM_PARTIAL)) { |
@@ -1224,7 +1224,8 @@ struct sk_buff *skb_gso_segment(struct sk_buff *skb, int features) | |||
1224 | segs = ERR_PTR(err); | 1224 | segs = ERR_PTR(err); |
1225 | if (err || skb_gso_ok(skb, features)) | 1225 | if (err || skb_gso_ok(skb, features)) |
1226 | break; | 1226 | break; |
1227 | __skb_push(skb, skb->data - skb->nh.raw); | 1227 | __skb_push(skb, (skb->data - |
1228 | skb_network_header(skb))); | ||
1228 | } | 1229 | } |
1229 | segs = ptype->gso_segment(skb, features); | 1230 | segs = ptype->gso_segment(skb, features); |
1230 | break; | 1231 | break; |