path: root/include/net/tcp.h
diff options
authorEric Dumazet <edumazet@google.com>2019-06-13 21:22:35 -0700
committerDavid S. Miller <davem@davemloft.net>2019-06-14 19:51:12 -0700
commitd6fb396cfaa71afc9f38d573b8ec6409fe3716de (patch)
tree81f13c19c7e214129cb08ef7301b4941f435b52f /include/net/tcp.h
parentnet: remove empty netlink_tap_exit_net (diff)
ipv4: tcp: fix ACK/RST sent with a transmit delay
If we want to set a EDT time for the skb we want to send via ip_send_unicast_reply(), we have to pass a new parameter and initialize ipc.sockc.transmit_time with it. This fixes the EDT time for ACK/RST packets sent on behalf of a TIME_WAIT socket. Fixes: a842fe1425cb ("tcp: add optional per socket transmit delay") Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
1 files changed, 6 insertions, 3 deletions
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 49a178b8d5b2..96e0e53ff440 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -2240,15 +2240,18 @@ static inline void tcp_add_tx_delay(struct sk_buff *skb,
skb->skb_mstamp_ns += (u64)tp->tcp_tx_delay * NSEC_PER_USEC;
-static inline void tcp_set_tx_time(struct sk_buff *skb,
- const struct sock *sk)
+/* Compute Earliest Departure Time for some control packets
+ * like ACK or RST for TIME_WAIT or non ESTABLISHED sockets.
+ */
+static inline u64 tcp_transmit_time(const struct sock *sk)
if (static_branch_unlikely(&tcp_tx_delay_enabled)) {
u32 delay = (sk->sk_state == TCP_TIME_WAIT) ?
tcp_twsk(sk)->tw_tx_delay : tcp_sk(sk)->tcp_tx_delay;
- skb->skb_mstamp_ns = tcp_clock_ns() + (u64)delay * NSEC_PER_USEC;
+ return tcp_clock_ns() + (u64)delay * NSEC_PER_USEC;
+ return 0;
#endif /* _TCP_H */