Skip to content

Commit

Permalink
Merge pull request #15325 from opensourcerouting/fix/show_getsockopt
Browse files Browse the repository at this point in the history
bgpd: Do not show TCP MSS if the socket is broken
  • Loading branch information
donaldsharp authored Feb 8, 2024
2 parents 9e42c61 + 6549755 commit fcf1ab9
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 fcf1ab9

Please sign in to comment.