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/ipv4/tcp.c | |
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/ipv4/tcp.c')
-rw-r--r-- | net/ipv4/tcp.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 689f9330f1b9..f832f3c33ab1 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c | |||
@@ -425,7 +425,7 @@ int tcp_ioctl(struct sock *sk, int cmd, unsigned long arg) | |||
425 | /* Subtract 1, if FIN is in queue. */ | 425 | /* Subtract 1, if FIN is in queue. */ |
426 | if (answ && !skb_queue_empty(&sk->sk_receive_queue)) | 426 | if (answ && !skb_queue_empty(&sk->sk_receive_queue)) |
427 | answ -= | 427 | answ -= |
428 | ((struct sk_buff *)sk->sk_receive_queue.prev)->h.th->fin; | 428 | tcp_hdr((struct sk_buff *)sk->sk_receive_queue.prev)->fin; |
429 | } else | 429 | } else |
430 | answ = tp->urg_seq - tp->copied_seq; | 430 | answ = tp->urg_seq - tp->copied_seq; |
431 | release_sock(sk); | 431 | release_sock(sk); |
@@ -1016,9 +1016,9 @@ static inline struct sk_buff *tcp_recv_skb(struct sock *sk, u32 seq, u32 *off) | |||
1016 | 1016 | ||
1017 | skb_queue_walk(&sk->sk_receive_queue, skb) { | 1017 | skb_queue_walk(&sk->sk_receive_queue, skb) { |
1018 | offset = seq - TCP_SKB_CB(skb)->seq; | 1018 | offset = seq - TCP_SKB_CB(skb)->seq; |
1019 | if (skb->h.th->syn) | 1019 | if (tcp_hdr(skb)->syn) |
1020 | offset--; | 1020 | offset--; |
1021 | if (offset < skb->len || skb->h.th->fin) { | 1021 | if (offset < skb->len || tcp_hdr(skb)->fin) { |
1022 | *off = offset; | 1022 | *off = offset; |
1023 | return skb; | 1023 | return skb; |
1024 | } | 1024 | } |
@@ -1070,7 +1070,7 @@ int tcp_read_sock(struct sock *sk, read_descriptor_t *desc, | |||
1070 | if (offset != skb->len) | 1070 | if (offset != skb->len) |
1071 | break; | 1071 | break; |
1072 | } | 1072 | } |
1073 | if (skb->h.th->fin) { | 1073 | if (tcp_hdr(skb)->fin) { |
1074 | sk_eat_skb(sk, skb, 0); | 1074 | sk_eat_skb(sk, skb, 0); |
1075 | ++seq; | 1075 | ++seq; |
1076 | break; | 1076 | break; |
@@ -1174,11 +1174,11 @@ int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | |||
1174 | break; | 1174 | break; |
1175 | } | 1175 | } |
1176 | offset = *seq - TCP_SKB_CB(skb)->seq; | 1176 | offset = *seq - TCP_SKB_CB(skb)->seq; |
1177 | if (skb->h.th->syn) | 1177 | if (tcp_hdr(skb)->syn) |
1178 | offset--; | 1178 | offset--; |
1179 | if (offset < skb->len) | 1179 | if (offset < skb->len) |
1180 | goto found_ok_skb; | 1180 | goto found_ok_skb; |
1181 | if (skb->h.th->fin) | 1181 | if (tcp_hdr(skb)->fin) |
1182 | goto found_fin_ok; | 1182 | goto found_fin_ok; |
1183 | BUG_TRAP(flags & MSG_PEEK); | 1183 | BUG_TRAP(flags & MSG_PEEK); |
1184 | skb = skb->next; | 1184 | skb = skb->next; |
@@ -1394,7 +1394,7 @@ skip_copy: | |||
1394 | if (used + offset < skb->len) | 1394 | if (used + offset < skb->len) |
1395 | continue; | 1395 | continue; |
1396 | 1396 | ||
1397 | if (skb->h.th->fin) | 1397 | if (tcp_hdr(skb)->fin) |
1398 | goto found_fin_ok; | 1398 | goto found_fin_ok; |
1399 | if (!(flags & MSG_PEEK)) { | 1399 | if (!(flags & MSG_PEEK)) { |
1400 | sk_eat_skb(sk, skb, copied_early); | 1400 | sk_eat_skb(sk, skb, copied_early); |
@@ -1563,7 +1563,7 @@ void tcp_close(struct sock *sk, long timeout) | |||
1563 | */ | 1563 | */ |
1564 | while ((skb = __skb_dequeue(&sk->sk_receive_queue)) != NULL) { | 1564 | while ((skb = __skb_dequeue(&sk->sk_receive_queue)) != NULL) { |
1565 | u32 len = TCP_SKB_CB(skb)->end_seq - TCP_SKB_CB(skb)->seq - | 1565 | u32 len = TCP_SKB_CB(skb)->end_seq - TCP_SKB_CB(skb)->seq - |
1566 | skb->h.th->fin; | 1566 | tcp_hdr(skb)->fin; |
1567 | data_was_unread += len; | 1567 | data_was_unread += len; |
1568 | __kfree_skb(skb); | 1568 | __kfree_skb(skb); |
1569 | } | 1569 | } |
@@ -2170,7 +2170,7 @@ struct sk_buff *tcp_tso_segment(struct sk_buff *skb, int features) | |||
2170 | if (!pskb_may_pull(skb, sizeof(*th))) | 2170 | if (!pskb_may_pull(skb, sizeof(*th))) |
2171 | goto out; | 2171 | goto out; |
2172 | 2172 | ||
2173 | th = skb->h.th; | 2173 | th = tcp_hdr(skb); |
2174 | thlen = th->doff * 4; | 2174 | thlen = th->doff * 4; |
2175 | if (thlen < sizeof(*th)) | 2175 | if (thlen < sizeof(*th)) |
2176 | goto out; | 2176 | goto out; |
@@ -2210,7 +2210,7 @@ struct sk_buff *tcp_tso_segment(struct sk_buff *skb, int features) | |||
2210 | delta = htonl(oldlen + (thlen + len)); | 2210 | delta = htonl(oldlen + (thlen + len)); |
2211 | 2211 | ||
2212 | skb = segs; | 2212 | skb = segs; |
2213 | th = skb->h.th; | 2213 | th = tcp_hdr(skb); |
2214 | seq = ntohl(th->seq); | 2214 | seq = ntohl(th->seq); |
2215 | 2215 | ||
2216 | do { | 2216 | do { |
@@ -2224,7 +2224,7 @@ struct sk_buff *tcp_tso_segment(struct sk_buff *skb, int features) | |||
2224 | 2224 | ||
2225 | seq += len; | 2225 | seq += len; |
2226 | skb = skb->next; | 2226 | skb = skb->next; |
2227 | th = skb->h.th; | 2227 | th = tcp_hdr(skb); |
2228 | 2228 | ||
2229 | th->seq = htonl(seq); | 2229 | th->seq = htonl(seq); |
2230 | th->cwr = 0; | 2230 | th->cwr = 0; |