diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2007-04-25 20:54:47 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-04-26 01:25:14 -0400 |
commit | 0660e03f6b18f19b6bbafe7583265a51b90daf36 (patch) | |
tree | 82cc819ead5ab7858ba211ee8719a3e6d2bb984f /net/ipv6/mip6.c | |
parent | d0a92be05ed4aea7d35c2b257e3f9173565fe4eb (diff) |
[SK_BUFF]: Introduce ipv6_hdr(), remove skb->nh.ipv6h
Now the skb->nh union has just one member, .raw, i.e. it is just like the
skb->mac union, strange, no? I'm just leaving it like that till the transport
layer is done with, when we'll rename skb->mac.raw to skb->mac_header (or
->mac_header_offset?), ditto for ->{h,nh}.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/mip6.c')
-rw-r--r-- | net/ipv6/mip6.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/net/ipv6/mip6.c b/net/ipv6/mip6.c index bb4033553f3b..7b5f9d82e801 100644 --- a/net/ipv6/mip6.c +++ b/net/ipv6/mip6.c | |||
@@ -129,7 +129,7 @@ static struct mip6_report_rate_limiter mip6_report_rl = { | |||
129 | 129 | ||
130 | static int mip6_destopt_input(struct xfrm_state *x, struct sk_buff *skb) | 130 | static int mip6_destopt_input(struct xfrm_state *x, struct sk_buff *skb) |
131 | { | 131 | { |
132 | struct ipv6hdr *iph = skb->nh.ipv6h; | 132 | struct ipv6hdr *iph = ipv6_hdr(skb); |
133 | struct ipv6_destopt_hdr *destopt = (struct ipv6_destopt_hdr *)skb->data; | 133 | struct ipv6_destopt_hdr *destopt = (struct ipv6_destopt_hdr *)skb->data; |
134 | 134 | ||
135 | if (!ipv6_addr_equal(&iph->saddr, (struct in6_addr *)x->coaddr) && | 135 | if (!ipv6_addr_equal(&iph->saddr, (struct in6_addr *)x->coaddr) && |
@@ -223,16 +223,16 @@ static int mip6_destopt_reject(struct xfrm_state *x, struct sk_buff *skb, struct | |||
223 | 223 | ||
224 | skb_get_timestamp(skb, &stamp); | 224 | skb_get_timestamp(skb, &stamp); |
225 | 225 | ||
226 | if (!mip6_report_rl_allow(&stamp, &skb->nh.ipv6h->daddr, | 226 | if (!mip6_report_rl_allow(&stamp, &ipv6_hdr(skb)->daddr, |
227 | hao ? &hao->addr : &skb->nh.ipv6h->saddr, | 227 | hao ? &hao->addr : &ipv6_hdr(skb)->saddr, |
228 | opt->iif)) | 228 | opt->iif)) |
229 | goto out; | 229 | goto out; |
230 | 230 | ||
231 | memset(&sel, 0, sizeof(sel)); | 231 | memset(&sel, 0, sizeof(sel)); |
232 | memcpy(&sel.daddr, (xfrm_address_t *)&skb->nh.ipv6h->daddr, | 232 | memcpy(&sel.daddr, (xfrm_address_t *)&ipv6_hdr(skb)->daddr, |
233 | sizeof(sel.daddr)); | 233 | sizeof(sel.daddr)); |
234 | sel.prefixlen_d = 128; | 234 | sel.prefixlen_d = 128; |
235 | memcpy(&sel.saddr, (xfrm_address_t *)&skb->nh.ipv6h->saddr, | 235 | memcpy(&sel.saddr, (xfrm_address_t *)&ipv6_hdr(skb)->saddr, |
236 | sizeof(sel.saddr)); | 236 | sizeof(sel.saddr)); |
237 | sel.prefixlen_s = 128; | 237 | sel.prefixlen_s = 128; |
238 | sel.family = AF_INET6; | 238 | sel.family = AF_INET6; |
@@ -256,12 +256,13 @@ static int mip6_destopt_offset(struct xfrm_state *x, struct sk_buff *skb, | |||
256 | u8 **nexthdr) | 256 | u8 **nexthdr) |
257 | { | 257 | { |
258 | u16 offset = sizeof(struct ipv6hdr); | 258 | u16 offset = sizeof(struct ipv6hdr); |
259 | struct ipv6_opt_hdr *exthdr = (struct ipv6_opt_hdr*)(skb->nh.ipv6h + 1); | 259 | struct ipv6_opt_hdr *exthdr = |
260 | (struct ipv6_opt_hdr *)(ipv6_hdr(skb) + 1); | ||
260 | const unsigned char *nh = skb_network_header(skb); | 261 | const unsigned char *nh = skb_network_header(skb); |
261 | unsigned int packet_len = skb->tail - nh; | 262 | unsigned int packet_len = skb->tail - nh; |
262 | int found_rhdr = 0; | 263 | int found_rhdr = 0; |
263 | 264 | ||
264 | *nexthdr = &skb->nh.ipv6h->nexthdr; | 265 | *nexthdr = &ipv6_hdr(skb)->nexthdr; |
265 | 266 | ||
266 | while (offset + 1 <= packet_len) { | 267 | while (offset + 1 <= packet_len) { |
267 | 268 | ||
@@ -387,12 +388,13 @@ static int mip6_rthdr_offset(struct xfrm_state *x, struct sk_buff *skb, | |||
387 | u8 **nexthdr) | 388 | u8 **nexthdr) |
388 | { | 389 | { |
389 | u16 offset = sizeof(struct ipv6hdr); | 390 | u16 offset = sizeof(struct ipv6hdr); |
390 | struct ipv6_opt_hdr *exthdr = (struct ipv6_opt_hdr*)(skb->nh.ipv6h + 1); | 391 | struct ipv6_opt_hdr *exthdr = |
392 | (struct ipv6_opt_hdr *)(ipv6_hdr(skb) + 1); | ||
391 | const unsigned char *nh = skb_network_header(skb); | 393 | const unsigned char *nh = skb_network_header(skb); |
392 | unsigned int packet_len = skb->tail - nh; | 394 | unsigned int packet_len = skb->tail - nh; |
393 | int found_rhdr = 0; | 395 | int found_rhdr = 0; |
394 | 396 | ||
395 | *nexthdr = &skb->nh.ipv6h->nexthdr; | 397 | *nexthdr = &ipv6_hdr(skb)->nexthdr; |
396 | 398 | ||
397 | while (offset + 1 <= packet_len) { | 399 | while (offset + 1 <= packet_len) { |
398 | 400 | ||