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]>
  • Loading branch information
ton31337 committed Feb 7, 2024
1 parent 7fe05d6 commit 6549755
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 @@ -672,6 +672,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 6549755

Please sign in to comment.