Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package netperfmeter for openSUSE:Factory checked in at 2026-12-02 17:04:57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/netperfmeter (Old) and /work/SRC/openSUSE:Factory/.netperfmeter.new.1340718 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "netperfmeter" Wed Dec 2 17:04:57 2026 rev:15 rq:1402112 version:2.0.18 Changes: -------- --- /work/SRC/openSUSE:Factory/netperfmeter/netperfmeter.changes 2026-11-25 16:13:22.116440284 +0100 +++ /work/SRC/openSUSE:Factory/.netperfmeter.new.1340718/netperfmeter.changes 2026-12-02 17:07:11.074115534 +0100 @@ -1,0 +2,10 @@ +Tue Dec 1 18:29:55 UTC 2026 - Martin Hauke <[email protected]> + +- Update to version 2.0.18 + * Bugfixes: Some QUIC, DCCP, and SCTP parameter handling fixes. + * Bugfix: DCCP default needs to set a frame rate as well. + * A few more fixes. + * Bugfix: Fixed another missing case for MPTCP. + * Bugfix: Also perform graceful shutdown for MPTCP. + +------------------------------------------------------------------- @@ -4 +14 @@ -- Update to version 2.0.16 +- Update to version 2.0.17 Old: ---- netperfmeter-2.0.17.tar.xz netperfmeter-2.0.17.tar.xz.asc New: ---- netperfmeter-2.0.18.tar.xz netperfmeter-2.0.18.tar.xz.asc ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ netperfmeter.spec ++++++ --- /var/tmp/diff_new_pack.9k0g6Q/_old 2026-12-02 17:07:12.645181917 +0100 +++ /var/tmp/diff_new_pack.9k0g6Q/_new 2026-12-02 17:07:12.648182044 +0100 @@ -18,7 +18,7 @@ %define services netperfmeter.service netperfmeter-module-loader.service Name: netperfmeter -Version: 2.0.17 +Version: 2.0.18 Release: 0 Summary: Network performance meter for the UDP, TCP, SCTP and DCCP protocols License: GPL-3.0-or-later ++++++ netperfmeter-2.0.17.tar.xz -> netperfmeter-2.0.18.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/netperfmeter-2.0.17/CMakeLists.txt new/netperfmeter-2.0.18/CMakeLists.txt --- old/netperfmeter-2.0.17/CMakeLists.txt 2026-11-23 14:53:29.000000000 +0100 +++ new/netperfmeter-2.0.18/CMakeLists.txt 2026-11-26 12:22:03.000000000 +0100 @@ -28,7 +28,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 3.10) SET(BUILD_MAJOR "2") SET(BUILD_MINOR "0") -SET(BUILD_PATCH "17") +SET(BUILD_PATCH "18") STRING(REGEX MATCH "^[0-9]+(\\.[0-9]+)?(\\.[0-9]+)?(\\.[0-9]+)?" CMAKE_COMPAT_VERSION "${BUILD_MAJOR}.${BUILD_MINOR}.${BUILD_PATCH}") PROJECT(netperfmeter VERSION "${CMAKE_COMPAT_VERSION}" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/netperfmeter-2.0.17/ChangeLog new/netperfmeter-2.0.18/ChangeLog --- old/netperfmeter-2.0.17/ChangeLog 2026-11-23 14:53:30.000000000 +0100 +++ new/netperfmeter-2.0.18/ChangeLog 2026-11-26 12:22:05.000000000 +0100 @@ -1,3 +1,57 @@ +commit c83c489ef3ddda902999e1955fccd3d6536a9964 +Author: Thomas Dreibholz <[email protected]> +Date: Thu Nov 26 11:17:18 2026 +0100 + + Bugfixes: Some QUIC, DCCP, and SCTP parameter handling fixes. + +commit 95b2b53fead9812282381c015d60d399c77b5a91 +Author: Thomas Dreibholz <[email protected]> +Date: Thu Nov 26 10:49:20 2026 +0100 + + Bugfix: DCCP default needs to set a frame rate as well. + +commit 6707d10eef4abc26ba2e3b229a0cb79c2f0bd3e7 +Author: Thomas Dreibholz <[email protected]> +Date: Wed Nov 25 17:56:33 2026 +0100 + + A few more fixes. + +commit 847c8717c2d124fb5b7290337ed4d46ca16db4f9 +Author: Thomas Dreibholz <[email protected]> +Date: Wed Nov 25 17:37:47 2026 +0100 + + Minor clean-up. + +commit 9eeb0eda35069b2d96cc3b4150ac6ba161ff72fb +Author: Thomas Dreibholz <[email protected]> +Date: Wed Nov 25 17:20:43 2026 +0100 + + Bugfix: Fixed another missing case for MPTCP. + +commit accefacd7f451eba16cd51057a43d63e9e9a2df3 +Author: Thomas Dreibholz <[email protected]> +Date: Wed Nov 25 17:13:25 2026 +0100 + + Bugfix: NetBSD TCP control socket options fix. + +commit 0a29b2cfe55a03ff0d97e71aa309662e221bb4ff +Author: Thomas Dreibholz <[email protected]> +Date: Wed Nov 25 16:44:58 2026 +0100 + + Bugfix: Also perform graceful shutdown for MPTCP. + +commit 76d187befb1dbbc973c06193e28ff0504335e9e8 +Author: Thomas Dreibholz <[email protected]> +Date: Tue Nov 24 09:37:38 2026 +0100 + + Packaging updates. + +commit 768c1b0f8f915c6fae373f6b60d19d3d84d72502 +Author: Thomas Dreibholz <[email protected]> +Date: Mon Nov 23 14:53:31 2026 +0100 + + New release netperfmeter-2.0.17. + commit 7557bb8e08182bf2e67077d8a9f27309b9d55c8b Author: Thomas Dreibholz <[email protected]> Date: Mon Nov 23 14:41:07 2026 +0100 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/netperfmeter-2.0.17/debian/changelog new/netperfmeter-2.0.18/debian/changelog --- old/netperfmeter-2.0.17/debian/changelog 2026-11-23 14:53:29.000000000 +0100 +++ new/netperfmeter-2.0.18/debian/changelog 2026-11-26 12:22:03.000000000 +0100 @@ -1,3 +1,9 @@ +netperfmeter (2.0.18-1ubuntu1) unstable; urgency=medium + + * New upstream release. + + -- Thomas Dreibholz <[email protected]> Thu, 26 Nov 2026 12:22:03 +0100 + netperfmeter (2.0.17-1ubuntu1) unstable; urgency=medium * New upstream release. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/netperfmeter-2.0.17/freebsd/netperfmeter/Makefile new/netperfmeter-2.0.18/freebsd/netperfmeter/Makefile --- old/netperfmeter-2.0.17/freebsd/netperfmeter/Makefile 2026-11-23 14:53:29.000000000 +0100 +++ new/netperfmeter-2.0.18/freebsd/netperfmeter/Makefile 2026-11-26 12:22:03.000000000 +0100 @@ -1,5 +1,5 @@ PORTNAME= netperfmeter -DISTVERSION= 2.0.17 +DISTVERSION= 2.0.18 CATEGORIES= benchmarks MASTER_SITES= https://www.nntb.no/~dreibh/netperfmeter/download/ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/netperfmeter-2.0.17/packaging/APKBUILD new/netperfmeter-2.0.18/packaging/APKBUILD --- old/netperfmeter-2.0.17/packaging/APKBUILD 2026-11-20 13:18:03.000000000 +0100 +++ new/netperfmeter-2.0.18/packaging/APKBUILD 2026-11-24 09:37:10.000000000 +0100 @@ -1,6 +1,6 @@ # Maintainer: Thomas Dreibholz <[email protected]> pkgname=netperfmeter -pkgver=2.0.16 +pkgver=2.0.17 pkgrel=1 pkgdesc="Network performance meter for UDP, TCP, MPTCP, SCTP, DCCP and QUIC protocols" url="https://www.nntb.no/~dreibh/netperfmeter/" @@ -130,5 +130,5 @@ } sha512sums=" -284ac16b2a17cf895e058a05878c95ff77ce02e14b585d633567c27bea1f971bd03011dc5db04266de28dc83a461706c3bfbf44dd5c2546364f6f1c4cd1ffe2d netperfmeter-2.0.16.tar.xz +2291d65f22d5e681bb98e27bb933b93b12528f1455e78a249151fb632c1bc2cde3918f728c6876350d19d5fe355bc24c83fde4fab4789c02eee3dc78ec2712f9 netperfmeter-2.0.17.tar.xz " diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/netperfmeter-2.0.17/packaging/netperfmeter.rb new/netperfmeter-2.0.18/packaging/netperfmeter.rb --- old/netperfmeter-2.0.17/packaging/netperfmeter.rb 2026-11-20 15:26:35.000000000 +0100 +++ new/netperfmeter-2.0.18/packaging/netperfmeter.rb 2026-11-23 15:02:22.000000000 +0100 @@ -1,8 +1,8 @@ class Netperfmeter < Formula desc "Network Performance Meter" homepage "https://www.nntb.no/~dreibh/netperfmeter/" - url "https://www.nntb.no/~dreibh/netperfmeter/download/netperfmeter-2.0.16.tar.xz" - sha256 "086f6fdc9ba68f54393bd80733b6800834ee2fceb16a0d7b325076ef941ed347" + url "https://www.nntb.no/~dreibh/netperfmeter/download/netperfmeter-2.0.17.tar.xz" + sha256 "d0f5b865026fedb79ddab05b64446144129249c5c2d3c31592d7a7512709afa9" license "GPL-3.0-or-later" # Options ON by default (matching FreeBSD OPTIONS_DEFAULT) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/netperfmeter-2.0.17/rpm/netperfmeter.spec new/netperfmeter-2.0.18/rpm/netperfmeter.spec --- old/netperfmeter-2.0.17/rpm/netperfmeter.spec 2026-11-23 14:53:29.000000000 +0100 +++ new/netperfmeter-2.0.18/rpm/netperfmeter.spec 2026-11-26 12:22:03.000000000 +0100 @@ -1,5 +1,5 @@ Name: netperfmeter -Version: 2.0.17 +Version: 2.0.18 Release: 1 Summary: Network performance meter for the UDP, TCP, MPTCP, SCTP, DCCP and QUIC protocols License: GPL-3.0-or-later @@ -344,6 +344,8 @@ %changelog +* Thu Nov 26 2026 Thomas Dreibholz <[email protected]> - 2.0.18-1 +- New upstream release. * Mon Nov 23 2026 Thomas Dreibholz <[email protected]> - 2.0.17-1 - New upstream release. * Fri Nov 20 2026 Thomas Dreibholz <[email protected]> - 2.0.16-1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/netperfmeter-2.0.17/src/flow.cc new/netperfmeter-2.0.18/src/flow.cc --- old/netperfmeter-2.0.17/src/flow.cc 2026-11-20 10:32:52.000000000 +0100 +++ new/netperfmeter-2.0.18/src/flow.cc 2026-11-25 16:44:15.000000000 +0100 @@ -320,7 +320,13 @@ // NOTE: There is only one UDP socket. We cannot close it here! } else { - ext_shutdown(SocketDescriptor, (TrafficSpec.Protocol == IPPROTO_TCP) ? SHUT_WR : SHUT_RDWR); + const bool isTCPOrMPTCP = + (TrafficSpec.Protocol == IPPROTO_TCP) +#if defined(HAVE_MPTCP) + || (TrafficSpec.Protocol == IPPROTO_MPTCP) +#endif + ; + ext_shutdown(SocketDescriptor, isTCPOrMPTCP ? SHUT_WR : SHUT_RDWR); } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/netperfmeter-2.0.17/src/netperfmeter.cc new/netperfmeter-2.0.18/src/netperfmeter.cc --- old/netperfmeter-2.0.17/src/netperfmeter.cc 2026-11-20 10:33:14.000000000 +0100 +++ new/netperfmeter-2.0.18/src/netperfmeter.cc 2026-11-26 11:12:11.000000000 +0100 @@ -847,7 +847,7 @@ n = 15 + 3; } else { - std::cerr << "ERROR: Invalid \"error_on_abort\" setting: " << (const char*)¶meters[4] << "!\n"; + std::cerr << "ERROR: Invalid \"error_on_abort\" setting: " << (const char*)¶meters[15] << "!\n"; exit(1); } } @@ -946,9 +946,9 @@ } congestionControl[i] = 0x00; if( (parameters[3 + i] != ':') && (parameters[3 + i] != 0x00) ) { - std::cerr << "ERROR: Invalid \"cc\" setting: " << (const char*)¶meters[8] + std::cerr << "ERROR: Invalid \"cc\" setting: " << (const char*)¶meters[3] << " - name too long!\n"; - exit(1); + exit(1); } trafficSpec.CongestionControl = std::string((const char*)&congestionControl); n = 3 + strlen((const char*)&congestionControl); @@ -1004,6 +1004,7 @@ #if defined(HAVE_DCCP) case IPPROTO_DCCP: trafficSpec.OutboundFrameSize[0] = 1500 - 40 - 40; // 1420B for IPv6 via 1500B MTU! + trafficSpec.OutboundFrameRate[0] = 25; break; #endif #if defined(HAVE_QUIC) @@ -1046,8 +1047,8 @@ trafficSpec.Protocol = IPPROTO_MPTCP; } if( (trafficSpec.Protocol == IPPROTO_MPTCP) && (trafficSpec.CMT != NPAF_LikeMPTCP) ) { - std::cerr << "WARNING: Invalid \"cmt\" setting: " << (const char*)¶meters[4] - << " for MPTCP! Using default instead!\n"; + std::cerr << "ERROR: Invalid \"cmt\" setting (" << (unsigned int)trafficSpec.CMT + << ") for MPTCP!\n"; exit(1); } #endif @@ -1249,6 +1250,92 @@ } +// ###### Configure TCP control socket keepalive options #################### +static bool configureTCPControlSocket(const int sd, const bool isMPTCP = false) +{ + (void)isMPTCP; + const int noDelayOption = 1; + if(ext_setsockopt(sd, IPPROTO_TCP, TCP_NODELAY, + (const char*)&noDelayOption, sizeof(noDelayOption)) < 0) { + LOG_ERROR + stdlog << format("Unable to set TCP_NODELAY on TCP control socket %d: %s!", + sd, strerror(errno)) << "\n"; + LOG_END + return false; + } + const int keepAliveOption = 1; + if(ext_setsockopt(sd, SOL_SOCKET, SO_KEEPALIVE, + (const char*)&keepAliveOption, sizeof(keepAliveOption)) < 0) { + LOG_ERROR + stdlog << format("Unable to set SO_KEEPALIVE on TCP control socket %d: %s!", + sd, strerror(errno)) << "\n"; + LOG_END + return false; + } +#if defined(TCP_KEEPIDLE) && !defined(__GNU__) + const int keepIdleOption = std::max(1, (int)gControlHBInterval / 1000); // in s + if(ext_setsockopt(sd, IPPROTO_TCP, TCP_KEEPIDLE, + (const char*)&keepIdleOption, sizeof(keepIdleOption)) < 0) { + if((!isMPTCP) || + ((errno != ENOENT) && (errno != ENOPROTOOPT) && (errno != EOPNOTSUPP))) { + LOG_ERROR + stdlog << format("Unable to set TCP_KEEPIDLE on TCP control socket %d: %s!", + sd, strerror(errno)) << "\n"; + LOG_END + return false; + } + LOG_WARNING + stdlog << format("Unable to set TCP_KEEPIDLE on MPTCP control socket %d: %s!", + sd, strerror(errno)) << "\n"; + LOG_END + } +#else +#warning No TCP_KEEPIDLE option available! +#endif +#if defined(TCP_KEEPINTVL) && !defined(__GNU__) + const int keepIntervalOption = std::max(1, (int)gControlHBInterval / 1000); // in s + if(ext_setsockopt(sd, IPPROTO_TCP, TCP_KEEPINTVL, + (const char*)&keepIntervalOption, sizeof(keepIntervalOption)) < 0) { + if((!isMPTCP) || + ((errno != ENOENT) && (errno != ENOPROTOOPT) && (errno != EOPNOTSUPP))) { + LOG_ERROR + stdlog << format("Unable to set TCP_KEEPINTVL on TCP control socket %d: %s!", + sd, strerror(errno)) << "\n"; + LOG_END + return false; + } + LOG_WARNING + stdlog << format("Unable to set TCP_KEEPINTVL on MPTCP control socket %d: %s!", + sd, strerror(errno)) << "\n"; + LOG_END + } +#else +#warning No TCP_KEEPINTVL option available! +#endif +#if defined(TCP_KEEPCNT) && !defined(__GNU__) + const int keepCountOption = (int)gControlHBPathMaxRtx; + if(ext_setsockopt(sd, IPPROTO_TCP, TCP_KEEPCNT, + (const char*)&keepCountOption, sizeof(keepCountOption)) < 0) { + if((!isMPTCP) || + ((errno != ENOENT) && (errno != ENOPROTOOPT) && (errno != EOPNOTSUPP))) { + LOG_ERROR + stdlog << format("Unable to set TCP_KEEPCNT on TCP control socket %d: %s!", + sd, strerror(errno)) << "\n"; + LOG_END + return false; + } + LOG_WARNING + stdlog << format("Unable to set TCP_KEEPCNT on MPTCP control socket %d: %s!", + sd, strerror(errno)) << "\n"; + LOG_END + } +#else +#warning No TCP_KEEPCNT option available! +#endif + return true; +} + + // ###### Initialize pollFD entry in main loop ############################## static void addToPollFDs(pollfd* pollFDs, const int fd, nfds_t& n, int* index = nullptr) { @@ -1379,7 +1466,16 @@ stdlog << format("Accept on TCP control socket %d -> new control connection %d", gControlSocketTCP, newSD) << "\n"; LOG_END - gMessageReader.registerSocket(IPPROTO_TCP, newSD); + if(configureTCPControlSocket(newSD +#if defined(HAVE_MPTCP) + , gPassiveControlMPTCP +#endif + )) { + gMessageReader.registerSocket(IPPROTO_TCP, newSD); + } + else { + ext_close(newSD); + } } else { LOG_ERROR @@ -1397,7 +1493,16 @@ stdlog << format("Accept on TCP6 control socket %d -> new control connection %d", gControlSocketTCP6, newSD) << "\n"; LOG_END - gMessageReader.registerSocket(IPPROTO_TCP, newSD); + if(configureTCPControlSocket(newSD +#if defined(HAVE_MPTCP) + , gPassiveControlMPTCP +#endif + )) { + gMessageReader.registerSocket(IPPROTO_TCP, newSD); + } + else { + ext_close(newSD); + } } else { LOG_ERROR @@ -1567,7 +1672,7 @@ gQUICSocket, newSD) << "\n"; LOG_END LOG_TRACE - stdlog << "server handshake <sd=" << gQUICSocket + stdlog << "server handshake <sd=" << newSD << ", K=" << ((gQUICKey != nullptr) ? gQUICKey : "(none)") << ", C=" << ((gQUICCertificate != nullptr) ? gQUICCertificate : "(none)") << ", CA=" << ((gQUICCA != nullptr) ? gQUICCA : "(none)") @@ -1582,10 +1687,6 @@ if(quicServerHandshake(newSD, ALPN_NETPERFMETER_DATA, gQUICCA, gQUICCertificate, gQUICKey, sessionKey, sessionKeyLength) == 0) { - LOG_TRACE - stdlog << format("Accept on QUIC data socket %d -> new QUIC data connection %d", - gQUICSocket, newSD) << "\n"; - LOG_END FlowManager::getFlowManager()->addUnidentifiedSocket(IPPROTO_QUIC, newSD); } else { @@ -1793,83 +1894,6 @@ localPort + 1, strerror(errno)) << "\n"; LOG_END_FATAL } - const int keepAliveOption = 1; - if(ext_setsockopt(gControlSocketTCP, SOL_SOCKET, SO_KEEPALIVE, - (const char*)&keepAliveOption, sizeof(keepAliveOption)) < 0) { - LOG_ERROR - stdlog << format("Unable to set SO_KEEPALIVE on TCP control socket %d: %s!", - gControlSocketTCP, strerror(errno)) << "\n"; - LOG_END_FATAL - } -#if defined(TCP_KEEPIDLE) && !defined(__GNU__) - const int keepIdleOption = std::max(1, (int)gControlHBInterval / 1000); // in s - if(ext_setsockopt(gControlSocketTCP, IPPROTO_TCP, TCP_KEEPIDLE, - (const char*)&keepIdleOption, sizeof(keepIdleOption)) < 0) { -#if defined(HAVE_MPTCP) - if((!gPassiveControlMPTCP) || - ((errno != ENOENT) && (errno != ENOPROTOOPT) && (errno != EOPNOTSUPP))) { -#endif - LOG_ERROR - stdlog << format("Unable to set TCP_KEEPIDLE on TCP control socket %d: %s!", - gControlSocketTCP, strerror(errno)) << "\n"; - LOG_END_FATAL -#if defined(HAVE_MPTCP) - } - LOG_WARNING - stdlog << format("Unable to set TCP_KEEPIDLE on MPTCP control socket %d: %s!", - gControlSocketTCP, strerror(errno)) << "\n"; - LOG_END -#endif - } -#else -#warning No TCP_KEEPIDLE option available! -#endif -#if defined(TCP_KEEPINTVL) && !defined(__GNU__) - const int keepIntervalOption = std::max(1, (int)gControlHBInterval / 1000); // in s - if(ext_setsockopt(gControlSocketTCP, IPPROTO_TCP, TCP_KEEPINTVL, - (const char*)&keepIntervalOption, sizeof(keepIntervalOption)) < 0) { -#if defined(HAVE_MPTCP) - if((!gPassiveControlMPTCP) || - ((errno != ENOENT) && (errno != ENOPROTOOPT) && (errno != EOPNOTSUPP))) { -#endif - LOG_ERROR - stdlog << format("Unable to set TCP_KEEPINTVL on TCP control socket %d: %s!", - gControlSocketTCP, strerror(errno)) << "\n"; - LOG_END_FATAL -#if defined(HAVE_MPTCP) - } - LOG_WARNING - stdlog << format("Unable to set TCP_KEEPINTVL on MPTCP control socket %d: %s!", - gControlSocketTCP, strerror(errno)) << "\n"; - LOG_END -#endif - } -#else -#warning No TCP_KEEPINTVL option available! -#endif -#if defined(TCP_KEEPCNT) && !defined(__GNU__) - const int keepCountOption = (int)gControlHBPathMaxRtx; - if(ext_setsockopt(gControlSocketTCP, IPPROTO_TCP, TCP_KEEPCNT, - (const char*)&keepCountOption, sizeof(keepCountOption)) < 0) { -#if defined(HAVE_MPTCP) - if((!gPassiveControlMPTCP) || - ((errno != ENOENT) && (errno != ENOPROTOOPT) && (errno != EOPNOTSUPP))) { -#endif - LOG_ERROR - stdlog << format("Unable to set TCP_KEEPCNT on TCP control socket %d: %s!", - gControlSocketTCP, strerror(errno)) << "\n"; - LOG_END_FATAL -#if defined(HAVE_MPTCP) - } - LOG_WARNING - stdlog << format("Unable to set TCP_KEEPCNT on MPTCP control socket %d: %s!", - gControlSocketTCP, strerror(errno)) << "\n"; - LOG_END -#endif - } -#else -#warning No TCP_KEEPCNT option available! -#endif gMessageReader.registerSocket(IPPROTO_TCP, gControlSocketTCP); @@ -1892,19 +1916,26 @@ localPort + 1, strerror(errno)) << "\n"; LOG_END_FATAL } - const int noDelayOption = 1; - if(ext_setsockopt(gControlSocketTCP6, IPPROTO_TCP, TCP_NODELAY, - (const char*)&noDelayOption, sizeof(noDelayOption)) < 0) { - LOG_ERROR - stdlog << format("Unable to set TCP6_NODELAY on TCP6 control socket %d: %s!", - gControlSocketTCP6, strerror(errno)) << "\n"; - LOG_END_FATAL - } gMessageReader.registerSocket(IPPROTO_TCP, gControlSocketTCP6); } #endif } + if( (gControlSocket < 0) && + (gControlSocketTCP < 0) +#if defined(__OpenBSD__) + && (gControlSocketTCP6 < 0) +#endif +#if defined(HAVE_QUIC) + && (gControlSocketQUIC < 0) +#endif + ) { + LOG_FATAL + stdlog << format("Unable to create any control socket on port %d!", + localPort + 1) << "\n"; + LOG_END_FATAL + } + // ====== Initialize data socket for each protocol ======================= // ------ TCP ------------------------------------------------------------ @@ -2009,6 +2040,7 @@ FlowManager::getFlowManager()->addUnidentifiedSocket(IPPROTO_UDP, gUDP6Socket); } #endif + // ------ DCCP ----------------------------------------------------------- #if defined(HAVE_DCCP) gDCCPSocket = createAndBindSocket(AF_UNSPEC, SOCK_DCCP, IPPROTO_DCCP, localPort, @@ -2047,34 +2079,36 @@ // ------ QUIC ----------------------------------------------------------- #if defined(HAVE_QUIC) - gQUICSocket = createAndBindSocket(AF_UNSPEC, SOCK_DGRAM, IPPROTO_QUIC, localPort - 1, - gLocalDataAddresses, (const sockaddr_union*)&gLocalDataAddressArray, false, gBindV6Only); - // NOTE: It is necessary to set the ALPN before enabling the listening mode! - if(gQUICSocket < 0) { - LOG_INFO - stdlog << format("QUIC is unavailable (%s); disabling QUIC socket on port %d!", - strerror(errno), localPort - 1) << "\n"; - LOG_END - } - else { - if(ext_setsockopt(gQUICSocket, SOL_QUIC, QUIC_SOCKOPT_ALPN, - ALPN_NETPERFMETER_DATA, strlen(ALPN_NETPERFMETER_DATA)) < 0) { - LOG_FATAL - stdlog << format("Unable to configure QUIC ALPN (QUIC_SOCKOPT_ALPN option) on QUIC socket %d: %s!", - gQUICSocket, strerror(errno)) << "\n"; - LOG_END_FATAL - } - if(setBufferSizes(gQUICSocket, gSndBufSize, gRcvBufSize) == false) { - LOG_FATAL - stdlog << format("Unable to configure buffer sizes on QUIC socket %d: %s!", - gQUICSocket, strerror(errno)) << "\n"; - LOG_END_FATAL + if((gQUICCertificate != nullptr) && (gQUICKey != nullptr)) { + gQUICSocket = createAndBindSocket(AF_UNSPEC, SOCK_DGRAM, IPPROTO_QUIC, localPort - 1, + gLocalDataAddresses, (const sockaddr_union*)&gLocalDataAddressArray, false, gBindV6Only); + // NOTE: It is necessary to set the ALPN before enabling the listening mode! + if(gQUICSocket < 0) { + LOG_INFO + stdlog << format("QUIC is unavailable (%s); disabling QUIC socket on port %d!", + strerror(errno), localPort - 1) << "\n"; + LOG_END } - if(ext_listen(gQUICSocket, 100) < 0) { - LOG_FATAL - stdlog << format("Unable to enable listening on QUIC socket %d: %s!", - gQUICSocket, strerror(errno)) << "\n"; - LOG_END_FATAL + else { + if(ext_setsockopt(gQUICSocket, SOL_QUIC, QUIC_SOCKOPT_ALPN, + ALPN_NETPERFMETER_DATA, strlen(ALPN_NETPERFMETER_DATA)) < 0) { + LOG_FATAL + stdlog << format("Unable to configure QUIC ALPN (QUIC_SOCKOPT_ALPN option) on QUIC socket %d: %s!", + gQUICSocket, strerror(errno)) << "\n"; + LOG_END_FATAL + } + if(setBufferSizes(gQUICSocket, gSndBufSize, gRcvBufSize) == false) { + LOG_FATAL + stdlog << format("Unable to configure buffer sizes on QUIC socket %d: %s!", + gQUICSocket, strerror(errno)) << "\n"; + LOG_END_FATAL + } + if(ext_listen(gQUICSocket, 100) < 0) { + LOG_FATAL + stdlog << format("Unable to enable listening on QUIC socket %d: %s!", + gQUICSocket, strerror(errno)) << "\n"; + LOG_END_FATAL + } } } #endif @@ -2192,12 +2226,12 @@ } #endif #if defined(HAVE_MPTCP) - if(gMPTCPSocket > 0) { + if(gMPTCPSocket >= 0) { dataProtocols2 += "MPTCP"; } #endif #if defined(HAVE_QUIC) - if(gQUICSocket > 0) { + if(gQUICSocket >= 0) { if(dataProtocols2.size() > 0) { dataProtocols2 += "/"; } @@ -2490,51 +2524,22 @@ } else #endif - if(gActiveControlProtocol == IPPROTO_TCP) { - const int keepAliveOption = 1; - if(ext_setsockopt(gControlSocket, SOL_SOCKET, SO_KEEPALIVE, - (const char*)&keepAliveOption, sizeof(keepAliveOption)) < 0) { - LOG_ERROR - stdlog << format("Unable to set SO_KEEPALIVE on TCP control socket %d: %s!", - gControlSocket, strerror(errno)) << "\n"; - LOG_END_FATAL - } -#if defined(TCP_KEEPIDLE) && !defined(__GNU__) - const int keepIdleOption = std::max(1, (int)gControlHBInterval / 1000); // in s - if(ext_setsockopt(gControlSocket, IPPROTO_TCP, TCP_KEEPIDLE, - (const char*)&keepIdleOption, sizeof(keepIdleOption)) < 0) { - LOG_ERROR - stdlog << format("Unable to set TCP_KEEPIDLE on TCP control socket %d: %s!", - gControlSocket, strerror(errno)) << "\n"; - LOG_END_FATAL - } + if( +#if !defined(HAVE_MPTCP) + gActiveControlProtocol == IPPROTO_TCP #else -#warning No TCP_KEEPIDLE option available! + (gActiveControlProtocol == IPPROTO_TCP) || + (gActiveControlProtocol == IPPROTO_MPTCP) #endif -#if defined(TCP_KEEPINTVL) && !defined(__GNU__) - const int keepIntervalOption = std::max(1, (int)gControlHBInterval / 1000); // in s - if(ext_setsockopt(gControlSocket, IPPROTO_TCP, TCP_KEEPINTVL, - (const char*)&keepIntervalOption, sizeof(keepIntervalOption)) < 0) { - LOG_ERROR - stdlog << format("Unable to set TCP_KEEPINTVL on TCP control socket %d: %s!", - gControlSocket, strerror(errno)) << "\n"; - LOG_END_FATAL - } -#else -#warning No TCP_KEEPINTVL option available! + ) { + if(!configureTCPControlSocket(gControlSocket +#if defined(HAVE_MPTCP) + , (gActiveControlProtocol == IPPROTO_MPTCP) #endif -#if defined(TCP_KEEPCNT) && !defined(__GNU__) - const int keepCountOption = (int)gControlHBPathMaxRtx; - if(ext_setsockopt(gControlSocket, IPPROTO_TCP, TCP_KEEPCNT, - (const char*)&keepCountOption, sizeof(keepCountOption)) < 0) { - LOG_ERROR - stdlog << format("Unable to set TCP_KEEPCNT on TCP control socket %d: %s!", - gControlSocket, strerror(errno)) << "\n"; - LOG_END_FATAL + )) { + finishLogging(); + exit(1); } -#else -#warning No TCP_KEEPCNT option available! -#endif } LOG_TRACE @@ -2619,6 +2624,11 @@ quicDeregisterControlSocket(gControlSocket); } #endif + if(gControlSocket >= 0) { + gMessageReader.deregisterSocket(gControlSocket); + ext_close(gControlSocket); + gControlSocket = -1; + } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/netperfmeter-2.0.17/src/tools.cc new/netperfmeter-2.0.18/src/tools.cc --- old/netperfmeter-2.0.17/src/tools.cc 2026-11-19 09:14:39.000000000 +0100 +++ new/netperfmeter-2.0.18/src/tools.cc 2026-11-25 17:55:47.000000000 +0100 @@ -117,22 +117,32 @@ int safestrcpy(char* dest, const char* src, const size_t size) { assert(size > 0); - strncpy(dest, src, size); - dest[size - 1] = 0x00; - return strlen(dest) < size; + size_t i = 0; + while((i < size - 1) && (src[i] != 0x00)) { + dest[i] = src[i]; + i++; + } + dest[i] = 0x00; + return (src[i] == 0x00); } // ###### Length-checking strcat() ######################################### int safestrcat(char* dest, const char* src, const size_t size) { - const size_t l1 = strlen(dest); - const size_t l2 = strlen(src); - assert(size > 0); - strncat(dest, src, size - l1 - 1); - dest[size - 1] = 0x00; - return l1 + l2 < size; + size_t i = 0; + while((i < size - 1) && (dest[i] != 0x00)) { + i++; + } + size_t j = 0; + while((i < size - 1) && (src[j] != 0x00)) { + dest[i] = src[j]; + i++; + j++; + } + dest[i] = 0x00; + return (src[j] == 0x00); } @@ -370,7 +380,7 @@ size_t hostLength; size_t i; - if(strlen(string) > sizeof(host)) { + if(strlen(string) >= sizeof(host)) { return false; } safestrcpy(host, string, sizeof(host)); @@ -471,6 +481,7 @@ break; default: + freeaddrinfo(res); return false; }
