aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2007-03-19 21:29:03 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-04-26 01:26:38 -0400
commit6b88dd966b42e374dc783c397efc15f5c1458265 (patch)
tree4876e6953c2281231be8b0ce9724f31a6e012a28
parentdc5fc579b90ed0a9a4e55b0218cdbaf0a8cf2e67 (diff)
[SK_BUFF] ipv6: Use skb_network_offset in some more places
So that we reduce the number of direct accesses to skb->data. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r--net/ipv6/netfilter/ip6_tables.c2
-rw-r--r--net/ipv6/netfilter/nf_conntrack_reasm.c5
2 files changed, 4 insertions, 3 deletions
diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c
index caf9e375a0f1..b97aedce62ae 100644
--- a/net/ipv6/netfilter/ip6_tables.c
+++ b/net/ipv6/netfilter/ip6_tables.c
@@ -1448,7 +1448,7 @@ static void __exit ip6_tables_fini(void)
1448int ipv6_find_hdr(const struct sk_buff *skb, unsigned int *offset, 1448int ipv6_find_hdr(const struct sk_buff *skb, unsigned int *offset,
1449 int target, unsigned short *fragoff) 1449 int target, unsigned short *fragoff)
1450{ 1450{
1451 unsigned int start = (u8 *)(ipv6_hdr(skb) + 1) - skb->data; 1451 unsigned int start = skb_network_offset(skb) + sizeof(struct ipv6hdr);
1452 u8 nexthdr = ipv6_hdr(skb)->nexthdr; 1452 u8 nexthdr = ipv6_hdr(skb)->nexthdr;
1453 unsigned int len = skb->len - start; 1453 unsigned int len = skb->len - start;
1454 1454
diff --git a/net/ipv6/netfilter/nf_conntrack_reasm.c b/net/ipv6/netfilter/nf_conntrack_reasm.c
index b7889ceef556..721f02d7b7f6 100644
--- a/net/ipv6/netfilter/nf_conntrack_reasm.c
+++ b/net/ipv6/netfilter/nf_conntrack_reasm.c
@@ -707,8 +707,9 @@ static int
707find_prev_fhdr(struct sk_buff *skb, u8 *prevhdrp, int *prevhoff, int *fhoff) 707find_prev_fhdr(struct sk_buff *skb, u8 *prevhdrp, int *prevhoff, int *fhoff)
708{ 708{
709 u8 nexthdr = ipv6_hdr(skb)->nexthdr; 709 u8 nexthdr = ipv6_hdr(skb)->nexthdr;
710 u8 prev_nhoff = (u8 *)&ipv6_hdr(skb)->nexthdr - skb->data; 710 const int netoff = skb_network_offset(skb);
711 int start = (u8 *)(ipv6_hdr(skb) + 1) - skb->data; 711 u8 prev_nhoff = netoff + offsetof(struct ipv6hdr, nexthdr);
712 int start = netoff + sizeof(struct ipv6hdr);
712 int len = skb->len - start; 713 int len = skb->len - start;
713 u8 prevhdr = NEXTHDR_IPV6; 714 u8 prevhdr = NEXTHDR_IPV6;
714 715