aboutsummaryrefslogtreecommitdiffstats
path: root/net/dccp
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2007-04-25 20:54:47 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-04-26 01:25:14 -0400
commit0660e03f6b18f19b6bbafe7583265a51b90daf36 (patch)
tree82cc819ead5ab7858ba211ee8719a3e6d2bb984f /net/dccp
parentd0a92be05ed4aea7d35c2b257e3f9173565fe4eb (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/dccp')
-rw-r--r--net/dccp/ipv6.c32
1 files changed, 17 insertions, 15 deletions
diff --git a/net/dccp/ipv6.c b/net/dccp/ipv6.c
index 627d0c3c51cf..64eac2515aa2 100644
--- a/net/dccp/ipv6.c
+++ b/net/dccp/ipv6.c
@@ -84,8 +84,8 @@ static inline __u32 secure_dccpv6_sequence_number(__be32 *saddr, __be32 *daddr,
84 84
85static inline __u32 dccp_v6_init_sequence(struct sk_buff *skb) 85static inline __u32 dccp_v6_init_sequence(struct sk_buff *skb)
86{ 86{
87 return secure_dccpv6_sequence_number(skb->nh.ipv6h->daddr.s6_addr32, 87 return secure_dccpv6_sequence_number(ipv6_hdr(skb)->daddr.s6_addr32,
88 skb->nh.ipv6h->saddr.s6_addr32, 88 ipv6_hdr(skb)->saddr.s6_addr32,
89 dccp_hdr(skb)->dccph_dport, 89 dccp_hdr(skb)->dccph_dport,
90 dccp_hdr(skb)->dccph_sport ); 90 dccp_hdr(skb)->dccph_sport );
91 91
@@ -313,6 +313,7 @@ static void dccp_v6_reqsk_destructor(struct request_sock *req)
313static void dccp_v6_ctl_send_reset(struct sock *sk, struct sk_buff *rxskb) 313static void dccp_v6_ctl_send_reset(struct sock *sk, struct sk_buff *rxskb)
314{ 314{
315 struct dccp_hdr *rxdh = dccp_hdr(rxskb), *dh; 315 struct dccp_hdr *rxdh = dccp_hdr(rxskb), *dh;
316 struct ipv6hdr *rxip6h;
316 const u32 dccp_hdr_reset_len = sizeof(struct dccp_hdr) + 317 const u32 dccp_hdr_reset_len = sizeof(struct dccp_hdr) +
317 sizeof(struct dccp_hdr_ext) + 318 sizeof(struct dccp_hdr_ext) +
318 sizeof(struct dccp_hdr_reset); 319 sizeof(struct dccp_hdr_reset);
@@ -352,12 +353,13 @@ static void dccp_v6_ctl_send_reset(struct sock *sk, struct sk_buff *rxskb)
352 dccp_hdr_set_ack(dccp_hdr_ack_bits(skb), DCCP_SKB_CB(rxskb)->dccpd_seq); 353 dccp_hdr_set_ack(dccp_hdr_ack_bits(skb), DCCP_SKB_CB(rxskb)->dccpd_seq);
353 354
354 dccp_csum_outgoing(skb); 355 dccp_csum_outgoing(skb);
355 dh->dccph_checksum = dccp_v6_csum_finish(skb, &rxskb->nh.ipv6h->saddr, 356 rxip6h = ipv6_hdr(rxskb);
356 &rxskb->nh.ipv6h->daddr); 357 dh->dccph_checksum = dccp_v6_csum_finish(skb, &rxip6h->saddr,
358 &rxip6h->daddr);
357 359
358 memset(&fl, 0, sizeof(fl)); 360 memset(&fl, 0, sizeof(fl));
359 ipv6_addr_copy(&fl.fl6_dst, &rxskb->nh.ipv6h->saddr); 361 ipv6_addr_copy(&fl.fl6_dst, &rxip6h->saddr);
360 ipv6_addr_copy(&fl.fl6_src, &rxskb->nh.ipv6h->daddr); 362 ipv6_addr_copy(&fl.fl6_src, &rxip6h->daddr);
361 363
362 fl.proto = IPPROTO_DCCP; 364 fl.proto = IPPROTO_DCCP;
363 fl.oif = inet6_iif(rxskb); 365 fl.oif = inet6_iif(rxskb);
@@ -390,7 +392,7 @@ static struct request_sock_ops dccp6_request_sock_ops = {
390static struct sock *dccp_v6_hnd_req(struct sock *sk,struct sk_buff *skb) 392static struct sock *dccp_v6_hnd_req(struct sock *sk,struct sk_buff *skb)
391{ 393{
392 const struct dccp_hdr *dh = dccp_hdr(skb); 394 const struct dccp_hdr *dh = dccp_hdr(skb);
393 const struct ipv6hdr *iph = skb->nh.ipv6h; 395 const struct ipv6hdr *iph = ipv6_hdr(skb);
394 struct sock *nsk; 396 struct sock *nsk;
395 struct request_sock **prev; 397 struct request_sock **prev;
396 /* Find possible connection requests. */ 398 /* Find possible connection requests. */
@@ -460,8 +462,8 @@ static int dccp_v6_conn_request(struct sock *sk, struct sk_buff *skb)
460 goto drop_and_free; 462 goto drop_and_free;
461 463
462 ireq6 = inet6_rsk(req); 464 ireq6 = inet6_rsk(req);
463 ipv6_addr_copy(&ireq6->rmt_addr, &skb->nh.ipv6h->saddr); 465 ipv6_addr_copy(&ireq6->rmt_addr, &ipv6_hdr(skb)->saddr);
464 ipv6_addr_copy(&ireq6->loc_addr, &skb->nh.ipv6h->daddr); 466 ipv6_addr_copy(&ireq6->loc_addr, &ipv6_hdr(skb)->daddr);
465 ireq6->pktopts = NULL; 467 ireq6->pktopts = NULL;
466 468
467 if (ipv6_opt_accepted(sk, skb) || 469 if (ipv6_opt_accepted(sk, skb) ||
@@ -546,7 +548,7 @@ static struct sock *dccp_v6_request_recv_sock(struct sock *sk,
546 newnp->pktoptions = NULL; 548 newnp->pktoptions = NULL;
547 newnp->opt = NULL; 549 newnp->opt = NULL;
548 newnp->mcast_oif = inet6_iif(skb); 550 newnp->mcast_oif = inet6_iif(skb);
549 newnp->mcast_hops = skb->nh.ipv6h->hop_limit; 551 newnp->mcast_hops = ipv6_hdr(skb)->hop_limit;
550 552
551 /* 553 /*
552 * No need to charge this sock to the relevant IPv6 refcnt debug socks count 554 * No need to charge this sock to the relevant IPv6 refcnt debug socks count
@@ -653,7 +655,7 @@ static struct sock *dccp_v6_request_recv_sock(struct sock *sk,
653 } 655 }
654 newnp->opt = NULL; 656 newnp->opt = NULL;
655 newnp->mcast_oif = inet6_iif(skb); 657 newnp->mcast_oif = inet6_iif(skb);
656 newnp->mcast_hops = skb->nh.ipv6h->hop_limit; 658 newnp->mcast_hops = ipv6_hdr(skb)->hop_limit;
657 659
658 /* 660 /*
659 * Clone native IPv6 options from listening socket (if any) 661 * Clone native IPv6 options from listening socket (if any)
@@ -826,8 +828,8 @@ static int dccp_v6_rcv(struct sk_buff **pskb)
826 goto discard_it; 828 goto discard_it;
827 829
828 /* Step 1: If header checksum is incorrect, drop packet and return. */ 830 /* Step 1: If header checksum is incorrect, drop packet and return. */
829 if (dccp_v6_csum_finish(skb, &skb->nh.ipv6h->saddr, 831 if (dccp_v6_csum_finish(skb, &ipv6_hdr(skb)->saddr,
830 &skb->nh.ipv6h->daddr)) { 832 &ipv6_hdr(skb)->daddr)) {
831 DCCP_WARN("dropped packet with invalid checksum\n"); 833 DCCP_WARN("dropped packet with invalid checksum\n");
832 goto discard_it; 834 goto discard_it;
833 } 835 }
@@ -844,9 +846,9 @@ static int dccp_v6_rcv(struct sk_buff **pskb)
844 846
845 /* Step 2: 847 /* Step 2:
846 * Look up flow ID in table and get corresponding socket */ 848 * Look up flow ID in table and get corresponding socket */
847 sk = __inet6_lookup(&dccp_hashinfo, &skb->nh.ipv6h->saddr, 849 sk = __inet6_lookup(&dccp_hashinfo, &ipv6_hdr(skb)->saddr,
848 dh->dccph_sport, 850 dh->dccph_sport,
849 &skb->nh.ipv6h->daddr, ntohs(dh->dccph_dport), 851 &ipv6_hdr(skb)->daddr, ntohs(dh->dccph_dport),
850 inet6_iif(skb)); 852 inet6_iif(skb));
851 /* 853 /*
852 * Step 2: 854 * Step 2: