diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 04:24:31 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 04:24:31 +0000 |
commit | acb594b1d825c6e12369cebb941968ec08c840ce (patch) | |
tree | d544788908e7353a4f117e2991f15f4236a0c963 /lib/sockopt.c | |
parent | Adding upstream version 9.1. (diff) | |
download | frr-acb594b1d825c6e12369cebb941968ec08c840ce.tar.xz frr-acb594b1d825c6e12369cebb941968ec08c840ce.zip |
Adding upstream version 10.0.upstream/10.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'lib/sockopt.c')
-rw-r--r-- | lib/sockopt.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/sockopt.c b/lib/sockopt.c index 41fcc41..74bc034 100644 --- a/lib/sockopt.c +++ b/lib/sockopt.c @@ -10,13 +10,12 @@ #include "sockunion.h" #include "lib_errors.h" -#if (defined(__FreeBSD__) \ - && ((__FreeBSD_version >= 500022 && __FreeBSD_version < 700000) \ - || (__FreeBSD_version < 500000 && __FreeBSD_version >= 440000))) \ - || (defined(__NetBSD__) && defined(__NetBSD_Version__) \ - && __NetBSD_Version__ >= 106010000) \ - || defined(__OpenBSD__) || defined(__APPLE__) \ - || defined(__DragonFly__) || defined(__sun) +#if (defined(__FreeBSD__) && \ + ((__FreeBSD_version >= 500022 && __FreeBSD_version < 700000) || \ + (__FreeBSD_version < 500000 && __FreeBSD_version >= 440000))) || \ + (defined(__NetBSD__) && defined(__NetBSD_Version__) && \ + __NetBSD_Version__ >= 106010000) || \ + defined(__OpenBSD__) || defined(__DragonFly__) || defined(__sun) #define HAVE_BSD_STRUCT_IP_MREQ_HACK #endif @@ -673,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) { |