diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2007-04-11 00:04:22 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-04-26 01:25:26 -0400 |
commit | aa8223c7bb0b05183e1737881ed21827aa5b9e73 (patch) | |
tree | 05c9832326edfeb878472f15cf8133ed9f014cdf /net/ipv6 | |
parent | ab6a5bb6b28a970104a34f0f6959b73cf61bdc72 (diff) |
[SK_BUFF]: Introduce tcp_hdr(), remove skb->h.th
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/tcp_ipv6.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index c573353f21cd..4a55da079f5f 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c | |||
@@ -117,8 +117,8 @@ static __u32 tcp_v6_init_sequence(struct sk_buff *skb) | |||
117 | { | 117 | { |
118 | return secure_tcpv6_sequence_number(ipv6_hdr(skb)->daddr.s6_addr32, | 118 | return secure_tcpv6_sequence_number(ipv6_hdr(skb)->daddr.s6_addr32, |
119 | ipv6_hdr(skb)->saddr.s6_addr32, | 119 | ipv6_hdr(skb)->saddr.s6_addr32, |
120 | skb->h.th->dest, | 120 | tcp_hdr(skb)->dest, |
121 | skb->h.th->source); | 121 | tcp_hdr(skb)->source); |
122 | } | 122 | } |
123 | 123 | ||
124 | static int tcp_v6_connect(struct sock *sk, struct sockaddr *uaddr, | 124 | static int tcp_v6_connect(struct sock *sk, struct sockaddr *uaddr, |
@@ -509,7 +509,7 @@ static int tcp_v6_send_synack(struct sock *sk, struct request_sock *req, | |||
509 | 509 | ||
510 | skb = tcp_make_synack(sk, dst, req); | 510 | skb = tcp_make_synack(sk, dst, req); |
511 | if (skb) { | 511 | if (skb) { |
512 | struct tcphdr *th = skb->h.th; | 512 | struct tcphdr *th = tcp_hdr(skb); |
513 | 513 | ||
514 | th->check = tcp_v6_check(th, skb->len, | 514 | th->check = tcp_v6_check(th, skb->len, |
515 | &treq->loc_addr, &treq->rmt_addr, | 515 | &treq->loc_addr, &treq->rmt_addr, |
@@ -838,7 +838,7 @@ static int tcp_v6_inbound_md5_hash (struct sock *sk, struct sk_buff *skb) | |||
838 | __u8 *hash_location = NULL; | 838 | __u8 *hash_location = NULL; |
839 | struct tcp_md5sig_key *hash_expected; | 839 | struct tcp_md5sig_key *hash_expected; |
840 | struct ipv6hdr *ip6h = ipv6_hdr(skb); | 840 | struct ipv6hdr *ip6h = ipv6_hdr(skb); |
841 | struct tcphdr *th = skb->h.th; | 841 | struct tcphdr *th = tcp_hdr(skb); |
842 | int length = (th->doff << 2) - sizeof (*th); | 842 | int length = (th->doff << 2) - sizeof (*th); |
843 | int genhash; | 843 | int genhash; |
844 | u8 *ptr; | 844 | u8 *ptr; |
@@ -946,7 +946,7 @@ static struct timewait_sock_ops tcp6_timewait_sock_ops = { | |||
946 | static void tcp_v6_send_check(struct sock *sk, int len, struct sk_buff *skb) | 946 | static void tcp_v6_send_check(struct sock *sk, int len, struct sk_buff *skb) |
947 | { | 947 | { |
948 | struct ipv6_pinfo *np = inet6_sk(sk); | 948 | struct ipv6_pinfo *np = inet6_sk(sk); |
949 | struct tcphdr *th = skb->h.th; | 949 | struct tcphdr *th = tcp_hdr(skb); |
950 | 950 | ||
951 | if (skb->ip_summed == CHECKSUM_PARTIAL) { | 951 | if (skb->ip_summed == CHECKSUM_PARTIAL) { |
952 | th->check = ~csum_ipv6_magic(&np->saddr, &np->daddr, len, IPPROTO_TCP, 0); | 952 | th->check = ~csum_ipv6_magic(&np->saddr, &np->daddr, len, IPPROTO_TCP, 0); |
@@ -967,7 +967,7 @@ static int tcp_v6_gso_send_check(struct sk_buff *skb) | |||
967 | return -EINVAL; | 967 | return -EINVAL; |
968 | 968 | ||
969 | ipv6h = ipv6_hdr(skb); | 969 | ipv6h = ipv6_hdr(skb); |
970 | th = skb->h.th; | 970 | th = tcp_hdr(skb); |
971 | 971 | ||
972 | th->check = 0; | 972 | th->check = 0; |
973 | th->check = ~csum_ipv6_magic(&ipv6h->saddr, &ipv6h->daddr, skb->len, | 973 | th->check = ~csum_ipv6_magic(&ipv6h->saddr, &ipv6h->daddr, skb->len, |
@@ -979,7 +979,7 @@ static int tcp_v6_gso_send_check(struct sk_buff *skb) | |||
979 | 979 | ||
980 | static void tcp_v6_send_reset(struct sock *sk, struct sk_buff *skb) | 980 | static void tcp_v6_send_reset(struct sock *sk, struct sk_buff *skb) |
981 | { | 981 | { |
982 | struct tcphdr *th = skb->h.th, *t1; | 982 | struct tcphdr *th = tcp_hdr(skb), *t1; |
983 | struct sk_buff *buff; | 983 | struct sk_buff *buff; |
984 | struct flowi fl; | 984 | struct flowi fl; |
985 | int tot_len = sizeof(*th); | 985 | int tot_len = sizeof(*th); |
@@ -1079,7 +1079,7 @@ static void tcp_v6_send_reset(struct sock *sk, struct sk_buff *skb) | |||
1079 | static void tcp_v6_send_ack(struct tcp_timewait_sock *tw, | 1079 | static void tcp_v6_send_ack(struct tcp_timewait_sock *tw, |
1080 | struct sk_buff *skb, u32 seq, u32 ack, u32 win, u32 ts) | 1080 | struct sk_buff *skb, u32 seq, u32 ack, u32 win, u32 ts) |
1081 | { | 1081 | { |
1082 | struct tcphdr *th = skb->h.th, *t1; | 1082 | struct tcphdr *th = tcp_hdr(skb), *t1; |
1083 | struct sk_buff *buff; | 1083 | struct sk_buff *buff; |
1084 | struct flowi fl; | 1084 | struct flowi fl; |
1085 | int tot_len = sizeof(struct tcphdr); | 1085 | int tot_len = sizeof(struct tcphdr); |
@@ -1195,7 +1195,7 @@ static void tcp_v6_reqsk_send_ack(struct sk_buff *skb, struct request_sock *req) | |||
1195 | static struct sock *tcp_v6_hnd_req(struct sock *sk,struct sk_buff *skb) | 1195 | static struct sock *tcp_v6_hnd_req(struct sock *sk,struct sk_buff *skb) |
1196 | { | 1196 | { |
1197 | struct request_sock *req, **prev; | 1197 | struct request_sock *req, **prev; |
1198 | const struct tcphdr *th = skb->h.th; | 1198 | const struct tcphdr *th = tcp_hdr(skb); |
1199 | struct sock *nsk; | 1199 | struct sock *nsk; |
1200 | 1200 | ||
1201 | /* Find possible connection requests. */ | 1201 | /* Find possible connection requests. */ |
@@ -1275,7 +1275,7 @@ static int tcp_v6_conn_request(struct sock *sk, struct sk_buff *skb) | |||
1275 | treq = inet6_rsk(req); | 1275 | treq = inet6_rsk(req); |
1276 | ipv6_addr_copy(&treq->rmt_addr, &ipv6_hdr(skb)->saddr); | 1276 | ipv6_addr_copy(&treq->rmt_addr, &ipv6_hdr(skb)->saddr); |
1277 | ipv6_addr_copy(&treq->loc_addr, &ipv6_hdr(skb)->daddr); | 1277 | ipv6_addr_copy(&treq->loc_addr, &ipv6_hdr(skb)->daddr); |
1278 | TCP_ECN_create_request(req, skb->h.th); | 1278 | TCP_ECN_create_request(req, tcp_hdr(skb)); |
1279 | treq->pktopts = NULL; | 1279 | treq->pktopts = NULL; |
1280 | if (ipv6_opt_accepted(sk, skb) || | 1280 | if (ipv6_opt_accepted(sk, skb) || |
1281 | np->rxopt.bits.rxinfo || np->rxopt.bits.rxoinfo || | 1281 | np->rxopt.bits.rxinfo || np->rxopt.bits.rxoinfo || |
@@ -1528,14 +1528,14 @@ out: | |||
1528 | static __sum16 tcp_v6_checksum_init(struct sk_buff *skb) | 1528 | static __sum16 tcp_v6_checksum_init(struct sk_buff *skb) |
1529 | { | 1529 | { |
1530 | if (skb->ip_summed == CHECKSUM_COMPLETE) { | 1530 | if (skb->ip_summed == CHECKSUM_COMPLETE) { |
1531 | if (!tcp_v6_check(skb->h.th, skb->len, &ipv6_hdr(skb)->saddr, | 1531 | if (!tcp_v6_check(tcp_hdr(skb), skb->len, &ipv6_hdr(skb)->saddr, |
1532 | &ipv6_hdr(skb)->daddr, skb->csum)) { | 1532 | &ipv6_hdr(skb)->daddr, skb->csum)) { |
1533 | skb->ip_summed = CHECKSUM_UNNECESSARY; | 1533 | skb->ip_summed = CHECKSUM_UNNECESSARY; |
1534 | return 0; | 1534 | return 0; |
1535 | } | 1535 | } |
1536 | } | 1536 | } |
1537 | 1537 | ||
1538 | skb->csum = ~csum_unfold(tcp_v6_check(skb->h.th, skb->len, | 1538 | skb->csum = ~csum_unfold(tcp_v6_check(tcp_hdr(skb), skb->len, |
1539 | &ipv6_hdr(skb)->saddr, | 1539 | &ipv6_hdr(skb)->saddr, |
1540 | &ipv6_hdr(skb)->daddr, 0)); | 1540 | &ipv6_hdr(skb)->daddr, 0)); |
1541 | 1541 | ||
@@ -1601,7 +1601,7 @@ static int tcp_v6_do_rcv(struct sock *sk, struct sk_buff *skb) | |||
1601 | 1601 | ||
1602 | if (sk->sk_state == TCP_ESTABLISHED) { /* Fast path */ | 1602 | if (sk->sk_state == TCP_ESTABLISHED) { /* Fast path */ |
1603 | TCP_CHECK_TIMER(sk); | 1603 | TCP_CHECK_TIMER(sk); |
1604 | if (tcp_rcv_established(sk, skb, skb->h.th, skb->len)) | 1604 | if (tcp_rcv_established(sk, skb, tcp_hdr(skb), skb->len)) |
1605 | goto reset; | 1605 | goto reset; |
1606 | TCP_CHECK_TIMER(sk); | 1606 | TCP_CHECK_TIMER(sk); |
1607 | if (opt_skb) | 1607 | if (opt_skb) |
@@ -1632,7 +1632,7 @@ static int tcp_v6_do_rcv(struct sock *sk, struct sk_buff *skb) | |||
1632 | } | 1632 | } |
1633 | 1633 | ||
1634 | TCP_CHECK_TIMER(sk); | 1634 | TCP_CHECK_TIMER(sk); |
1635 | if (tcp_rcv_state_process(sk, skb, skb->h.th, skb->len)) | 1635 | if (tcp_rcv_state_process(sk, skb, tcp_hdr(skb), skb->len)) |
1636 | goto reset; | 1636 | goto reset; |
1637 | TCP_CHECK_TIMER(sk); | 1637 | TCP_CHECK_TIMER(sk); |
1638 | if (opt_skb) | 1638 | if (opt_skb) |
@@ -1698,7 +1698,7 @@ static int tcp_v6_rcv(struct sk_buff **pskb) | |||
1698 | if (!pskb_may_pull(skb, sizeof(struct tcphdr))) | 1698 | if (!pskb_may_pull(skb, sizeof(struct tcphdr))) |
1699 | goto discard_it; | 1699 | goto discard_it; |
1700 | 1700 | ||
1701 | th = skb->h.th; | 1701 | th = tcp_hdr(skb); |
1702 | 1702 | ||
1703 | if (th->doff < sizeof(struct tcphdr)/4) | 1703 | if (th->doff < sizeof(struct tcphdr)/4) |
1704 | goto bad_packet; | 1704 | goto bad_packet; |
@@ -1709,7 +1709,7 @@ static int tcp_v6_rcv(struct sk_buff **pskb) | |||
1709 | tcp_v6_checksum_init(skb))) | 1709 | tcp_v6_checksum_init(skb))) |
1710 | goto bad_packet; | 1710 | goto bad_packet; |
1711 | 1711 | ||
1712 | th = skb->h.th; | 1712 | th = tcp_hdr(skb); |
1713 | TCP_SKB_CB(skb)->seq = ntohl(th->seq); | 1713 | TCP_SKB_CB(skb)->seq = ntohl(th->seq); |
1714 | TCP_SKB_CB(skb)->end_seq = (TCP_SKB_CB(skb)->seq + th->syn + th->fin + | 1714 | TCP_SKB_CB(skb)->end_seq = (TCP_SKB_CB(skb)->seq + th->syn + th->fin + |
1715 | skb->len - th->doff*4); | 1715 | skb->len - th->doff*4); |