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/udp.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/udp.c')
-rw-r--r-- | net/ipv6/udp.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c index e991e606ab1f..55affe39b2eb 100644 --- a/net/ipv6/udp.c +++ b/net/ipv6/udp.c | |||
@@ -180,7 +180,8 @@ try_again: | |||
180 | ipv6_addr_set(&sin6->sin6_addr, 0, 0, | 180 | ipv6_addr_set(&sin6->sin6_addr, 0, 0, |
181 | htonl(0xffff), ip_hdr(skb)->saddr); | 181 | htonl(0xffff), ip_hdr(skb)->saddr); |
182 | else { | 182 | else { |
183 | ipv6_addr_copy(&sin6->sin6_addr, &skb->nh.ipv6h->saddr); | 183 | ipv6_addr_copy(&sin6->sin6_addr, |
184 | &ipv6_hdr(skb)->saddr); | ||
184 | if (ipv6_addr_type(&sin6->sin6_addr) & IPV6_ADDR_LINKLOCAL) | 185 | if (ipv6_addr_type(&sin6->sin6_addr) & IPV6_ADDR_LINKLOCAL) |
185 | sin6->sin6_scope_id = IP6CB(skb)->iif; | 186 | sin6->sin6_scope_id = IP6CB(skb)->iif; |
186 | } | 187 | } |
@@ -392,13 +393,13 @@ static inline int udp6_csum_init(struct sk_buff *skb, struct udphdr *uh, | |||
392 | return 1; | 393 | return 1; |
393 | } | 394 | } |
394 | if (skb->ip_summed == CHECKSUM_COMPLETE && | 395 | if (skb->ip_summed == CHECKSUM_COMPLETE && |
395 | !csum_ipv6_magic(&skb->nh.ipv6h->saddr, &skb->nh.ipv6h->daddr, | 396 | !csum_ipv6_magic(&ipv6_hdr(skb)->saddr, &ipv6_hdr(skb)->daddr, |
396 | skb->len, proto, skb->csum)) | 397 | skb->len, proto, skb->csum)) |
397 | skb->ip_summed = CHECKSUM_UNNECESSARY; | 398 | skb->ip_summed = CHECKSUM_UNNECESSARY; |
398 | 399 | ||
399 | if (skb->ip_summed != CHECKSUM_UNNECESSARY) | 400 | if (skb->ip_summed != CHECKSUM_UNNECESSARY) |
400 | skb->csum = ~csum_unfold(csum_ipv6_magic(&skb->nh.ipv6h->saddr, | 401 | skb->csum = ~csum_unfold(csum_ipv6_magic(&ipv6_hdr(skb)->saddr, |
401 | &skb->nh.ipv6h->daddr, | 402 | &ipv6_hdr(skb)->daddr, |
402 | skb->len, proto, 0)); | 403 | skb->len, proto, 0)); |
403 | 404 | ||
404 | return 0; | 405 | return 0; |
@@ -417,8 +418,8 @@ int __udp6_lib_rcv(struct sk_buff **pskb, struct hlist_head udptable[], | |||
417 | if (!pskb_may_pull(skb, sizeof(struct udphdr))) | 418 | if (!pskb_may_pull(skb, sizeof(struct udphdr))) |
418 | goto short_packet; | 419 | goto short_packet; |
419 | 420 | ||
420 | saddr = &skb->nh.ipv6h->saddr; | 421 | saddr = &ipv6_hdr(skb)->saddr; |
421 | daddr = &skb->nh.ipv6h->daddr; | 422 | daddr = &ipv6_hdr(skb)->daddr; |
422 | uh = skb->h.uh; | 423 | uh = skb->h.uh; |
423 | 424 | ||
424 | ulen = ntohs(uh->len); | 425 | ulen = ntohs(uh->len); |
@@ -438,8 +439,8 @@ int __udp6_lib_rcv(struct sk_buff **pskb, struct hlist_head udptable[], | |||
438 | if (ulen < skb->len) { | 439 | if (ulen < skb->len) { |
439 | if (pskb_trim_rcsum(skb, ulen)) | 440 | if (pskb_trim_rcsum(skb, ulen)) |
440 | goto short_packet; | 441 | goto short_packet; |
441 | saddr = &skb->nh.ipv6h->saddr; | 442 | saddr = &ipv6_hdr(skb)->saddr; |
442 | daddr = &skb->nh.ipv6h->daddr; | 443 | daddr = &ipv6_hdr(skb)->daddr; |
443 | uh = skb->h.uh; | 444 | uh = skb->h.uh; |
444 | } | 445 | } |
445 | } | 446 | } |