bgpd: Do not show TCP MSS if the socket is broken

Just avoid calling for TCP MSS socket option if it's not in use.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 65497556ed)
This commit is contained in:
Donatas Abraitis 2024-02-07 23:03:37 +02:00 committed by Mergify
parent da5aeee0d6
commit 0c679ffcbe

View File

@ -673,6 +673,9 @@ int sockopt_tcp_mss_get(int sock)
int tcp_maxseg = 0; int tcp_maxseg = 0;
socklen_t tcp_maxseg_len = sizeof(tcp_maxseg); socklen_t tcp_maxseg_len = sizeof(tcp_maxseg);
if (sock < 0)
return 0;
ret = getsockopt(sock, IPPROTO_TCP, TCP_MAXSEG, &tcp_maxseg, ret = getsockopt(sock, IPPROTO_TCP, TCP_MAXSEG, &tcp_maxseg,
&tcp_maxseg_len); &tcp_maxseg_len);
if (ret != 0) { if (ret != 0) {