diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2007-04-25 20:55:53 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-04-26 01:25:16 -0400 |
commit | ea2ae17d6443abddc79480dc9f7af8feacabddc4 (patch) | |
tree | 2d6f48a5e4a40f761b5b510af9aac1fca55004cb /net/ipv6/esp6.c | |
parent | badff6d01a8589a1c828b0bf118903ca38627f4e (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/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 @@ | |||
42 | static int esp6_output(struct xfrm_state *x, struct sk_buff *skb) | 42 | static int esp6_output(struct xfrm_state *x, struct sk_buff *skb) |
43 | { | 43 | { |
44 | int err; | 44 | int err; |
45 | int hdr_len; | ||
46 | struct ipv6hdr *top_iph; | 45 | struct ipv6hdr *top_iph; |
47 | struct ipv6_esp_hdr *esph; | 46 | struct ipv6_esp_hdr *esph; |
48 | struct crypto_blkcipher *tfm; | 47 | struct crypto_blkcipher *tfm; |
49 | struct blkcipher_desc desc; | 48 | struct blkcipher_desc desc; |
50 | struct esp_data *esp; | ||
51 | struct sk_buff *trailer; | 49 | struct sk_buff *trailer; |
52 | int blksize; | 50 | int blksize; |
53 | int clen; | 51 | int clen; |
54 | int alen; | 52 | int alen; |
55 | int nfrags; | 53 | int nfrags; |
56 | 54 | struct esp_data *esp = x->data; | |
57 | esp = x->data; | 55 | int hdr_len = (skb_transport_offset(skb) + |
58 | hdr_len = skb->h.raw - skb->data + | 56 | sizeof(*esph) + esp->conf.ivlen); |
59 | sizeof(*esph) + esp->conf.ivlen; | ||
60 | 57 | ||
61 | /* Strip IP+ESP header. */ | 58 | /* Strip IP+ESP header. */ |
62 | __skb_pull(skb, hdr_len); | 59 | __skb_pull(skb, hdr_len); |