[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>
This commit is contained in:
committed by
David S. Miller
parent
badff6d01a
commit
ea2ae17d64
@@ -124,15 +124,13 @@ static int ipcomp6_output(struct xfrm_state *x, struct sk_buff *skb)
|
||||
{
|
||||
int err;
|
||||
struct ipv6hdr *top_iph;
|
||||
int hdr_len;
|
||||
struct ipv6_comp_hdr *ipch;
|
||||
struct ipcomp_data *ipcd = x->data;
|
||||
int plen, dlen;
|
||||
u8 *start, *scratch;
|
||||
struct crypto_comp *tfm;
|
||||
int cpu;
|
||||
|
||||
hdr_len = skb->h.raw - skb->data;
|
||||
int hdr_len = skb_transport_offset(skb);
|
||||
|
||||
/* check whether datagram len is larger than threshold */
|
||||
if ((skb->len - hdr_len) < ipcd->threshold) {
|
||||
|
Reference in New Issue
Block a user