diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2007-04-25 17:55:53 -0700 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-04-25 22:25:16 -0700 |
commit | ea2ae17d6443abddc79480dc9f7af8feacabddc4 (patch) | |
tree | 2d6f48a5e4a40f761b5b510af9aac1fca55004cb /net/ipv6/esp6.c | |
parent | badff6d01a8589a1c828b0bf118903ca38627f4e (diff) | |
download | linux-ea2ae17d6443abddc79480dc9f7af8feacabddc4.tar.gz linux-ea2ae17d6443abddc79480dc9f7af8feacabddc4.tar.bz2 linux-ea2ae17d6443abddc79480dc9f7af8feacabddc4.zip |
[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/ipv6/esp6.c')
-rw-r--r-- | net/ipv6/esp6.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/net/ipv6/esp6.c b/net/ipv6/esp6.c index 7aff380e74ef..35905867ded1 100644 --- a/net/ipv6/esp6.c +++ b/net/ipv6/esp6.c @@ -42,21 +42,18 @@ static int esp6_output(struct xfrm_state *x, struct sk_buff *skb) { int err; - int hdr_len; struct ipv6hdr *top_iph; struct ipv6_esp_hdr *esph; struct crypto_blkcipher *tfm; struct blkcipher_desc desc; - struct esp_data *esp; struct sk_buff *trailer; int blksize; int clen; int alen; int nfrags; - - esp = x->data; - hdr_len = skb->h.raw - skb->data + - sizeof(*esph) + esp->conf.ivlen; + struct esp_data *esp = x->data; + int hdr_len = (skb_transport_offset(skb) + + sizeof(*esph) + esp->conf.ivlen); /* Strip IP+ESP header. */ __skb_pull(skb, hdr_len); |