aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2014-09-05 18:33:32 -0400
committerDavid S. Miller <davem@davemloft.net>2014-09-05 20:49:33 -0400
commit04317dafd11dd7b0ec19b85f098414abae6ed5f7 (patch)
tree3e9a5c6b3aea2e8b1f519d031fb0fcfa4af970fb
parent2ba38943ba190eb6a494262003e23187d1b40fb4 (diff)
tcp: introduce TCP_SKB_CB(skb)->tcp_tw_isn
TCP_SKB_CB(skb)->when has different meaning in output and input paths. In output path, it contains a timestamp. In input path, it contains an ISN, chosen by tcp_timewait_state_process() Lets add a different name to ease code comprehension. Note that 'when' field will disappear in following patch, as skb_mstamp already contains timestamp, the anonymous union will promptly disappear as well. Signed-off-by: Eric Dumazet <edumazet@google.com> Acked-by: Yuchung Cheng <ycheng@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--include/net/tcp.h7
-rw-r--r--net/ipv4/tcp_input.c2
-rw-r--r--net/ipv4/tcp_ipv4.c2
-rw-r--r--net/ipv4/tcp_minisocks.c2
-rw-r--r--net/ipv6/tcp_ipv6.c4
5 files changed, 11 insertions, 6 deletions
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 590e01a476ac..0cd7d2c65dc0 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -698,7 +698,12 @@ struct tcp_skb_cb {
698 } header; /* For incoming frames */ 698 } header; /* For incoming frames */
699 __u32 seq; /* Starting sequence number */ 699 __u32 seq; /* Starting sequence number */
700 __u32 end_seq; /* SEQ + FIN + SYN + datalen */ 700 __u32 end_seq; /* SEQ + FIN + SYN + datalen */
701 __u32 when; /* used to compute rtt's */ 701 union {
702 /* used in output path */
703 __u32 when; /* used to compute rtt's */
704 /* used in input path */
705 __u32 tcp_tw_isn; /* isn chosen by tcp_timewait_state_process() */
706 };
702 __u8 tcp_flags; /* TCP header flags. (tcp[13]) */ 707 __u8 tcp_flags; /* TCP header flags. (tcp[13]) */
703 708
704 __u8 sacked; /* State flags for SACK/FACK. */ 709 __u8 sacked; /* State flags for SACK/FACK. */
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index aba4926ca095..9c8b9f1dcf69 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -5906,7 +5906,7 @@ int tcp_conn_request(struct request_sock_ops *rsk_ops,
5906 struct request_sock *req; 5906 struct request_sock *req;
5907 struct tcp_sock *tp = tcp_sk(sk); 5907 struct tcp_sock *tp = tcp_sk(sk);
5908 struct dst_entry *dst = NULL; 5908 struct dst_entry *dst = NULL;
5909 __u32 isn = TCP_SKB_CB(skb)->when; 5909 __u32 isn = TCP_SKB_CB(skb)->tcp_tw_isn;
5910 bool want_cookie = false, fastopen; 5910 bool want_cookie = false, fastopen;
5911 struct flowi fl; 5911 struct flowi fl;
5912 struct tcp_fastopen_cookie foc = { .len = -1 }; 5912 struct tcp_fastopen_cookie foc = { .len = -1 };
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 487e2a41667f..02e6cd29ebf1 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -1627,7 +1627,7 @@ int tcp_v4_rcv(struct sk_buff *skb)
1627 TCP_SKB_CB(skb)->end_seq = (TCP_SKB_CB(skb)->seq + th->syn + th->fin + 1627 TCP_SKB_CB(skb)->end_seq = (TCP_SKB_CB(skb)->seq + th->syn + th->fin +
1628 skb->len - th->doff * 4); 1628 skb->len - th->doff * 4);
1629 TCP_SKB_CB(skb)->ack_seq = ntohl(th->ack_seq); 1629 TCP_SKB_CB(skb)->ack_seq = ntohl(th->ack_seq);
1630 TCP_SKB_CB(skb)->when = 0; 1630 TCP_SKB_CB(skb)->tcp_tw_isn = 0;
1631 TCP_SKB_CB(skb)->ip_dsfield = ipv4_get_dsfield(iph); 1631 TCP_SKB_CB(skb)->ip_dsfield = ipv4_get_dsfield(iph);
1632 TCP_SKB_CB(skb)->sacked = 0; 1632 TCP_SKB_CB(skb)->sacked = 0;
1633 1633
diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c
index 1649988bd1b6..a058f411d3a6 100644
--- a/net/ipv4/tcp_minisocks.c
+++ b/net/ipv4/tcp_minisocks.c
@@ -232,7 +232,7 @@ kill:
232 u32 isn = tcptw->tw_snd_nxt + 65535 + 2; 232 u32 isn = tcptw->tw_snd_nxt + 65535 + 2;
233 if (isn == 0) 233 if (isn == 0)
234 isn++; 234 isn++;
235 TCP_SKB_CB(skb)->when = isn; 235 TCP_SKB_CB(skb)->tcp_tw_isn = isn;
236 return TCP_TW_SYN; 236 return TCP_TW_SYN;
237 } 237 }
238 238
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index 29964c3d363c..5b3c70ff7a72 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -738,7 +738,7 @@ static void tcp_v6_init_req(struct request_sock *req, struct sock *sk,
738 ipv6_addr_type(&ireq->ir_v6_rmt_addr) & IPV6_ADDR_LINKLOCAL) 738 ipv6_addr_type(&ireq->ir_v6_rmt_addr) & IPV6_ADDR_LINKLOCAL)
739 ireq->ir_iif = inet6_iif(skb); 739 ireq->ir_iif = inet6_iif(skb);
740 740
741 if (!TCP_SKB_CB(skb)->when && 741 if (!TCP_SKB_CB(skb)->tcp_tw_isn &&
742 (ipv6_opt_accepted(sk, skb) || np->rxopt.bits.rxinfo || 742 (ipv6_opt_accepted(sk, skb) || np->rxopt.bits.rxinfo ||
743 np->rxopt.bits.rxoinfo || np->rxopt.bits.rxhlim || 743 np->rxopt.bits.rxoinfo || np->rxopt.bits.rxhlim ||
744 np->rxopt.bits.rxohlim || np->repflow)) { 744 np->rxopt.bits.rxohlim || np->repflow)) {
@@ -1412,7 +1412,7 @@ static int tcp_v6_rcv(struct sk_buff *skb)
1412 TCP_SKB_CB(skb)->end_seq = (TCP_SKB_CB(skb)->seq + th->syn + th->fin + 1412 TCP_SKB_CB(skb)->end_seq = (TCP_SKB_CB(skb)->seq + th->syn + th->fin +
1413 skb->len - th->doff*4); 1413 skb->len - th->doff*4);
1414 TCP_SKB_CB(skb)->ack_seq = ntohl(th->ack_seq); 1414 TCP_SKB_CB(skb)->ack_seq = ntohl(th->ack_seq);
1415 TCP_SKB_CB(skb)->when = 0; 1415 TCP_SKB_CB(skb)->tcp_tw_isn = 0;
1416 TCP_SKB_CB(skb)->ip_dsfield = ipv6_get_dsfield(hdr); 1416 TCP_SKB_CB(skb)->ip_dsfield = ipv6_get_dsfield(hdr);
1417 TCP_SKB_CB(skb)->sacked = 0; 1417 TCP_SKB_CB(skb)->sacked = 0;
1418 1418