Change in openvpn[master]: socket: Remove ifdef for SO_{RCV, SND}BUF
A message that is not in the archive (sent off-list or not yet received): gerrit.1769435786000.I87679949bdef6319d7490d561f0136633244c2b9@...2715...
Attention is currently required from: plaisthos.
Hello plaisthos,
I'd like you to do a code review.
Please visit
http://gerrit.openvpn.net/c/openvpn/+/1486?usp=email
to review the following change.
Change subject: socket: Remove ifdef for SO_{RCV,SND}BUF
......................................................................
socket: Remove ifdef for SO_{RCV,SND}BUF
Seems all our platforms define it.
Github: Fixes #965
---
M src/openvpn/socket.c
1 file changed, 3 insertions(+), 15 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/86/1486/1
src/openvpn/socket.c +3 -15
@@ -419,57 +419,45 @@static int socket_get_sndbuf (socket_descriptor_t sd) { -#if defined(SOL_SOCKET ) && defined(SO_SNDBUF )int val; -socklen_t len; +socklen_t len =sizeof (val); - len =sizeof (val);if (getsockopt (sd,SOL_SOCKET ,SO_SNDBUF , (void *)&val, &len) ==0 && len ==sizeof (val)) {return val; } -#endif return 0 ; }static void socket_set_sndbuf (socket_descriptor_t sd,int size) { -#if defined(SOL_SOCKET ) && defined(SO_SNDBUF )if (setsockopt (sd,SOL_SOCKET ,SO_SNDBUF , (void *)&size,sizeof (size)) !=0 ) {msg (M_WARN ,"NOTE: setsockopt SO_SNDBUF=%d failed" , size); } -#endif }static int socket_get_rcvbuf (socket_descriptor_t sd) { -#if defined(SOL_SOCKET ) && defined(SO_RCVBUF )int val; -socklen_t len; +socklen_t len =sizeof (val); - len =sizeof (val);if (getsockopt (sd,SOL_SOCKET ,SO_RCVBUF , (void *)&val, &len) ==0 && len ==sizeof (val)) {return val; } -#endif return 0 ; } -static bool +static void socket_set_rcvbuf (socket_descriptor_t sd,int size) { -#if defined(SOL_SOCKET ) && defined(SO_RCVBUF )if (setsockopt (sd,SOL_SOCKET ,SO_RCVBUF , (void *)&size,sizeof (size)) !=0 ) {msg (M_WARN ,"NOTE: setsockopt SO_RCVBUF=%d failed" , size); -return false; } -return true; -#endif }void
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1486?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I87679949bdef6319d7490d561f0136633244c2b9
Gerrit-Change-Number: 1486
Gerrit-PatchSet: 1
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Attention is currently required from: plaisthos.
Hello plaisthos,
I'd like you to reexamine a change. Please visit
http://gerrit.openvpn.net/c/openvpn/+/1486?usp=email
to look at the new patch set (#2).
Change subject: socket: Remove ifdef for SO_{RCV,SND}BUF
......................................................................
socket: Remove ifdef for SO_{RCV,SND}BUF
Seems all our platforms define it.
Github: Fixes #965
---
M src/openvpn/socket.c
1 file changed, 3 insertions(+), 15 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/86/1486/2
src/openvpn/socket.c +3 -15
@@ -419,57 +419,45 @@static int socket_get_sndbuf (socket_descriptor_t sd) { -#if defined(SOL_SOCKET ) && defined(SO_SNDBUF )int val; -socklen_t len; +socklen_t len =sizeof (val); - len =sizeof (val);if (getsockopt (sd,SOL_SOCKET ,SO_SNDBUF , (void *)&val, &len) ==0 && len ==sizeof (val)) {return val; } -#endif return 0 ; }static void socket_set_sndbuf (socket_descriptor_t sd,int size) { -#if defined(SOL_SOCKET ) && defined(SO_SNDBUF )if (setsockopt (sd,SOL_SOCKET ,SO_SNDBUF , (void *)&size,sizeof (size)) !=0 ) {msg (M_WARN ,"NOTE: setsockopt SO_SNDBUF=%d failed" , size); } -#endif }static int socket_get_rcvbuf (socket_descriptor_t sd) { -#if defined(SOL_SOCKET ) && defined(SO_RCVBUF )int val; -socklen_t len; +socklen_t len =sizeof (val); - len =sizeof (val);if (getsockopt (sd,SOL_SOCKET ,SO_RCVBUF , (void *)&val, &len) ==0 && len ==sizeof (val)) {return val; } -#endif return 0 ; } -static bool +static void socket_set_rcvbuf (socket_descriptor_t sd,int size) { -#if defined(SOL_SOCKET ) && defined(SO_RCVBUF )if (setsockopt (sd,SOL_SOCKET ,SO_RCVBUF , (void *)&size,sizeof (size)) !=0 ) {msg (M_WARN ,"NOTE: setsockopt SO_RCVBUF=%d failed" , size); -return false; } -return true; -#endif }void
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1486?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I87679949bdef6319d7490d561f0136633244c2b9
Gerrit-Change-Number: 1486
Gerrit-PatchSet: 2
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Attention is currently required from: flichtenheld, plaisthos.
cron2 has posted comments on this change by flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/1486?usp=email )
Change subject: socket: Remove ifdef for SO_{RCV,SND}BUF
......................................................................
Patch Set 2: Code-Review+2
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1486?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I87679949bdef6319d7490d561f0136633244c2b9
Gerrit-Change-Number: 1486
Gerrit-PatchSet: 2
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Comment-Date: Mon, 26 Jan 2026 14:53:41 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
PATCH v2 1/1 socket: Remove ifdef for SO_{RCV, SND}BUF
In reply to a message not in the archiveFrom: Frank Lichtenheld <[email protected]...>
Seems all our platforms define it.
Github: Fixes OpenVPN/openvpn#965
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1486
---
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/+/1486
This mail reflects revision 2 of this Change.
Acked-by according to Gerrit (reflected above):
Gert Doering <[email protected]...>
src/openvpn/socket.c +3 -15
@@ -419,57 +419,45 @@static int socket_get_sndbuf (socket_descriptor_t sd) { -#if defined(SOL_SOCKET ) && defined(SO_SNDBUF )int val; -socklen_t len; +socklen_t len =sizeof (val); - len =sizeof (val);if (getsockopt (sd,SOL_SOCKET ,SO_SNDBUF , (void *)&val, &len) ==0 && len ==sizeof (val)) {return val; } -#endif return 0 ; }static void socket_set_sndbuf (socket_descriptor_t sd,int size) { -#if defined(SOL_SOCKET ) && defined(SO_SNDBUF )if (setsockopt (sd,SOL_SOCKET ,SO_SNDBUF , (void *)&size,sizeof (size)) !=0 ) {msg (M_WARN ,"NOTE: setsockopt SO_SNDBUF=%d failed" , size); } -#endif }static int socket_get_rcvbuf (socket_descriptor_t sd) { -#if defined(SOL_SOCKET ) && defined(SO_RCVBUF )int val; -socklen_t len; +socklen_t len =sizeof (val); - len =sizeof (val);if (getsockopt (sd,SOL_SOCKET ,SO_RCVBUF , (void *)&val, &len) ==0 && len ==sizeof (val)) {return val; } -#endif return 0 ; } -static bool +static void socket_set_rcvbuf (socket_descriptor_t sd,int size) { -#if defined(SOL_SOCKET ) && defined(SO_RCVBUF )if (setsockopt (sd,SOL_SOCKET ,SO_RCVBUF , (void *)&size,sizeof (size)) !=0 ) {msg (M_WARN ,"NOTE: setsockopt SO_RCVBUF=%d failed" , size); -return false; } -return true; -#endif }void
[Openvpn-devel] [PATCH applied] Re: socket: Remove ifdef for SO_{RCV, SND}BUF
Kudos to our good friends from SRLabs... if they start staring at the code, they will actually find stuff :-) - the initial report was "there is an '#else return false;' missing", but it turned to an opportunity to get rid of #ifdefs. All the better.
Checked some of the oldest and weirdest systems we sort-of support (FreeBSD 7.4, AIX, Windows) and they all have these defines... out!
Your patch has been applied to the master branch.
commit 57e701129e1178c6e53f593558535ebebe6b2cd5
Author: Frank Lichtenheld Date: Mon Jan 26 15:54:26 2026 +0100
socket: Remove ifdef for SO_{RCV, SND}BUF
Signed-off-by: Frank Lichtenheld <[email protected]...>
Acked-by: Gert Doering <[email protected]...>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1486
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg35435.html
Signed-off-by: Gert Doering <[email protected]...>--
kind regards,
Gert Doering
cron2 has uploaded a new patch set (#3) to the change originally created by flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/1486?usp=email )
The following approvals got outdated and were removed:
Code-Review+2 by cron2
Change subject: socket: Remove ifdef for SO_{RCV, SND}BUF
......................................................................
socket: Remove ifdef for SO_{RCV, SND}BUF
Seems all our platforms define it.
Github: Fixes OpenVPN/openvpn#965
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1486
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg35435.html
---
M src/openvpn/socket.c
1 file changed, 3 insertions(+), 15 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/86/1486/3
src/openvpn/socket.c +3 -15
@@ -419,57 +419,45 @@static int socket_get_sndbuf (socket_descriptor_t sd) { -#if defined(SOL_SOCKET ) && defined(SO_SNDBUF )int val; -socklen_t len; +socklen_t len =sizeof (val); - len =sizeof (val);if (getsockopt (sd,SOL_SOCKET ,SO_SNDBUF , (void *)&val, &len) ==0 && len ==sizeof (val)) {return val; } -#endif return 0 ; }static void socket_set_sndbuf (socket_descriptor_t sd,int size) { -#if defined(SOL_SOCKET ) && defined(SO_SNDBUF )if (setsockopt (sd,SOL_SOCKET ,SO_SNDBUF , (void *)&size,sizeof (size)) !=0 ) {msg (M_WARN ,"NOTE: setsockopt SO_SNDBUF=%d failed" , size); } -#endif }static int socket_get_rcvbuf (socket_descriptor_t sd) { -#if defined(SOL_SOCKET ) && defined(SO_RCVBUF )int val; -socklen_t len; +socklen_t len =sizeof (val); - len =sizeof (val);if (getsockopt (sd,SOL_SOCKET ,SO_RCVBUF , (void *)&val, &len) ==0 && len ==sizeof (val)) {return val; } -#endif return 0 ; } -static bool +static void socket_set_rcvbuf (socket_descriptor_t sd,int size) { -#if defined(SOL_SOCKET ) && defined(SO_RCVBUF )if (setsockopt (sd,SOL_SOCKET ,SO_RCVBUF , (void *)&size,sizeof (size)) !=0 ) {msg (M_WARN ,"NOTE: setsockopt SO_RCVBUF=%d failed" , size); -return false; } -return true; -#endif }void
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1486?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I87679949bdef6319d7490d561f0136633244c2b9
Gerrit-Change-Number: 1486
Gerrit-PatchSet: 3
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/1486?usp=email )
Change subject: socket: Remove ifdef for SO_{RCV, SND}BUF
......................................................................
socket: Remove ifdef for SO_{RCV, SND}BUF
Seems all our platforms define it.
Github: Fixes OpenVPN/openvpn#965
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1486
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg35435.html
---
M src/openvpn/socket.c
1 file changed, 3 insertions(+), 15 deletions(-)
src/openvpn/socket.c +3 -15
@@ -419,57 +419,45 @@static int socket_get_sndbuf (socket_descriptor_t sd) { -#if defined(SOL_SOCKET ) && defined(SO_SNDBUF )int val; -socklen_t len; +socklen_t len =sizeof (val); - len =sizeof (val);if (getsockopt (sd,SOL_SOCKET ,SO_SNDBUF , (void *)&val, &len) ==0 && len ==sizeof (val)) {return val; } -#endif return 0 ; }static void socket_set_sndbuf (socket_descriptor_t sd,int size) { -#if defined(SOL_SOCKET ) && defined(SO_SNDBUF )if (setsockopt (sd,SOL_SOCKET ,SO_SNDBUF , (void *)&size,sizeof (size)) !=0 ) {msg (M_WARN ,"NOTE: setsockopt SO_SNDBUF=%d failed" , size); } -#endif }static int socket_get_rcvbuf (socket_descriptor_t sd) { -#if defined(SOL_SOCKET ) && defined(SO_RCVBUF )int val; -socklen_t len; +socklen_t len =sizeof (val); - len =sizeof (val);if (getsockopt (sd,SOL_SOCKET ,SO_RCVBUF , (void *)&val, &len) ==0 && len ==sizeof (val)) {return val; } -#endif return 0 ; } -static bool +static void socket_set_rcvbuf (socket_descriptor_t sd,int size) { -#if defined(SOL_SOCKET ) && defined(SO_RCVBUF )if (setsockopt (sd,SOL_SOCKET ,SO_RCVBUF , (void *)&size,sizeof (size)) !=0 ) {msg (M_WARN ,"NOTE: setsockopt SO_RCVBUF=%d failed" , size); -return false; } -return true; -#endif }void
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1486?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I87679949bdef6319d7490d561f0136633244c2b9
Gerrit-Change-Number: 1486
Gerrit-PatchSet: 3
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>