aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/udp.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv6/udp.c')
-rw-r--r--net/ipv6/udp.c17
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 }