diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2007-03-16 16:26:39 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-04-26 01:26:19 -0400 |
commit | cfe1fc7759fdacb0c650b575daed1692bf3eaece (patch) | |
tree | b8ed6fbc6c028595f5e82be1bccdeb2727e0a0b2 /net/ipv6/exthdrs.c | |
parent | bff9b61ce330df04c6830d823c30c04203543f01 (diff) |
[SK_BUFF]: Introduce skb_network_header_len
For the common sequence "skb->h.raw - skb->nh.raw", similar to skb->mac_len,
that is precalculated tho, don't think we need to bloat skb with one more
member, so just use this new helper, reducing the number of non-skbuff.h
references to the layer headers even more.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/exthdrs.c')
-rw-r--r-- | net/ipv6/exthdrs.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/net/ipv6/exthdrs.c b/net/ipv6/exthdrs.c index f763409ea740..f34cc2bd489a 100644 --- a/net/ipv6/exthdrs.c +++ b/net/ipv6/exthdrs.c | |||
@@ -143,7 +143,7 @@ static int ip6_parse_tlv(struct tlvtype_proc *procs, struct sk_buff **skbp) | |||
143 | struct sk_buff *skb = *skbp; | 143 | struct sk_buff *skb = *skbp; |
144 | struct tlvtype_proc *curr; | 144 | struct tlvtype_proc *curr; |
145 | const unsigned char *nh = skb_network_header(skb); | 145 | const unsigned char *nh = skb_network_header(skb); |
146 | int off = skb->h.raw - skb->nh.raw; | 146 | int off = skb_network_header_len(skb); |
147 | int len = (skb_transport_header(skb)[1] + 1) << 3; | 147 | int len = (skb_transport_header(skb)[1] + 1) << 3; |
148 | 148 | ||
149 | if (skb_transport_offset(skb) + len > skb_headlen(skb)) | 149 | if (skb_transport_offset(skb) + len > skb_headlen(skb)) |
@@ -297,7 +297,7 @@ static int ipv6_destopt_rcv(struct sk_buff **skbp) | |||
297 | return -1; | 297 | return -1; |
298 | } | 298 | } |
299 | 299 | ||
300 | opt->lastopt = opt->dst1 = skb->h.raw - skb->nh.raw; | 300 | opt->lastopt = opt->dst1 = skb_network_header_len(skb); |
301 | #ifdef CONFIG_IPV6_MIP6 | 301 | #ifdef CONFIG_IPV6_MIP6 |
302 | dstbuf = opt->dst1; | 302 | dstbuf = opt->dst1; |
303 | #endif | 303 | #endif |
@@ -443,7 +443,7 @@ looped_back: | |||
443 | break; | 443 | break; |
444 | } | 444 | } |
445 | 445 | ||
446 | opt->lastopt = opt->srcrt = skb->h.raw - skb->nh.raw; | 446 | opt->lastopt = opt->srcrt = skb_network_header_len(skb); |
447 | skb->h.raw += (hdr->hdrlen + 1) << 3; | 447 | skb->h.raw += (hdr->hdrlen + 1) << 3; |
448 | opt->dst0 = opt->dst1; | 448 | opt->dst0 = opt->dst1; |
449 | opt->dst1 = 0; | 449 | opt->dst1 = 0; |
@@ -738,7 +738,7 @@ int ipv6_parse_hopopts(struct sk_buff **skbp) | |||
738 | 738 | ||
739 | /* | 739 | /* |
740 | * skb_network_header(skb) is equal to skb->data, and | 740 | * skb_network_header(skb) is equal to skb->data, and |
741 | * skb->h.raw - skb->nh.raw is always equal to | 741 | * skb_network_header_len(skb) is always equal to |
742 | * sizeof(struct ipv6hdr) by definition of | 742 | * sizeof(struct ipv6hdr) by definition of |
743 | * hop-by-hop options. | 743 | * hop-by-hop options. |
744 | */ | 744 | */ |