aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_input.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2007-04-11 00:04:22 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-04-26 01:25:26 -0400
commitaa8223c7bb0b05183e1737881ed21827aa5b9e73 (patch)
tree05c9832326edfeb878472f15cf8133ed9f014cdf /net/ipv4/tcp_input.c
parentab6a5bb6b28a970104a34f0f6959b73cf61bdc72 (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_input.c')
-rw-r--r--net/ipv4/tcp_input.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 2776a8b01339..c1ce36237380 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -148,7 +148,7 @@ static void tcp_measure_rcv_mss(struct sock *sk,
148 * to handle super-low mtu links fairly. 148 * to handle super-low mtu links fairly.
149 */ 149 */
150 (len >= TCP_MIN_MSS + sizeof(struct tcphdr) && 150 (len >= TCP_MIN_MSS + sizeof(struct tcphdr) &&
151 !(tcp_flag_word(skb->h.th)&TCP_REMNANT))) { 151 !(tcp_flag_word(tcp_hdr(skb)) & TCP_REMNANT))) {
152 /* Subtract also invariant (if peer is RFC compliant), 152 /* Subtract also invariant (if peer is RFC compliant),
153 * tcp header plus fixed timestamp option length. 153 * tcp header plus fixed timestamp option length.
154 * Resulting "len" is MSS free of SACK jitter. 154 * Resulting "len" is MSS free of SACK jitter.
@@ -2559,9 +2559,9 @@ static int tcp_ack_update_window(struct sock *sk, struct tcp_sock *tp,
2559 struct sk_buff *skb, u32 ack, u32 ack_seq) 2559 struct sk_buff *skb, u32 ack, u32 ack_seq)
2560{ 2560{
2561 int flag = 0; 2561 int flag = 0;
2562 u32 nwin = ntohs(skb->h.th->window); 2562 u32 nwin = ntohs(tcp_hdr(skb)->window);
2563 2563
2564 if (likely(!skb->h.th->syn)) 2564 if (likely(!tcp_hdr(skb)->syn))
2565 nwin <<= tp->rx_opt.snd_wscale; 2565 nwin <<= tp->rx_opt.snd_wscale;
2566 2566
2567 if (tcp_may_update_window(tp, ack, ack_seq, nwin)) { 2567 if (tcp_may_update_window(tp, ack, ack_seq, nwin)) {
@@ -2766,7 +2766,7 @@ static int tcp_ack(struct sock *sk, struct sk_buff *skb, int flag)
2766 if (TCP_SKB_CB(skb)->sacked) 2766 if (TCP_SKB_CB(skb)->sacked)
2767 flag |= tcp_sacktag_write_queue(sk, skb, prior_snd_una); 2767 flag |= tcp_sacktag_write_queue(sk, skb, prior_snd_una);
2768 2768
2769 if (TCP_ECN_rcv_ecn_echo(tp, skb->h.th)) 2769 if (TCP_ECN_rcv_ecn_echo(tp, tcp_hdr(skb)))
2770 flag |= FLAG_ECE; 2770 flag |= FLAG_ECE;
2771 2771
2772 tcp_ca_event(sk, CA_EVENT_SLOW_ACK); 2772 tcp_ca_event(sk, CA_EVENT_SLOW_ACK);
@@ -2833,7 +2833,7 @@ uninteresting_ack:
2833void tcp_parse_options(struct sk_buff *skb, struct tcp_options_received *opt_rx, int estab) 2833void tcp_parse_options(struct sk_buff *skb, struct tcp_options_received *opt_rx, int estab)
2834{ 2834{
2835 unsigned char *ptr; 2835 unsigned char *ptr;
2836 struct tcphdr *th = skb->h.th; 2836 struct tcphdr *th = tcp_hdr(skb);
2837 int length=(th->doff*4)-sizeof(struct tcphdr); 2837 int length=(th->doff*4)-sizeof(struct tcphdr);
2838 2838
2839 ptr = (unsigned char *)(th + 1); 2839 ptr = (unsigned char *)(th + 1);
@@ -2995,7 +2995,7 @@ static inline void tcp_replace_ts_recent(struct tcp_sock *tp, u32 seq)
2995static int tcp_disordered_ack(const struct sock *sk, const struct sk_buff *skb) 2995static int tcp_disordered_ack(const struct sock *sk, const struct sk_buff *skb)
2996{ 2996{
2997 struct tcp_sock *tp = tcp_sk(sk); 2997 struct tcp_sock *tp = tcp_sk(sk);
2998 struct tcphdr *th = skb->h.th; 2998 struct tcphdr *th = tcp_hdr(skb);
2999 u32 seq = TCP_SKB_CB(skb)->seq; 2999 u32 seq = TCP_SKB_CB(skb)->seq;
3000 u32 ack = TCP_SKB_CB(skb)->ack_seq; 3000 u32 ack = TCP_SKB_CB(skb)->ack_seq;
3001 3001
@@ -3357,8 +3357,8 @@ static void tcp_ofo_queue(struct sock *sk)
3357 __skb_unlink(skb, &tp->out_of_order_queue); 3357 __skb_unlink(skb, &tp->out_of_order_queue);
3358 __skb_queue_tail(&sk->sk_receive_queue, skb); 3358 __skb_queue_tail(&sk->sk_receive_queue, skb);
3359 tp->rcv_nxt = TCP_SKB_CB(skb)->end_seq; 3359 tp->rcv_nxt = TCP_SKB_CB(skb)->end_seq;
3360 if (skb->h.th->fin) 3360 if (tcp_hdr(skb)->fin)
3361 tcp_fin(skb, sk, skb->h.th); 3361 tcp_fin(skb, sk, tcp_hdr(skb));
3362 } 3362 }
3363} 3363}
3364 3364
@@ -3366,7 +3366,7 @@ static int tcp_prune_queue(struct sock *sk);
3366 3366
3367static void tcp_data_queue(struct sock *sk, struct sk_buff *skb) 3367static void tcp_data_queue(struct sock *sk, struct sk_buff *skb)
3368{ 3368{
3369 struct tcphdr *th = skb->h.th; 3369 struct tcphdr *th = tcp_hdr(skb);
3370 struct tcp_sock *tp = tcp_sk(sk); 3370 struct tcp_sock *tp = tcp_sk(sk);
3371 int eaten = -1; 3371 int eaten = -1;
3372 3372
@@ -3605,7 +3605,7 @@ tcp_collapse(struct sock *sk, struct sk_buff_head *list,
3605 * - bloated or contains data before "start" or 3605 * - bloated or contains data before "start" or
3606 * overlaps to the next one. 3606 * overlaps to the next one.
3607 */ 3607 */
3608 if (!skb->h.th->syn && !skb->h.th->fin && 3608 if (!tcp_hdr(skb)->syn && !tcp_hdr(skb)->fin &&
3609 (tcp_win_from_space(skb->truesize) > skb->len || 3609 (tcp_win_from_space(skb->truesize) > skb->len ||
3610 before(TCP_SKB_CB(skb)->seq, start) || 3610 before(TCP_SKB_CB(skb)->seq, start) ||
3611 (skb->next != tail && 3611 (skb->next != tail &&
@@ -3616,7 +3616,7 @@ tcp_collapse(struct sock *sk, struct sk_buff_head *list,
3616 start = TCP_SKB_CB(skb)->end_seq; 3616 start = TCP_SKB_CB(skb)->end_seq;
3617 skb = skb->next; 3617 skb = skb->next;
3618 } 3618 }
3619 if (skb == tail || skb->h.th->syn || skb->h.th->fin) 3619 if (skb == tail || tcp_hdr(skb)->syn || tcp_hdr(skb)->fin)
3620 return; 3620 return;
3621 3621
3622 while (before(start, end)) { 3622 while (before(start, end)) {
@@ -3665,7 +3665,9 @@ tcp_collapse(struct sock *sk, struct sk_buff_head *list,
3665 __kfree_skb(skb); 3665 __kfree_skb(skb);
3666 NET_INC_STATS_BH(LINUX_MIB_TCPRCVCOLLAPSED); 3666 NET_INC_STATS_BH(LINUX_MIB_TCPRCVCOLLAPSED);
3667 skb = next; 3667 skb = next;
3668 if (skb == tail || skb->h.th->syn || skb->h.th->fin) 3668 if (skb == tail ||
3669 tcp_hdr(skb)->syn ||
3670 tcp_hdr(skb)->fin)
3669 return; 3671 return;
3670 } 3672 }
3671 } 3673 }
@@ -4072,7 +4074,7 @@ static int tcp_dma_try_early_copy(struct sock *sk, struct sk_buff *skb, int hlen
4072 tcp_rcv_space_adjust(sk); 4074 tcp_rcv_space_adjust(sk);
4073 4075
4074 if ((tp->ucopy.len == 0) || 4076 if ((tp->ucopy.len == 0) ||
4075 (tcp_flag_word(skb->h.th) & TCP_FLAG_PSH) || 4077 (tcp_flag_word(tcp_hdr(skb)) & TCP_FLAG_PSH) ||
4076 (atomic_read(&sk->sk_rmem_alloc) > (sk->sk_rcvbuf >> 1))) { 4078 (atomic_read(&sk->sk_rmem_alloc) > (sk->sk_rcvbuf >> 1))) {
4077 tp->ucopy.wakeup = 1; 4079 tp->ucopy.wakeup = 1;
4078 sk->sk_data_ready(sk, 0); 4080 sk->sk_data_ready(sk, 0);