aboutgitcodebugslistschat
path: root/tcp.c
diff options
context:
space:
mode:
Diffstat (limited to 'tcp.c')
-rw-r--r--tcp.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/tcp.c b/tcp.c
index b36d1f1..9827302 100644
--- a/tcp.c
+++ b/tcp.c
@@ -1786,6 +1786,10 @@ static int tcp_data_from_tap(const struct ctx *c, struct tcp_tap_conn *conn,
tcp_send_flag(c, conn, ACK);
tcp_timer_ctl(c, conn);
+ if (setsockopt(conn->sock, SOL_SOCKET, SO_KEEPALIVE,
+ &((int){ 1 }), sizeof(int)))
+ flow_trace(conn, "failed to set SO_KEEPALIVE");
+
if (p->count == 1) {
tcp_tap_window_update(c, conn,
ntohs(th->window));