Skip to contentSkip to conversation

Missing include for socket-flags TCP_NODELAY on OpenBSD

Openvpn-devel Jeremie Courreges-Anglas 2 participants 4 messages Jun 10, 2017 – Jun 12, 2017

lore
Share & tools
lore
#0 lore raw

Issue reported & patch provided by Kurt Miller:

Using "socket-flags TCP_NODELAY" results in

-->8--
Sat Jun 10 19:43:22 2017 NOTE: setsockopt TCP_NODELAY=1 failed (No kernel support) --8<--
instead of the expected
-->8--
Sat Jun 10 19:44:16 2017 Socket flags: TCP_NODELAY=1 succeeded
--8<--

Patch tested with 2.4.2 and the git master branch.

From aab4839b24e4c80f5ab814a0c972a0fb029d2d9f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Courr=C3=A8ges-Anglas?= <[email protected]...>
Date: Sat, 10 Jun 2017 19:31:21 +0200
Subject: [PATCH] Missing include for socket-flags TCP_NODELAY on OpenBSD

---
 src/openvpn/syshead.h | 4 ++++
 1 file changed, 4 insertions(+)
src/openvpn/syshead.h +4 -0
index f4458648..14b6662a 100644
@@ -288,6 +288,10 @@
 #include <netinet/ip.h>
 #endif
 
+#ifdef HAVE_NETINET_TCP_H
+#include <netinet/tcp.h>
+#endif
+
 #ifdef HAVE_NET_IF_TUN_H
 #include <net/if_tun.h>
 #endif
Signature · 1 line
2.13.0
Signature · 2 lines
-- 
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE
#1 lore raw

Hi,

src/openvpn/syshead.h line 294

Quoted 10 lines · Jeremie Courreges-Anglas
src/openvpn/syshead.h +4 -0
@@ -288,6 +288,10 @@
 #include <netinet/ip.h>
 #endif
 
+#ifdef HAVE_NETINET_TCP_H
+#include <netinet/tcp.h>
+#endif
+

*grumble* - our syshead.h has *five* such code blocks today...

$ grep -n netinet/tcp.h syshead.h

243:#include <netinet/tcp.h>
272:#include <netinet/tcp.h>
312:#include <netinet/tcp.h>
328:#include <netinet/tcp.h>
356:#include <netinet/tcp.h>

(Linux, Solaris, FreeBSD, NetBSD and Darwin/MacOS) - but not OpenBSD, most recent additions

commit 37170767a221a4847416fc339083704ae1b4c001 (Darwin) commit 3e86f688757529f8b33f9e6b49e31ba8d8564c5e (FreeBSD)

... so basically all platforms but Windows have an identical code block afterwards... (and "but DragonFly", but I assume that if someone would care about TCP_NODELAY there, we'd add another such chunk)...

Anyway: thanks for your patch, I'll add it later this weekend to all relevant branches (2.3, 2.4, master) - and then send a refactoring patch for master that joins all these into a common (unix) block...

gert

Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
                                                           //www.muc.de/~gert/
Gert Doering - Munich, Germany                             [email protected]...
fax: +49-89-35655025                        [email protected]...
#2 lore raw
In reply to Jeremie Courreges-Anglas

ACK, thanks.

(While I'm not exactly happy with the mess we have in syshead.h, this is not your fault - you just happen to add the 6th identical chunk...)

Applying this to all branches to fix the bug, putting "rework syshead.h for master, to clean up the zillion nearly-identical blocks" on my TODO list.

Your patch has been applied to the master, release/2.4 and release/2.3 branch.

commit e5b236eaba4512f86da917a0a63dd0f84e1b02db (master) commit fc6b630e8b2f2c3ec2a18b3791f419d99c9fefb1 (release/2.4) commit 464ac6ea10751093741c8fb3d32b5eea10e1a533 (release/2.3)

Author: Jérémie Courrèges-Anglas
Date:   Sat Jun 10 19:31:21 2017 +0200
     Missing include for socket-flags TCP_NODELAY on OpenBSD

     Signed-off-by: Jeremie Courreges-Anglas <[email protected]...>
     Acked-by: Gert Doering <[email protected]...>
     Message-Id: <[email protected]...>
     URL: https://www.mail-archive.com/[email protected]/msg14772.html
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering

#3 lore raw
Quoted 10 lines · Gert Doering

ACK, thanks.

(While I'm not exactly happy with the mess we have in syshead.h, this is not your fault - you just happen to add the 6th identical chunk...)

Applying this to all branches to fix the bug, putting "rework syshead.h for master, to clean up the zillion nearly-identical blocks" on my TODO list.

Your patch has been applied to the master, release/2.4 and release/2.3 branch.

Great, thanks a lot. :)

Signature · 1 line
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE