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/raw.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/raw.c')
-rw-r--r-- | net/ipv6/raw.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c index 9b2bcde73f19..0e2b56ce0a56 100644 --- a/net/ipv6/raw.c +++ b/net/ipv6/raw.c | |||
@@ -152,7 +152,7 @@ int ipv6_raw_deliver(struct sk_buff *skb, int nexthdr) | |||
152 | int delivered = 0; | 152 | int delivered = 0; |
153 | __u8 hash; | 153 | __u8 hash; |
154 | 154 | ||
155 | saddr = &skb->nh.ipv6h->saddr; | 155 | saddr = &ipv6_hdr(skb)->saddr; |
156 | daddr = saddr + 1; | 156 | daddr = saddr + 1; |
157 | 157 | ||
158 | hash = nexthdr & (MAX_INET_PROTOS - 1); | 158 | hash = nexthdr & (MAX_INET_PROTOS - 1); |
@@ -363,15 +363,16 @@ int rawv6_rcv(struct sock *sk, struct sk_buff *skb) | |||
363 | if (skb->ip_summed == CHECKSUM_COMPLETE) { | 363 | if (skb->ip_summed == CHECKSUM_COMPLETE) { |
364 | skb_postpull_rcsum(skb, skb_network_header(skb), | 364 | skb_postpull_rcsum(skb, skb_network_header(skb), |
365 | skb->h.raw - skb->nh.raw); | 365 | skb->h.raw - skb->nh.raw); |
366 | if (!csum_ipv6_magic(&skb->nh.ipv6h->saddr, | 366 | if (!csum_ipv6_magic(&ipv6_hdr(skb)->saddr, |
367 | &skb->nh.ipv6h->daddr, | 367 | &ipv6_hdr(skb)->daddr, |
368 | skb->len, inet->num, skb->csum)) | 368 | skb->len, inet->num, skb->csum)) |
369 | skb->ip_summed = CHECKSUM_UNNECESSARY; | 369 | skb->ip_summed = CHECKSUM_UNNECESSARY; |
370 | } | 370 | } |
371 | if (skb->ip_summed != CHECKSUM_UNNECESSARY) | 371 | if (skb->ip_summed != CHECKSUM_UNNECESSARY) |
372 | skb->csum = ~csum_unfold(csum_ipv6_magic(&skb->nh.ipv6h->saddr, | 372 | skb->csum = ~csum_unfold(csum_ipv6_magic(&ipv6_hdr(skb)->saddr, |
373 | &skb->nh.ipv6h->daddr, | 373 | &ipv6_hdr(skb)->daddr, |
374 | skb->len, inet->num, 0)); | 374 | skb->len, |
375 | inet->num, 0)); | ||
375 | 376 | ||
376 | if (inet->hdrincl) { | 377 | if (inet->hdrincl) { |
377 | if (skb_checksum_complete(skb)) { | 378 | if (skb_checksum_complete(skb)) { |
@@ -438,7 +439,7 @@ static int rawv6_recvmsg(struct kiocb *iocb, struct sock *sk, | |||
438 | if (sin6) { | 439 | if (sin6) { |
439 | sin6->sin6_family = AF_INET6; | 440 | sin6->sin6_family = AF_INET6; |
440 | sin6->sin6_port = 0; | 441 | sin6->sin6_port = 0; |
441 | ipv6_addr_copy(&sin6->sin6_addr, &skb->nh.ipv6h->saddr); | 442 | ipv6_addr_copy(&sin6->sin6_addr, &ipv6_hdr(skb)->saddr); |
442 | sin6->sin6_flowinfo = 0; | 443 | sin6->sin6_flowinfo = 0; |
443 | sin6->sin6_scope_id = 0; | 444 | sin6->sin6_scope_id = 0; |
444 | if (ipv6_addr_type(&sin6->sin6_addr) & IPV6_ADDR_LINKLOCAL) | 445 | if (ipv6_addr_type(&sin6->sin6_addr) & IPV6_ADDR_LINKLOCAL) |
@@ -578,7 +579,7 @@ static int rawv6_send_hdrinc(struct sock *sk, void *from, int length, | |||
578 | 579 | ||
579 | skb_put(skb, length); | 580 | skb_put(skb, length); |
580 | skb_reset_network_header(skb); | 581 | skb_reset_network_header(skb); |
581 | iph = skb->nh.ipv6h; | 582 | iph = ipv6_hdr(skb); |
582 | 583 | ||
583 | skb->ip_summed = CHECKSUM_NONE; | 584 | skb->ip_summed = CHECKSUM_NONE; |
584 | 585 | ||