| Message ID | 20261102165927.110589-1-frank@lichtenheld.com |
|---|---|
| State | New |
| Headers |
Return-Path: <openvpn-devel-bounces@lists.sourceforge.net>
Delivered-To: patchwork@openvpn.net
Received: by 2002:a05:6022:3119:b0:118:2077:975e with SMTP id
e25csp5691545laa;
Mon, 2 Nov 2026 08:59:46 -0800 (PST)
X-Forwarded-Encrypted: i=2;
AKwUvBwpvwMhOJNxTI9wn5ETEu88V2aYPLhVjCo6/7ZgKfu/0NWqP3c1xNyRzVbTj3UxQxTWXu6RBJczUnQ=@openvpn.net
X-Received: by 2002:a05:6808:3206:b0:4f7:d324:bc3a with SMTP id
5614622812f47-5640ddfb115mr7703877b6e.18.1793638786158;
Mon, 02 Nov 2026 08:59:46 -0800 (PST)
ARC-Seal: i=1; a=rsa-sha256; t=1793638786; cv=none;
d=google.com; s=arc-20260327;
b=FYGk+AmGgUZZNIyosSln5eN9RSZ2UY+0gZp0PpPeR+j99nr9x0/uxNFl/I42Ak5FRX
uzI1VPa9730Ady+SVgilChqYX3W1LQDMy5UKxrC2uRF1NsvBrpDfCP5nJlkfv16GKfXD
5uZm3wVtwVAZS35kJ2oawTWI/66UPzxJAsFrClcWKoQ6QTE3PqgeK9AdgjaX4YlqgG3M
KJwz8sIG1rLY7nDgG7AMT8Eyxd/rxnxy7B3BZgjDjWYR7PsZRHxQlBAFFQMMV3fvZo1U
A9TkH4lWYwfaPtr9aCanOFf0dMW4w4rn7Sl/WjZkUyMjE+9JZP7Z1bW0pJzR1ayiKeoh
OP1Q==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;
s=arc-20260327;
h=errors-to:content-transfer-encoding:list-subscribe:list-help
:list-post:list-archive:list-unsubscribe:list-id:precedence:subject
:mime-version:references:in-reply-to:message-id:date:to:from
:dkim-signature:dkim-signature:dkim-signature:dkim-signature;
bh=uj/gcUOUSYP4fn1wsKJimC7lkR1UnKVU1c0strCfCxA=;
fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=;
b=k6dOvVEckfFCe4mCYMOyS6hl5iYRUCzf/c2PhtUin9N+uuYas9Y81Hyqac5cSdGaHR
5McQ5t4G97vfcI/eX0nmcL3ZSqDxSoKpmxYZeMM8DHm6MhTekzA+mKU1b7mPuGr7iGEU
o+fBIic1jLGTzQhmjuB+ceCMM9xvPZXl/7b5mLTWafq9chKFrZIq2JjEvziJoxUUiXdh
AZl3jjH5e5FAcNcTYI3QJPCRQRwf9hjjwftTo5YYySai4YlMbCB73txjMDPaQI7B1b9b
Op46af4GQL5UASolC60Gqwy6+lgIMHJsqRV3ekikK/Vh5lKqS9sJT1mL9PIY8RdsYNUf
Bo+w==;
dara=google.com
ARC-Authentication-Results: i=1; mx.google.com;
dkim=pass header.i=@lists.sourceforge.net header.s=beta
header.b=kvwvFeSa;
dkim=neutral (body hash did not verify) header.i=@sourceforge.net
header.s=x header.b=efG8J3rN;
dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x
header.b=YeNStAjG;
dkim=neutral (body hash did not verify) header.i=@lichtenheld.com
header.s=MBO0001 header.b=hjcyjO+i;
spf=pass (google.com: domain of
openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as
permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net
Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7])
by mx.google.com with ESMTPS id
5614622812f47-5640fd90b54si13127203b6e.40.2026.11.02.08.59.45
(version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
Mon, 02 Nov 2026 08:59:46 -0800 (PST)
Received-SPF: pass (google.com: domain of
openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as
permitted sender) client-ip=216.105.38.7;
Authentication-Results: mx.google.com;
dkim=pass header.i=@lists.sourceforge.net header.s=beta
header.b=kvwvFeSa;
dkim=neutral (body hash did not verify) header.i=@sourceforge.net
header.s=x header.b=efG8J3rN;
dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x
header.b=YeNStAjG;
dkim=neutral (body hash did not verify) header.i=@lichtenheld.com
header.s=MBO0001 header.b=hjcyjO+i;
spf=pass (google.com: domain of
openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as
permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
d=lists.sourceforge.net; s=beta; h=Content-Transfer-Encoding:Content-Type:
List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:
Subject:MIME-Version:References:In-Reply-To:Message-ID:Date:To:From:Sender:
Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From:
Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Unsubscribe-Post:
List-Owner; bh=uj/gcUOUSYP4fn1wsKJimC7lkR1UnKVU1c0strCfCxA=; b=kvwvFeSaOR7cUJ
Psi1k87C7QBfQsl2V4OuL3pDbjEuhsHGH0oLDedcEzV0auKDpXE0nigrPKRedUhk+ykRET4ugHduE
+CBxmf5xJxlPQVeKxcYLj6glrx9thdjKFPo7uJmeAVGDJMDZHypAOTJn9WNfcVuraMWdmm9sdb4NW
7tQ=;
Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com)
by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.100.1)
(envelope-from <openvpn-devel-bounces@lists.sourceforge.net>)
id 1xNvNl-000000001ns-41q9;
Mon, 02 Nov 2026 16:59:41 +0000
Received: from [172.30.29.66] (helo=mx.sourceforge.net)
by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLS1.2) tls
TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.100.1)
(envelope-from <frank@lichtenheld.com>) id 1xNvNi-000000001nV-3GSP
for openvpn-devel@lists.sourceforge.net;
Mon, 02 Nov 2026 16:59:39 +0000
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:References:
In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:
Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
List-Unsubscribe-Post:List-Subscribe:List-Post:List-Owner:List-Archive;
bh=0163Zdf6d7AqUAOnC49lPrR5hZHSLVimAhSkHWt2MKI=; b=efG8J3rNbCWZ9ygvZENEQHeQFy
y46b9o33lUGMR9/CLOvGcD2fJ2VFg+1yG+SLi+ou0om6amwW/lP/yPp06mE0ozzgQZllGMByy8k5e
9WIxmpC0tdacmgBv5cdBUof7ES78mRhoQEgmngzjitTaphQ/g4lWOOTkwyjHe/SNOGtQ=;
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x
;
h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:
Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID:
Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc
:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Unsubscribe-Post:
List-Subscribe:List-Post:List-Owner:List-Archive;
bh=0163Zdf6d7AqUAOnC49lPrR5hZHSLVimAhSkHWt2MKI=; b=YeNStAjGuPbMMJMDj1rlNtZYj4
LokyZTFg2cqEfult1u6MQZuWXw0MRcMB4H8bHXVxWPzjR/TEe3aTmKwvIqeiArlDeOGxubKmoi6DK
XlXaEbTzYJAUsoiJ1ZFgAqv0j2loLRUSLdqOPxorrmNEpd01WcVjJI20YwWoHcFCjlOY=;
Received: from mout-p-201.mailbox.org ([80.241.56.171])
by sfi-mx-1.v28.lw.sourceforge.com with esmtps
(TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.100.1)
id 1xNvNg-000000005vY-2Lkf for openvpn-devel@lists.sourceforge.net;
Mon, 02 Nov 2026 16:59:37 +0000
Received: from smtp1.mailbox.org (smtp1.mailbox.org
[IPv6:2001:67c:2050:b231:465::1])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
key-exchange X25519MLKEM768 server-signature RSA-PSS (4096 bits)
server-digest
SHA256) (No client certificate requested)
by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4jJHxD0q3DzMlfc
for <openvpn-devel@lists.sourceforge.net>;
Mon, 02 Nov 2026 17:59:28 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lichtenheld.com;
s=MBO0001; t=1793638768;
h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
to:to:cc:cc:mime-version:mime-version:
content-transfer-encoding:content-transfer-encoding:
in-reply-to:in-reply-to:references:references;
bh=0163Zdf6d7AqUAOnC49lPrR5hZHSLVimAhSkHWt2MKI=;
b=hjcyjO+i2dmXxgzGzwSwQAwgqoi0tJ1JyRjspHO3qctW4pN1tG0STiKTLpB4upxXqOjpe+
asUdBM8y7i1a0mSKjcyjKZ8Tzt83D2wCNZIBCIlJ2XF5NUd8GbSOKdHalKkKG03CAqTOMi
2O7zK4OzPGuJJzxqdOMgV9xxKO7heoW3UszzNNTTdq4OlAGP6wlc2/NltVigjXw14z+8zc
gTKvIF9JnxsKFMthwMy+0m9dDCDufWYaJBIHZN/WOWLzlyeYarakpgguAnzZ5uWtPt6pHm
Kf3Jfq4KcD8SlXDVGyF3FwyRoQ0729iVo65UKeO/BTRQrvH18USTL2x9hfk1+Q==
Authentication-Results: outgoing_mbo_mout; dkim=none;
spf=pass (outgoing_mbo_mout: domain of frank@lichtenheld.com designates
2001:67c:2050:b231:465::1 as permitted sender)
smtp.mailfrom=frank@lichtenheld.com
From: Frank Lichtenheld <frank@lichtenheld.com>
To: openvpn-devel@lists.sourceforge.net
Date: Mon, 2 Nov 2026 17:59:27 +0100
Message-ID: <20261102165927.110589-1-frank@lichtenheld.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To:
<gerrit.1793636884000.Ia0304e5ef5f8a553262a32d78ed21577973ee2e9@gerrit.openvpn.net>
References:
<gerrit.1793636884000.Ia0304e5ef5f8a553262a32d78ed21577973ee2e9@gerrit.openvpn.net>
MIME-Version: 1.0
X-Rspamd-Queue-Id: 4jJHxD0q3DzMlfc
X-Spam-Score: -0.2 (/)
X-Spam-Report: Spam detection software,
running on the system "sfi-spamd-1.hosts.colo.sdot.me",
has NOT identified this incoming email as spam. The original
message has been attached to this so you can view it or label
similar future email. If you have any questions, see
the administrator of that system for details.
Content preview: From: Razvan Cojocaru <razvanc@mailbox.org> The socket used
for the routing table ioctls was never closed. Close it on the early returns
and right after the last ioctl. Broken since 7da14925 ("Haiku: Add calls
to manage routing table").
Content analysis details: (-0.2 points, 5.0 required)
pts rule name description
---- ----------------------
--------------------------------------------------
-0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's
domain
-0.1 DKIM_VALID Message has at least one valid DKIM or DK signature
0.1 DKIM_SIGNED Message has a DKIM or DK signature,
not necessarily valid
-0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from
envelope-from domain
X-Headers-End: 1xNvNg-000000005vY-2Lkf
Subject: [Openvpn-devel] [PATCH v1] route: close socket in Haiku
get_default_gateway()
X-BeenThere: openvpn-devel@lists.sourceforge.net
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: <openvpn-devel.lists.sourceforge.net>
List-Unsubscribe: <https://lists.sourceforge.net/lists/options/openvpn-devel>,
<mailto:openvpn-devel-request@lists.sourceforge.net?subject=unsubscribe>
List-Archive:
<http://sourceforge.net/mailarchive/forum.php?forum_name=openvpn-devel>
List-Post: <mailto:openvpn-devel@lists.sourceforge.net>
List-Help: <mailto:openvpn-devel-request@lists.sourceforge.net?subject=help>
List-Subscribe: <https://lists.sourceforge.net/lists/listinfo/openvpn-devel>,
<mailto:openvpn-devel-request@lists.sourceforge.net?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: openvpn-devel-bounces@lists.sourceforge.net
X-getmail-retrieved-from-mailbox: Inbox
X-GMAIL-THRID: 1880766584168465759
X-GMAIL-MSGID: 1880766584168465759
|
| Series |
[Openvpn-devel,v1] route: close socket in Haiku get_default_gateway()
|
|
Commit Message
Frank Lichtenheld
Nov. 2, 2026, 4:59 p.m. UTC
From: Razvan Cojocaru <razvanc@mailbox.org> The socket used for the routing table ioctls was never closed. Close it on the early returns and right after the last ioctl. Broken since 7da14925 ("Haiku: Add calls to manage routing table"). Change-Id: Ia0304e5ef5f8a553262a32d78ed21577973ee2e9 Signed-off-by: Razvan Cojocaru <razvanc@mailbox.org> Acked-by: Frank Lichtenheld <frank@lichtenheld.com> Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2093 --- This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master. Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2093 This mail reflects revision 1 of this Change. Acked-by according to Gerrit (reflected above): Frank Lichtenheld <frank@lichtenheld.com>
Comments
Interesting find ;-)
Not tested beyond "looks reasonable"...
Your patch has been applied to the master and release/2.7 branch (bugfix).
commit e9ecd3c6ded76c03b9d74c1b37c87a07b54e10e6 (master)
Author: Razvan Cojocaru
Date: Mon Nov 2 17:59:27 2026 +0100
route: close socket in Haiku get_default_gateway()
Signed-off-by: Razvan Cojocaru <razvanc@mailbox.org>
Acked-by: Frank Lichtenheld <frank@lichtenheld.com>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2093
Message-Id: <20261102165927.110589-1-frank@lichtenheld.com>
URL: https://lore.kernel.org/openvpn-devel/20261102165927.110589-1-frank@lichtenheld.com
Signed-off-by: Gert Doering <gert@greenie.muc.de>
--
kind regards,
Gert Doering
diff --git a/src/openvpn/route.c b/src/openvpn/route.c index 0bce966..e8de2d5 100644 --- a/src/openvpn/route.c +++ b/src/openvpn/route.c @@ -3719,12 +3719,14 @@ if (ioctl(sockfd, SIOCGRTSIZE, &config, sizeof(struct ifconf)) < 0) { msg(M_ERRNO, "%s: Error getting routing table size", __func__); + close(sockfd); return; } uint32 size = (uint32)config.ifc_value; if (size == 0) { + close(sockfd); return; } @@ -3733,7 +3735,9 @@ config.ifc_len = size; config.ifc_buf = buffer; - if (ioctl(sockfd, SIOCGRTTABLE, &config, sizeof(struct ifconf)) < 0) + int ret = ioctl(sockfd, SIOCGRTTABLE, &config, sizeof(struct ifconf)); + close(sockfd); + if (ret < 0) { free(buffer); return;