Gert Doering has submitted this change. (
https://gerrit.openvpn.net/c/openvpn/+/2093?usp=email )
Change subject: route: close socket in Haiku get_default_gateway()
......................................................................
route: close socket in Haiku get_default_gateway()
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 <[email protected]>
Acked-by: Frank Lichtenheld <[email protected]>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2093
Message-Id: <[email protected]>
URL:
https://lore.kernel.org/openvpn-devel/[email protected]
Signed-off-by: Gert Doering <[email protected]>
---
M src/openvpn/route.c
1 file changed, 5 insertions(+), 1 deletion(-)
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;
--
To view, visit https://gerrit.openvpn.net/c/openvpn/+/2093?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ia0304e5ef5f8a553262a32d78ed21577973ee2e9
Gerrit-Change-Number: 2093
Gerrit-PatchSet: 2
Gerrit-Owner: Răzvan Cojocaru <[email protected]>
Gerrit-Reviewer: Arne Schwabe <[email protected]>
Gerrit-Reviewer: Frank Lichtenheld <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel