aboutsummaryrefslogtreecommitdiff
path: root/net/core
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2007-04-25 17:55:53 -0700
committerDavid S. Miller <davem@sunset.davemloft.net>2007-04-25 22:25:16 -0700
commitea2ae17d6443abddc79480dc9f7af8feacabddc4 (patch)
tree2d6f48a5e4a40f761b5b510af9aac1fca55004cb /net/core
parentbadff6d01a8589a1c828b0bf118903ca38627f4e (diff)
[SK_BUFF]: Introduce skb_transport_offset()
For the quite common 'skb->h.raw - skb->data' sequence. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/dev.c2
-rw-r--r--net/core/skbuff.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index 99f15728d9c..f7f7e5687e4 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1156,7 +1156,7 @@ EXPORT_SYMBOL(netif_device_attach);
int skb_checksum_help(struct sk_buff *skb)
{
__wsum csum;
- int ret = 0, offset = skb->h.raw - skb->data;
+ int ret = 0, offset = skb_transport_offset(skb);
if (skb->ip_summed == CHECKSUM_COMPLETE)
goto out_set_summed;
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 1493c95f633..b242020c02f 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -1348,7 +1348,7 @@ void skb_copy_and_csum_dev(const struct sk_buff *skb, u8 *to)
long csstart;
if (skb->ip_summed == CHECKSUM_PARTIAL)
- csstart = skb->h.raw - skb->data;
+ csstart = skb_transport_offset(skb);
else
csstart = skb_headlen(skb);