Skip to contentSkip to conversation

configure: enable DCO by default on FreeBSD/Linux

PATCH Superseded Frank Lichtenheld 4 participants 11 messages Feb 3, 2023 – Feb 25, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 configure: enable DCO by default on FreeBSD/Linux

It is time.

Automatically disabled when
- iproute2 is enabled
- libnl-genl is missing on Linux
- libnv is missing on FreeBSD

---
 configure.ac | 79 +++++++++++++++++++++++++++++++++++++++++-----------
 1 file changed, 62 insertions(+), 17 deletions(-)
configure.ac +62 -17
index 91500087..808b9c06 100644
@@ -144,14 +144,27 @@ AC_ARG_ENABLE(
 
 AC_ARG_ENABLE(
 	[dco],
-	[AS_HELP_STRING([--enable-dco], [enable data channel offload support using the ovpn-dco kernel module (always enabled on Windows) @<:@default=no@:>@])],
+	[AS_HELP_STRING([--disable-dco], [enable data channel offload support using the ovpn-dco kernel module (always enabled on Windows) @<:@default=yes@:>@])],
 	,
-	[enable_dco="no"]
+	[
+		case "$host" in
+			*-*-linux*)
+				enable_dco="auto"
+			;;
+			*-*-freebsd*)
+				enable_dco="auto"
+			;;
+			*)
+				# note that this does not disable it for Windows
+				enable_dco="no"
+			;;
+		esac
+	]
 )
 
 AC_ARG_ENABLE(
 	[iproute2],
-	[AS_HELP_STRING([--enable-iproute2], [enable support for iproute2 @<:@default=no@:>@])],
+	[AS_HELP_STRING([--enable-iproute2], [enable support for iproute2 (disables DCO) @<:@default=no@:>@])],
 	,
 	[enable_iproute2="no"]
 )
@@ -534,7 +547,7 @@ AC_CHECK_DECLS(
 	,
 	[[${SOCKET_INCLUDES}]]
 )
-AC_CHECKING([anonymous union support])
+AC_MSG_CHECKING([anonymous union support])
 AC_COMPILE_IFELSE(
 	[AC_LANG_PROGRAM(
 		[[
@@ -769,28 +782,60 @@ PKG_CHECK_MODULES(
 )
 
 
-if test "$enable_dco" = "yes"; then
+if test "$enable_dco" != "no"; then
+	enable_dco_arg="$enable_dco"
+	if test "${enable_iproute2}" = "yes"; then
+		AC_MSG_WARN([iproute2 support cannot be enabled when using DCO])
+		enable_dco="no"
+	fi
+	case "$host" in
+		*-*-linux*)
 dnl
 dnl Include generic netlink library used to talk to ovpn-dco
 dnl
-	case "$host" in
-		*-*-linux*)
 			PKG_CHECK_MODULES([LIBNL_GENL],
 					  [libnl-genl-3.0 >= 3.4.0],
 					  [have_libnl="yes"],
-					  [AC_MSG_ERROR([libnl-genl-3.0 package not found or too old. Is the development package and pkg-config installed? Must be version 3.4.0 or newer])]
+					  [
+					   AC_MSG_WARN([libnl-genl-3.0 package not found or too old. Is the development package and pkg-config installed? Must be version 3.4.0 or newer for DCO])
+					   enable_dco="no"
+					  ]
 			)
-
-			CFLAGS="${CFLAGS} ${LIBNL_GENL_CFLAGS}"
-			LIBS="${LIBS} ${LIBNL_GENL_LIBS}"
-
-			AC_DEFINE(ENABLE_DCO, 1, [Enable shared data channel offload])
-			AC_MSG_NOTICE([Enabled ovpn-dco support for Linux])
+			if test "$enable_dco" = "no"; then
+				if test "$enable_dco_arg" = "auto"; then
+					AC_MSG_WARN([DCO support disabled])
+				else
+					AC_MSG_ERROR([DCO support can't be enabled])
+				fi
+			else
+				CFLAGS="${CFLAGS} ${LIBNL_GENL_CFLAGS}"
+				LIBS="${LIBS} ${LIBNL_GENL_LIBS}"
+
+				AC_DEFINE(ENABLE_DCO, 1, [Enable shared data channel offload])
+				AC_MSG_NOTICE([Enabled ovpn-dco support for Linux])
+			fi
 			;;
 		*-*-freebsd*)
-			LIBS="${LIBS} -lnv"
-			AC_DEFINE(ENABLE_DCO, 1, [Enable data channel offload for FreeBSD])
-			AC_MSG_NOTICE([Enabled ovpn-dco support for FreeBSD])
+			AC_CHECK_LIB(
+				[nv],
+				[nvlist_create],
+				[
+				 LIBS="${LIBS} -lnv"
+				 AC_DEFINE(ENABLE_DCO, 1, [Enable data channel offload for FreeBSD])
+				 AC_MSG_NOTICE([Enabled ovpn-dco support for FreeBSD])
+				],
+				[
+				 enable_dco="no"
+				 AC_MSG_WARN([Name/Value pair library not found.])
+				]
+			)
+			if test "$enable_dco" = "no"; then
+				if test "$enable_dco_arg" = "auto"; then
+					AC_MSG_WARN([DCO support disabled])
+				else
+					AC_MSG_ERROR([DCO support can't be enabled])
+				fi
+			fi
 			;;
 		*-mingw*)
 			AC_MSG_NOTICE([NOTE: --enable-dco ignored on Windows because it's always enabled])
Signature · 1 line
2.34.1
#1 lore raw

PATCH v2 1/1 configure: enable DCO by default on FreeBSD/Linux

Automatically disabled when
- iproute2 is enabled
(Don't want to force people specifying --disable-dco explicitely)
- libnv is missing on FreeBSD
(FreeBSD version too old anyway)

Will still error out if libnl-genl is missing on Linux to make people aware of new dependency.

---
 configure.ac | 78 ++++++++++++++++++++++++++++++++++++++++------------
 1 file changed, 61 insertions(+), 17 deletions(-)

v2: error out when libnl-genl is missing as discussed with ordex on
IRC.

configure.ac +61 -17
index 91500087..acfa4bc1 100644
@@ -144,14 +144,27 @@ AC_ARG_ENABLE(
 
 AC_ARG_ENABLE(
 	[dco],
-	[AS_HELP_STRING([--enable-dco], [enable data channel offload support using the ovpn-dco kernel module (always enabled on Windows) @<:@default=no@:>@])],
+	[AS_HELP_STRING([--disable-dco], [enable data channel offload support using the ovpn-dco kernel module (always enabled on Windows) @<:@default=yes@:>@])],
 	,
-	[enable_dco="no"]
+	[
+		case "$host" in
+			*-*-linux*)
+				enable_dco="auto"
+			;;
+			*-*-freebsd*)
+				enable_dco="auto"
+			;;
+			*)
+				# note that this does not disable it for Windows
+				enable_dco="no"
+			;;
+		esac
+	]
 )
 
 AC_ARG_ENABLE(
 	[iproute2],
-	[AS_HELP_STRING([--enable-iproute2], [enable support for iproute2 @<:@default=no@:>@])],
+	[AS_HELP_STRING([--enable-iproute2], [enable support for iproute2 (disables DCO) @<:@default=no@:>@])],
 	,
 	[enable_iproute2="no"]
 )
@@ -534,7 +547,7 @@ AC_CHECK_DECLS(
 	,
 	[[${SOCKET_INCLUDES}]]
 )
-AC_CHECKING([anonymous union support])
+AC_MSG_CHECKING([anonymous union support])
 AC_COMPILE_IFELSE(
 	[AC_LANG_PROGRAM(
 		[[
@@ -769,28 +782,59 @@ PKG_CHECK_MODULES(
 )
 
 
-if test "$enable_dco" = "yes"; then
+if test "$enable_dco" != "no"; then
+	enable_dco_arg="$enable_dco"
+	if test "${enable_iproute2}" = "yes"; then
+		AC_MSG_WARN([iproute2 support cannot be enabled when using DCO])
+		enable_dco="no"
+	fi
+	case "$host" in
+		*-*-linux*)
 dnl
 dnl Include generic netlink library used to talk to ovpn-dco
 dnl
-	case "$host" in
-		*-*-linux*)
 			PKG_CHECK_MODULES([LIBNL_GENL],
 					  [libnl-genl-3.0 >= 3.4.0],
 					  [have_libnl="yes"],
-					  [AC_MSG_ERROR([libnl-genl-3.0 package not found or too old. Is the development package and pkg-config installed? Must be version 3.4.0 or newer])]
+					  [
+					   AC_MSG_ERROR([libnl-genl-3.0 package not found or too old. Is the development package and pkg-config installed? Must be version 3.4.0 or newer for DCO])
+					  ]
 			)
-
-			CFLAGS="${CFLAGS} ${LIBNL_GENL_CFLAGS}"
-			LIBS="${LIBS} ${LIBNL_GENL_LIBS}"
-
-			AC_DEFINE(ENABLE_DCO, 1, [Enable shared data channel offload])
-			AC_MSG_NOTICE([Enabled ovpn-dco support for Linux])
+			if test "$enable_dco" = "no"; then
+				if test "$enable_dco_arg" = "auto"; then
+					AC_MSG_WARN([DCO support disabled])
+				else
+					AC_MSG_ERROR([DCO support can't be enabled])
+				fi
+			else
+				CFLAGS="${CFLAGS} ${LIBNL_GENL_CFLAGS}"
+				LIBS="${LIBS} ${LIBNL_GENL_LIBS}"
+
+				AC_DEFINE(ENABLE_DCO, 1, [Enable shared data channel offload])
+				AC_MSG_NOTICE([Enabled ovpn-dco support for Linux])
+			fi
 			;;
 		*-*-freebsd*)
-			LIBS="${LIBS} -lnv"
-			AC_DEFINE(ENABLE_DCO, 1, [Enable data channel offload for FreeBSD])
-			AC_MSG_NOTICE([Enabled ovpn-dco support for FreeBSD])
+			AC_CHECK_LIB(
+				[nv],
+				[nvlist_create],
+				[
+				 LIBS="${LIBS} -lnv"
+				 AC_DEFINE(ENABLE_DCO, 1, [Enable data channel offload for FreeBSD])
+				 AC_MSG_NOTICE([Enabled ovpn-dco support for FreeBSD])
+				],
+				[
+				 enable_dco="no"
+				 AC_MSG_WARN([Name/Value pair library not found.])
+				]
+			)
+			if test "$enable_dco" = "no"; then
+				if test "$enable_dco_arg" = "auto"; then
+					AC_MSG_WARN([DCO support disabled])
+				else
+					AC_MSG_ERROR([DCO support can't be enabled])
+				fi
+			fi
 			;;
 		*-mingw*)
 			AC_MSG_NOTICE([NOTE: --enable-dco ignored on Windows because it's always enabled])
Signature · 1 line
2.34.1
#2 lore raw

Hi,

Quoted 23 lines · Frank Lichtenheld

Automatically disabled when
- iproute2 is enabled
(Don't want to force people specifying --disable-dco explicitely)
- libnv is missing on FreeBSD
(FreeBSD version too old anyway)

Will still error out if libnl-genl is missing on Linux to make people aware of new dependency.

---
 configure.ac | 78 ++++++++++++++++++++++++++++++++++++++++------------
 1 file changed, 61 insertions(+), 17 deletions(-)

v2: error out when libnl-genl is missing as discussed with ordex on
IRC.

configure.ac +0 -0
index 91500087..acfa4bc1 100644

configure.ac AC_ARG_ENABLE( · line 152

Quoted 10 lines
configure.ac +1 -1
@@ -144,14 +144,27 @@ AC_ARG_ENABLE(
 
 AC_ARG_ENABLE(
        [dco],
-       [AS_HELP_STRING([--enable-dco], [enable data channel offload
 support using the ovpn-dco kernel module (always enabled on Windows)
 @<:@default=no@:>@])],
+       [AS_HELP_STRING([--disable-dco], [enable data channel offload
 support using the ovpn-dco kernel module (always enabled on Windows)
 @<:@default=yes@:>@])],
 

The help string should be
"disable data channel offload support ..." instead of "enable data channel offload ..." as it's now prefixed with "--disable-dco" .

The "default=yes" in this case may be better written as "default=auto" (or "platform specific") but it's not critical. Here, default always refers to the "--enable-FEATURE" form of the option. Confusing but consistent with how other options are described.

We could be more helpful by describing both enable and disable forms of all options, as well as custom args that the enable form takes (if any), but that's beyond the scope of this patch.

-if test "$enable_dco" = "yes"; then

configure.ac PKG_CHECK_MODULES(

Quoted 6 lines
configure.ac +4 -0
+if test "$enable_dco" != "no"; then
+       enable_dco_arg="$enable_dco"
+       if test "${enable_iproute2}" = "yes"; then
+               AC_MSG_WARN([iproute2 support cannot be enabled when using
 DCO])
 

This is mildly misleading as here iproute2 is going to win over DCO but the message appears to indicate otherwise. It would result in outputs like:

WARNING: iproute2 support cannot be enabled when using DCO
WARNING: DCO support disabled
(or in an error)

Phrasing the first as "DCO cannot be enabled when using iproute2" would be better.

configure.ac PKG_CHECK_MODULES( · line 792

Quoted 4 lines
configure.ac +4 -0
+               enable_dco="no"
+       fi
+       case "$host" in
+               *-*-linux*)

I'll defer to those who understand DCO better to ACK the technical part.

Selva

#3 lore raw

PATCH v3 1/1 configure: enable DCO by default on FreeBSD/Linux

In reply to Frank Lichtenheld

Automatically disabled when
- iproute2 is enabled
(Don't want to force people specifying --disable-dco explicitely)
- libnv is missing on FreeBSD
(FreeBSD version too old anyway)

Will still error out if libnl-genl is missing on Linux to make people aware of the new dependency.

---
 configure.ac | 82 ++++++++++++++++++++++++++++++++++++++++------------
 1 file changed, 63 insertions(+), 19 deletions(-)

v2: error out when libnl-genl is missing as discussed with ordex on
IRC.

v3:
- improvements to the messages, suggested by Selva
- further improvements to the default specification, trying to make it clear
- if enabling iproute2, do not test for libnl-genl

configure.ac +63 -19
index 78c99740..ba33ccd8 100644
@@ -146,14 +146,27 @@ AC_ARG_ENABLE(
 
 AC_ARG_ENABLE(
 	[dco],
-	[AS_HELP_STRING([--enable-dco], [enable data channel offload support using the ovpn-dco kernel module (always enabled on Windows) @<:@default=no@:>@])],
+	[AS_HELP_STRING([--disable-dco], [disable data channel offload support using the ovpn-dco kernel module @<:@default=yes@:>@ on Linux/FreeBSD, can't disable on Windows])],
 	,
-	[enable_dco="no"]
+	[
+		case "$host" in
+			*-*-linux*)
+				enable_dco="auto"
+			;;
+			*-*-freebsd*)
+				enable_dco="auto"
+			;;
+			*)
+				# note that this does not disable it for Windows
+				enable_dco="no"
+			;;
+		esac
+	]
 )
 
 AC_ARG_ENABLE(
 	[iproute2],
-	[AS_HELP_STRING([--enable-iproute2], [enable support for iproute2 @<:@default=no@:>@])],
+	[AS_HELP_STRING([--enable-iproute2], [enable support for iproute2 (disables DCO) @<:@default=no@:>@])],
 	,
 	[enable_iproute2="no"]
 )
@@ -536,7 +549,7 @@ AC_CHECK_DECLS(
 	,
 	[[${SOCKET_INCLUDES}]]
 )
-AC_CHECKING([anonymous union support])
+AC_MSG_CHECKING([anonymous union support])
 AC_COMPILE_IFELSE(
 	[AC_LANG_PROGRAM(
 		[[
@@ -771,28 +784,59 @@ PKG_CHECK_MODULES(
 )
 
 
-if test "$enable_dco" = "yes"; then
-dnl
-dnl Include generic netlink library used to talk to ovpn-dco
-dnl
+if test "$enable_dco" != "no"; then
+	enable_dco_arg="$enable_dco"
+	if test "${enable_iproute2}" = "yes"; then
+		AC_MSG_WARN([DCO cannot be enabled when using iproute2])
+		enable_dco="no"
+	fi
 	case "$host" in
 		*-*-linux*)
-			PKG_CHECK_MODULES([LIBNL_GENL],
+			if test "$enable_dco" = "no"; then
+				if test "$enable_dco_arg" = "auto"; then
+					AC_MSG_WARN([DCO support disabled])
+				else
+					AC_MSG_ERROR([DCO support can't be enabled])
+				fi
+			else
+				dnl
+				dnl Include generic netlink library used to talk to ovpn-dco
+				dnl
+				PKG_CHECK_MODULES([LIBNL_GENL],
 					  [libnl-genl-3.0 >= 3.4.0],
 					  [have_libnl="yes"],
-					  [AC_MSG_ERROR([libnl-genl-3.0 package not found or too old. Is the development package and pkg-config installed? Must be version 3.4.0 or newer])]
-			)
-
-			CFLAGS="${CFLAGS} ${LIBNL_GENL_CFLAGS}"
-			LIBS="${LIBS} ${LIBNL_GENL_LIBS}"
+					  [
+					   AC_MSG_ERROR([libnl-genl-3.0 package not found or too old. Is the development package and pkg-config installed? Must be version 3.4.0 or newer for DCO])
+					  ]
+				)
+				CFLAGS="${CFLAGS} ${LIBNL_GENL_CFLAGS}"
+				LIBS="${LIBS} ${LIBNL_GENL_LIBS}"
 
-			AC_DEFINE(ENABLE_DCO, 1, [Enable shared data channel offload])
-			AC_MSG_NOTICE([Enabled ovpn-dco support for Linux])
+				AC_DEFINE(ENABLE_DCO, 1, [Enable shared data channel offload])
+				AC_MSG_NOTICE([Enabled ovpn-dco support for Linux])
+			fi
 			;;
 		*-*-freebsd*)
-			LIBS="${LIBS} -lnv"
-			AC_DEFINE(ENABLE_DCO, 1, [Enable data channel offload for FreeBSD])
-			AC_MSG_NOTICE([Enabled ovpn-dco support for FreeBSD])
+			AC_CHECK_LIB(
+				[nv],
+				[nvlist_create],
+				[
+				 LIBS="${LIBS} -lnv"
+				 AC_DEFINE(ENABLE_DCO, 1, [Enable data channel offload for FreeBSD])
+				 AC_MSG_NOTICE([Enabled ovpn-dco support for FreeBSD])
+				],
+				[
+				 enable_dco="no"
+				 AC_MSG_WARN([Name/Value pair library not found.])
+				]
+			)
+			if test "$enable_dco" = "no"; then
+				if test "$enable_dco_arg" = "auto"; then
+					AC_MSG_WARN([DCO support disabled])
+				else
+					AC_MSG_ERROR([DCO support can't be enabled])
+				fi
+			fi
 			;;
 		*-mingw*)
 			AC_MSG_NOTICE([NOTE: --enable-dco ignored on Windows because it's always enabled])
Signature · 1 line
2.34.1
Acked-by on v3 1/1
#4 lore raw
Quoted 86 lines · Frank Lichtenheld

Automatically disabled when
- iproute2 is enabled
(Don't want to force people specifying --disable-dco explicitely)
- libnv is missing on FreeBSD
(FreeBSD version too old anyway)

Will still error out if libnl-genl is missing on Linux to make people aware of the new dependency.

---
 configure.ac | 82 ++++++++++++++++++++++++++++++++++++++++------------
 1 file changed, 63 insertions(+), 19 deletions(-)

v2: error out when libnl-genl is missing as discussed with ordex on
IRC.

v3:
- improvements to the messages, suggested by Selva
- further improvements to the default specification, trying to make it
clear
- if enabling iproute2, do not test for libnl-genl

configure.ac +1 -1
index 78c99740..ba33ccd8 100644
@@ -146,14 +146,27 @@ AC_ARG_ENABLE(
 
 AC_ARG_ENABLE(
        [dco],
-       [AS_HELP_STRING([--enable-dco], [enable data channel offload
 support using the ovpn-dco kernel module (always enabled on Windows)
 @<:@default=no@:>@])],
+       [AS_HELP_STRING([--disable-dco], [disable data channel offload

support using the ovpn-dco kernel module @<:@default=yes@:>@ on Linux/FreeBSD, can't disable on Windows])],

        ,
configure.ac +10 -1
-       [enable_dco="no"]
+       [
+               case "$host" in
+                       *-*-linux*)
+                               enable_dco="auto"
+                       ;;
+                       *-*-freebsd*)
+                               enable_dco="auto"
+                       ;;
+                       *)
+                               # note that this does not disable it for

Windows

configure.ac +4 -1
+                               enable_dco="no"
+                       ;;
+               esac
+       ]
 )
 
 AC_ARG_ENABLE(
        [iproute2],
-       [AS_HELP_STRING([--enable-iproute2], [enable support for iproute2

@<:@default=no@:>@])],
+ [AS_HELP_STRING([--enable-iproute2], [enable support for iproute2
(disables DCO) @<:@default=no@:>@])],

        ,
        [enable_iproute2="no"]

)

configure.ac +4 -5
@@ -536,7 +549,7 @@ AC_CHECK_DECLS(
        ,
        [[${SOCKET_INCLUDES}]]
 )
-AC_CHECKING([anonymous union support])
+AC_MSG_CHECKING([anonymous union support])
 AC_COMPILE_IFELSE(
        [AC_LANG_PROGRAM(
                [[
@@ -771,28 +784,59 @@ PKG_CHECK_MODULES(
 )
 
 
-if test "$enable_dco" = "yes"; then
-dnl
-dnl Include generic netlink library used to talk to ovpn-dco
-dnl
+if test "$enable_dco" != "no"; then
+       enable_dco_arg="$enable_dco"
+       if test "${enable_iproute2}" = "yes"; then

configure.ac PKG_CHECK_MODULES( · line 798

Quoted 10 lines
configure.ac +6 -1
+               AC_MSG_WARN([DCO cannot be enabled when using iproute2])
+               enable_dco="no"
+       fi
        case "$host" in
                *-*-linux*)
-                       PKG_CHECK_MODULES([LIBNL_GENL],
+                       if test "$enable_dco" = "no"; then
+                               if test "$enable_dco_arg" = "auto"; then
+                                       AC_MSG_WARN([DCO support
 disabled])

+ else

Quoted 69 lines
configure.ac +5 -0
+                                       AC_MSG_ERROR([DCO support can't be
 enabled])
+                               fi
+                       else
+                               dnl
+                               dnl Include generic netlink library used

to talk to ovpn-dco

configure.ac +2 -1
+                               dnl
+                               PKG_CHECK_MODULES([LIBNL_GENL],
                                          [libnl-genl-3.0 >= 3.4.0],
                                          [have_libnl="yes"],
-                                         [AC_MSG_ERROR([libnl-genl-3.0

package not found or too old. Is the development package and pkg-config installed? Must be version 3.4.0 or newer])]

configure.ac +2 -4
-                       )
-
-                       CFLAGS="${CFLAGS} ${LIBNL_GENL_CFLAGS}"
-                       LIBS="${LIBS} ${LIBNL_GENL_LIBS}"
+                                         [
+                                          AC_MSG_ERROR([libnl-genl-3.0

package not found or too old. Is the development package and pkg-config installed? Must be version 3.4.0 or newer for DCO])

configure.ac +4 -1
+                                         ]
+                               )
+                               CFLAGS="${CFLAGS} ${LIBNL_GENL_CFLAGS}"
+                               LIBS="${LIBS} ${LIBNL_GENL_LIBS}"
 
-                       AC_DEFINE(ENABLE_DCO, 1, [Enable shared data

channel offload])

configure.ac +1 -1
-                       AC_MSG_NOTICE([Enabled ovpn-dco support for Linux])
+                               AC_DEFINE(ENABLE_DCO, 1, [Enable shared

data channel offload])
+ AC_MSG_NOTICE([Enabled ovpn-dco support
for Linux])

configure.ac +1 -2
+                       fi
                        ;;
                *-*-freebsd*)
-                       LIBS="${LIBS} -lnv"
-                       AC_DEFINE(ENABLE_DCO, 1, [Enable data channel

offload for FreeBSD])
- AC_MSG_NOTICE([Enabled ovpn-dco support for
FreeBSD])

configure.ac +6 -0
+                       AC_CHECK_LIB(
+                               [nv],
+                               [nvlist_create],
+                               [
+                                LIBS="${LIBS} -lnv"
+                                AC_DEFINE(ENABLE_DCO, 1, [Enable data

channel offload for FreeBSD])
+ AC_MSG_NOTICE([Enabled ovpn-dco support
for FreeBSD])

configure.ac +4 -0
+                               ],
+                               [
+                                enable_dco="no"
+                                AC_MSG_WARN([Name/Value pair library not

found.])

configure.ac +7 -0
+                               ]
+                       )
+                       if test "$enable_dco" = "no"; then
+                               if test "$enable_dco_arg" = "auto"; then
+                                       AC_MSG_WARN([DCO support disabled])
+                               else
+                                       AC_MSG_ERROR([DCO support can't be

enabled])

configure.ac +2 -0
+                               fi
+                       fi
                        ;;
                *-mingw*)
                        AC_MSG_NOTICE([NOTE: --enable-dco ignored on
Quoted 2 lines

Windows because it's always enabled])

Looks good to me.

Selva

Acked-by on v3 1/1
#5 lore raw
In reply to Frank Lichtenheld

Hi,

Quoted 10 lines · Frank Lichtenheld

Automatically disabled when
- iproute2 is enabled
(Don't want to force people specifying --disable-dco explicitely)
- libnv is missing on FreeBSD
(FreeBSD version too old anyway)

Will still error out if libnl-genl is missing on Linux to make people aware of the new dependency.

Signature · 1 line
Antonio Quartulli
#6 lore raw
In reply to Frank Lichtenheld

Hi,

Quoted 8 lines · Frank Lichtenheld

Automatically disabled when
- iproute2 is enabled
(Don't want to force people specifying --disable-dco explicitely)
- libnv is missing on FreeBSD
(FreeBSD version too old anyway)

Will still error out if libnl-genl is missing on Linux to make people aware of the new dependency.

Indeed it does, and all GH Ubuntu instances are now dark red...

https://github.com/cron2/openvpn/actions/runs/4177012136/jobs/7234044968

Can I have a v4 that updates the GH requirements so we can merge this without all red...?

The change should be trivial...

- name: Install dependencies
run: sudo apt update && sudo apt install -y mingw-w64 libtool automake autoconf man2html unzip cmake ninja-build build-essential wget

... but having it in this same patch would mean "no single commit is broken, if avoidable"

gert

Signature · 6 lines
"If was one thing all people took for granted, was conviction that if you 
 feed honest figures into a computer, honest figures come out. Never doubted 
 it myself till I met a computer with a sense of humor."
                             Robert A. Heinlein, The Moon is a Harsh Mistress

Gert Doering - Munich, Germany                             [email protected]...
#7 lore raw

PATCH v4 1/1 configure: enable DCO by default on FreeBSD/Linux

In reply to Frank Lichtenheld

Automatically disabled when
- iproute2 is enabled
- libnl-genl is missing on Linux
- libnv is missing on FreeBSD

---
 .github/workflows/build.yaml | 13 ++----
 configure.ac                 | 79 ++++++++++++++++++++++++++++--------
 2 files changed, 66 insertions(+), 26 deletions(-)

v2: error out when libnl-genl is missing as discussed with ordex on
IRC.
v3:
- improvements to the messages, suggested by Selva
- further improvements to the default specification, trying to make it clear
- if enabling iproute2, do not test for libnl-genl
v4: add updates for GHA

.github/workflows/build.yaml +4 -9
index 699964fd..3265725f 100644
@@ -275,10 +275,12 @@ jobs:
             sslpkg: "libssl1.0-dev"
             ssllib: openssl
             libname: OpenSSL 1.0.2
+            extraconf: "--disable-dco"
           - os: ubuntu-18.04
             sslpkg: "libssl-dev"
             libname: OpenSSL 1.1.1
             ssllib: openssl
+            extraconf: "--disable-dco"
           - os: ubuntu-20.04
             sslpkg: "libssl-dev"
             libname: OpenSSL 1.1.1
@@ -312,22 +314,15 @@ jobs:
             libname: OpenSSL 1.1.1
             ssllib: openssl
             extraconf: "--disable-lzo --disable-lz4"
-          - os: ubuntu-20.04
-            sslpkg: "libssl-dev"
-            libname: OpenSSL 1.1.1
-            ssllib: openssl
-            extraconf: "--enable-dco"
-            nlpkg: "libnl-genl-3-dev"
 
     name: "gcc - ${{matrix.os}} - ${{matrix.libname}} ${{matrix.extraconf}}"
     env:
       SSLPKG: "${{matrix.sslpkg}}"
-      NLPKG: "${{matrix.nlpkg}}"
 
     runs-on: ${{matrix.os}}
     steps:
       - name: Install dependencies
-        run: sudo apt update && sudo apt install -y liblzo2-dev libpam0g-dev liblz4-dev libcap-ng-dev linux-libc-dev man2html libcmocka-dev python3-docutils libtool automake autoconf ${SSLPKG} ${NLPKG}
+        run: sudo apt update && sudo apt install -y liblzo2-dev libpam0g-dev liblz4-dev libcap-ng-dev libnl-genl-3-dev linux-libc-dev man2html libcmocka-dev python3-docutils libtool automake autoconf ${SSLPKG}
       - name: Checkout OpenVPN
         uses: actions/[email protected]...
       - name: autoconf
@@ -354,7 +349,7 @@ jobs:
     runs-on: ${{matrix.os}}
     steps:
       - name: Install dependencies
-        run: sudo apt update && sudo apt install -y liblzo2-dev libpam0g-dev liblz4-dev libcap-ng-dev linux-libc-dev man2html clang libcmocka-dev python3-docutils libtool automake autoconf libmbedtls-dev
+        run: sudo apt update && sudo apt install -y liblzo2-dev libpam0g-dev liblz4-dev libcap-ng-dev libnl-genl-3-dev linux-libc-dev man2html clang libcmocka-dev python3-docutils libtool automake autoconf libmbedtls-dev
       - name: Checkout OpenVPN
         uses: actions/[email protected]...
       - name: autoconf
configure.ac +62 -17

111 lines not on this page · raw message

Signature · 1 line
2.34.1
#8 lore raw
Quoted 5 lines · Frank Lichtenheld

Automatically disabled when
- iproute2 is enabled
- libnl-genl is missing on Linux
- libnv is missing on FreeBSD

NAK, I accidentially based this on v2 instead of v3.

Signature · 1 line
  Frank Lichtenheld
#9 lore raw

PATCH v5 1/1 configure: enable DCO by default on FreeBSD/Linux

In reply to Frank Lichtenheld

Automatically disabled when
- iproute2 is enabled
(Don't want to force people specifying --disable-dco explicitely)
- libnv is missing on FreeBSD
(FreeBSD version too old anyway)

Will still error out if libnl-genl is missing on Linux to make people aware of new dependency.

v2: error out when libnl-genl is missing as discussed with ordex on
IRC.
v3:
- improvements to the messages, suggested by Selva
- further improvements to the default specification, trying to make it clear
- if enabling iproute2, do not test for libnl-genl
v4: add updates for GHA
v5:
- v4 was missing the changes of v3. v5 combines the changes from v3 and v4
- fix build failure GHA/ubuntu1804/mbedtls
- fix build failure GHA/ubuntu2204/libressl

---
 .github/workflows/build.yaml | 22 +++++-----
 configure.ac                 | 82 +++++++++++++++++++++++++++---------
 2 files changed, 74 insertions(+), 30 deletions(-)
.github/workflows/build.yaml +11 -11
index 699964fd..162dd8ce 100644
@@ -265,20 +265,27 @@ jobs:
     strategy:
       fail-fast: false
       matrix:
-        os: [ubuntu-18.04, ubuntu-20.04, ubuntu-22.04]
+        os: [ubuntu-20.04, ubuntu-22.04]
         sslpkg: [libmbedtls-dev]
         ssllib: [mbedtls]
         libname: [mbed TLS]
 
         include:
+          - os: ubuntu-18.04
+            sslpkg: "libmbedtls-dev"
+            ssllib: mbedtls
+            libname: mbed TLS
+            extraconf: "--disable-dco"
           - os: ubuntu-18.04
             sslpkg: "libssl1.0-dev"
             ssllib: openssl
             libname: OpenSSL 1.0.2
+            extraconf: "--disable-dco"
           - os: ubuntu-18.04
             sslpkg: "libssl-dev"
             libname: OpenSSL 1.1.1
             ssllib: openssl
+            extraconf: "--disable-dco"
           - os: ubuntu-20.04
             sslpkg: "libssl-dev"
             libname: OpenSSL 1.1.1
@@ -312,22 +319,15 @@ jobs:
             libname: OpenSSL 1.1.1
             ssllib: openssl
             extraconf: "--disable-lzo --disable-lz4"
-          - os: ubuntu-20.04
-            sslpkg: "libssl-dev"
-            libname: OpenSSL 1.1.1
-            ssllib: openssl
-            extraconf: "--enable-dco"
-            nlpkg: "libnl-genl-3-dev"
 
     name: "gcc - ${{matrix.os}} - ${{matrix.libname}} ${{matrix.extraconf}}"
     env:
       SSLPKG: "${{matrix.sslpkg}}"
-      NLPKG: "${{matrix.nlpkg}}"
 
     runs-on: ${{matrix.os}}
     steps:
       - name: Install dependencies
-        run: sudo apt update && sudo apt install -y liblzo2-dev libpam0g-dev liblz4-dev libcap-ng-dev linux-libc-dev man2html libcmocka-dev python3-docutils libtool automake autoconf ${SSLPKG} ${NLPKG}
+        run: sudo apt update && sudo apt install -y liblzo2-dev libpam0g-dev liblz4-dev libcap-ng-dev libnl-genl-3-dev linux-libc-dev man2html libcmocka-dev python3-docutils libtool automake autoconf ${SSLPKG}
       - name: Checkout OpenVPN
         uses: actions/[email protected]...
       - name: autoconf
@@ -354,7 +354,7 @@ jobs:
     runs-on: ${{matrix.os}}
     steps:
       - name: Install dependencies
-        run: sudo apt update && sudo apt install -y liblzo2-dev libpam0g-dev liblz4-dev libcap-ng-dev linux-libc-dev man2html clang libcmocka-dev python3-docutils libtool automake autoconf libmbedtls-dev
+        run: sudo apt update && sudo apt install -y liblzo2-dev libpam0g-dev liblz4-dev libcap-ng-dev libnl-genl-3-dev linux-libc-dev man2html clang libcmocka-dev python3-docutils libtool automake autoconf libmbedtls-dev
       - name: Checkout OpenVPN
         uses: actions/[email protected]...
       - name: autoconf
@@ -514,7 +514,7 @@ jobs:
 
     steps:
       - name: Install dependencies
-        run: sudo apt update && sudo apt install -y liblzo2-dev libpam0g-dev liblz4-dev linux-libc-dev man2html clang libcmocka-dev python3-docutils libtool automake autoconf pkg-config libcap-ng-dev
+        run: sudo apt update && sudo apt install -y liblzo2-dev libpam0g-dev liblz4-dev linux-libc-dev man2html clang libcmocka-dev python3-docutils libtool automake autoconf pkg-config libcap-ng-dev libnl-genl-3-dev
       - name: "libressl: checkout"
         uses: actions/[email protected]...
         with:
configure.ac +63 -19

112 lines not on this page · raw message

Signature · 1 line
2.34.1
#10 lore raw

This patch is identical to v3, except that it modifies the github actions to avoid GHA explosions on the linux workers. So recording Selva's and Antonio's ACKs of v3 here on v6.

Pushed to GHA and buildbots, all of them are happy now.

(We need to remember to add this to Changes.rst, as it might come as a surprise to people upgrading 2.6.0 -> 2.6.1 and building from source)

Your patch has been applied to the master and release/2.6 branch.

commit 2a1a21e3da3ec66d901864edd7b3b0e2498b3b0a (master) commit f63c9b1edbda41491ba2e05ff706bf0233903cb6 (release/2.6)

Author: Frank Lichtenheld
Date:   Wed Feb 15 17:26:54 2023 +0100
     configure: enable DCO by default on FreeBSD/Linux

     Signed-off-by: Frank Lichtenheld <[email protected]...>
     Acked-by: Selva Nair <[email protected]...>
     Acked-by: Antonio Quartulli <[email protected]...>
     Message-Id: <[email protected]...>
     URL: https://www.mail-archive.com/[email protected]/msg26272.html
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering