Skip to contentSkip to conversation

dco-freebsd: always enable float notification support

PATCH In review Kristof Provost 2 participants 2 messages Jul 29, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 2/2 dco-freebsd: always enable float notification support

From: Kristof Provost <[email protected]...>

If the kernel doesn't support it we'll simply never get the notification. In other words, there's no downside to always enabling this, so let's do that.

---
 configure.ac              | 9 ---------
 src/openvpn/dco_freebsd.c | 4 ----
 2 files changed, 13 deletions(-)
configure.ac +0 -9
index 50697b8e..66cb79b1 100644
@@ -848,15 +848,6 @@ if test "$enable_dco" != "no"; then
 				else
 					AC_MSG_ERROR([DCO support can't be enabled])
 				fi
-			else
-				AC_CHECK_DECLS(
-					[OVPN_NOTIF_FLOAT],
-					[AC_DEFINE([ENABLE_DCO_FLOAT_FREEBSD], [1], [We have DCO float notifications on FreeBSD])],
-					,
-					[[
-						#include <net/if_ovpn.h>
-					]]
-				)
 			fi
 			;;
 		*-mingw*)
src/openvpn/dco_freebsd.c +0 -4
index 306ecd31..488665fc 100644
@@ -73,7 +73,6 @@ sockaddr_to_nvlist(const struct sockaddr *sa)
     return (nvl);
 }
 
-#ifdef ENABLE_DCO_FLOAT_FREEBSD
 static bool
 nvlist_to_sockaddr(const nvlist_t *nvl, struct sockaddr_storage *ss)
 {
@@ -133,7 +132,6 @@ nvlist_to_sockaddr(const nvlist_t *nvl, struct sockaddr_storage *ss)
 
     return (true);
 }
-#endif /* ifdef ENABLE_DCO_FLOAT_FREEBSD */
 
 int
 dco_new_peer(dco_context_t *dco, unsigned int peerid, int sd,
@@ -636,7 +634,6 @@ dco_do_read(dco_context_t *dco)
             dco->dco_message_type = OVPN_CMD_SWAP_KEYS;
             break;
 
-#ifdef ENABLE_DCO_FLOAT_FREEBSD
         case OVPN_NOTIF_FLOAT: {
             const nvlist_t *address;
 
@@ -655,7 +652,6 @@ dco_do_read(dco_context_t *dco)
             dco->dco_message_type = OVPN_CMD_FLOAT_PEER;
             break;
         }
-#endif
 
         default:
             msg(M_WARN, "Unknown kernel notification %d", type);
Signature · 1 line
2.50.1
#1 lore raw

That's an easy one :-) - taking out configure stuff and #ifdefs, always welcome. Tested on "stock FreeBSD 13.5" which has no if_ovpn, and "stock FreeBSD 14.2" which has if_ovpn but not the float stuff.

Your patch has been applied to the master branch.

commit 796ad2c55951635382e48ea5b71d13bbb83ebfb1

Author: Kristof Provost
Date:   Tue Jul 29 11:39:07 2025 +0200
     dco-freebsd: always enable float notification support

     Signed-off-by: Kristof Provost <[email protected]...>
     Message-Id: <[email protected]...>
     URL: https://www.mail-archive.com/[email protected]/msg32402.html
     Acked-by: Gert Doering <[email protected]...>
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering