Skip to content

Commit

Permalink
bgpd: Do not show TCP MSS if the socket is broken
Browse files Browse the repository at this point in the history
Just avoid calling for TCP MSS socket option if it's not in use.

Signed-off-by: Donatas Abraitis <[email protected]>
(cherry picked from commit 6549755)
  • Loading branch information
ton31337 authored and mergify[bot] committed Feb 8, 2024
1 parent da5aeee commit 0c679ff
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/sockopt.c
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,9 @@ int sockopt_tcp_mss_get(int sock)
int tcp_maxseg = 0;
socklen_t tcp_maxseg_len = sizeof(tcp_maxseg);

if (sock < 0)
return 0;

ret = getsockopt(sock, IPPROTO_TCP, TCP_MAXSEG, &tcp_maxseg,
&tcp_maxseg_len);
if (ret != 0) {
Expand Down

0 comments on commit 0c679ff

Please sign in to comment.