Signed-off-by: Laurent Vivier
---
tcp.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/tcp.c b/tcp.c
index a6f43010f58f..c274ea6c4ca4 100644
--- a/tcp.c
+++ b/tcp.c
@@ -1804,6 +1804,14 @@ static int tcp_conn_new_sock(const struct ctx *c, sa_family_t af)
return s;
}
+static uint16_t tcp_buf_conn_tap_mss(const struct tcp_tap_conn *conn)
+{
+ if (CONN_V4(conn))
+ return MSS4;
+
+ return MSS6;
+}
+
/**
* tcp_conn_sock() - Obtain a connectable socket in the host/init namespace
* @c: Execution context
@@ -1849,10 +1857,7 @@ static uint16_t tcp_conn_tap_mss(const struct tcp_tap_conn *conn,
else
mss = ret;
- if (CONN_V4(conn))
- mss = MIN(MSS4, mss);
- else
- mss = MIN(MSS6, mss);
+ mss = MIN(tcp_buf_conn_tap_mss(conn), mss);
return MIN(mss, USHRT_MAX);
}
--
2.44.0