aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_input.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2007-04-25 21:04:18 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-04-26 01:25:31 -0400
commit9c70220b73908f64792422a2c39c593c4792f2c5 (patch)
tree2090ea10aaa2714a5e095bae8cc02e743c378a3a /net/ipv4/tcp_input.c
parenta27ef749e7be3b06fb58df53d94eb97a21f18707 (diff)
[SK_BUFF]: Introduce skb_transport_header(skb)
For the places where we need a pointer to the transport header, it is still legal to touch skb->h.raw directly if just adding to, subtracting from or setting it to another layer header. 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.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index c1ce36237380..9c3b4c7a50ad 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -140,7 +140,7 @@ static void tcp_measure_rcv_mss(struct sock *sk,
140 * 140 *
141 * "len" is invariant segment length, including TCP header. 141 * "len" is invariant segment length, including TCP header.
142 */ 142 */
143 len += skb->data - skb->h.raw; 143 len += skb->data - skb_transport_header(skb);
144 if (len >= TCP_MIN_RCVMSS + sizeof(struct tcphdr) || 144 if (len >= TCP_MIN_RCVMSS + sizeof(struct tcphdr) ||
145 /* If PSH is not set, packet should be 145 /* If PSH is not set, packet should be
146 * full sized, provided peer TCP is not badly broken. 146 * full sized, provided peer TCP is not badly broken.
@@ -940,7 +940,8 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb, u32 prior_snd_
940{ 940{
941 const struct inet_connection_sock *icsk = inet_csk(sk); 941 const struct inet_connection_sock *icsk = inet_csk(sk);
942 struct tcp_sock *tp = tcp_sk(sk); 942 struct tcp_sock *tp = tcp_sk(sk);
943 unsigned char *ptr = ack_skb->h.raw + TCP_SKB_CB(ack_skb)->sacked; 943 unsigned char *ptr = (skb_transport_header(ack_skb) +
944 TCP_SKB_CB(ack_skb)->sacked);
944 struct tcp_sack_block_wire *sp = (struct tcp_sack_block_wire *)(ptr+2); 945 struct tcp_sack_block_wire *sp = (struct tcp_sack_block_wire *)(ptr+2);
945 struct sk_buff *cached_skb; 946 struct sk_buff *cached_skb;
946 int num_sacks = (ptr[1] - TCPOLEN_SACK_BASE)>>3; 947 int num_sacks = (ptr[1] - TCPOLEN_SACK_BASE)>>3;
@@ -3634,10 +3635,10 @@ tcp_collapse(struct sock *sk, struct sk_buff_head *list,
3634 return; 3635 return;
3635 3636
3636 skb_set_mac_header(nskb, skb_mac_header(skb) - skb->head); 3637 skb_set_mac_header(nskb, skb_mac_header(skb) - skb->head);
3637 skb_set_network_header(nskb, 3638 skb_set_network_header(nskb, (skb_network_header(skb) -
3638 skb_network_header(skb) - skb->head); 3639 skb->head));
3639 skb_set_transport_header(nskb, skb->h.raw - skb->head); 3640 skb_set_transport_header(nskb, (skb_transport_header(skb) -
3640 3641 skb->head));
3641 skb_reserve(nskb, header); 3642 skb_reserve(nskb, header);
3642 memcpy(nskb->head, skb->head, header); 3643 memcpy(nskb->head, skb->head, header);
3643 memcpy(nskb->cb, skb->cb, sizeof(skb->cb)); 3644 memcpy(nskb->cb, skb->cb, sizeof(skb->cb));