Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/openvpn: needs headers >= 4.16
@ 2023-09-18 20:44 Fabrice Fontaine
  2023-09-20 20:26 ` Thomas Petazzoni via buildroot
  2023-09-25 12:01 ` Peter Korsgaard
  0 siblings, 2 replies; 3+ messages in thread
From: Fabrice Fontaine @ 2023-09-18 20:44 UTC (permalink / raw)
  To: buildroot; +Cc: Fabrice Fontaine

NLMSGERR_ATTR_MAX has been added in kernel 4.16 with
https://github.com/torvalds/linux/commit/dc2b9f19e3bdaa87a7c3d123b8bba8a42d96d942
resulting in the following build failure since bump to version 2.6.4 in
commit a46ac2346558d05afe405dda3730169df4b677d2 and
https://github.com/OpenVPN/openvpn/commit/e34437c26b764851555e4acbe2ccca6bec235c7e:

dco_linux.c: In function 'ovpn_nl_cb_error':
dco_linux.c:303:27: error: 'NLMSGERR_ATTR_MAX' undeclared (first use in this function); did you mean '__CTRL_ATTR_MAX'?
     struct nlattr *tb_msg[NLMSGERR_ATTR_MAX + 1];
                           ^~~~~~~~~~~~~~~~~
                           __CTRL_ATTR_MAX

Fixes:
 - http://autobuild.buildroot.org/results/69b9737913ac0b5cd2c117d526602874da3ee487

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 package/openvpn/Config.in | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/package/openvpn/Config.in b/package/openvpn/Config.in
index 5aa2386d36..16fc93efae 100644
--- a/package/openvpn/Config.in
+++ b/package/openvpn/Config.in
@@ -1,6 +1,7 @@
 config BR2_PACKAGE_OPENVPN
 	bool "openvpn"
 	depends on BR2_USE_MMU # fork()
+	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_16
 	select BR2_PACKAGE_LIBCAP_NG
 	select BR2_PACKAGE_OPENSSL if !BR2_PACKAGE_MBEDTLS
 	select BR2_PACKAGE_LIBOPENSSL_ENABLE_DES if BR2_PACKAGE_LIBOPENSSL
@@ -38,3 +39,7 @@ config BR2_PACKAGE_OPENVPN_SMALL
 	  It saves around 100 KiB in binary file size.
 
 endif
+
+comment "openvpn needs headers >= 4.16"
+	depends on BR2_USE_MMU
+	depends on !BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_16
-- 
2.40.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Buildroot] [PATCH 1/1] package/openvpn: needs headers >= 4.16
  2023-09-18 20:44 [Buildroot] [PATCH 1/1] package/openvpn: needs headers >= 4.16 Fabrice Fontaine
@ 2023-09-20 20:26 ` Thomas Petazzoni via buildroot
  2023-09-25 12:01 ` Peter Korsgaard
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Petazzoni via buildroot @ 2023-09-20 20:26 UTC (permalink / raw)
  To: Fabrice Fontaine; +Cc: buildroot

On Mon, 18 Sep 2023 22:44:05 +0200
Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:

> NLMSGERR_ATTR_MAX has been added in kernel 4.16 with
> https://github.com/torvalds/linux/commit/dc2b9f19e3bdaa87a7c3d123b8bba8a42d96d942
> resulting in the following build failure since bump to version 2.6.4 in
> commit a46ac2346558d05afe405dda3730169df4b677d2 and
> https://github.com/OpenVPN/openvpn/commit/e34437c26b764851555e4acbe2ccca6bec235c7e:
> 
> dco_linux.c: In function 'ovpn_nl_cb_error':
> dco_linux.c:303:27: error: 'NLMSGERR_ATTR_MAX' undeclared (first use in this function); did you mean '__CTRL_ATTR_MAX'?
>      struct nlattr *tb_msg[NLMSGERR_ATTR_MAX + 1];
>                            ^~~~~~~~~~~~~~~~~
>                            __CTRL_ATTR_MAX
> 
> Fixes:
>  - http://autobuild.buildroot.org/results/69b9737913ac0b5cd2c117d526602874da3ee487
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> ---
>  package/openvpn/Config.in | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/package/openvpn/Config.in b/package/openvpn/Config.in
> index 5aa2386d36..16fc93efae 100644
> --- a/package/openvpn/Config.in
> +++ b/package/openvpn/Config.in
> @@ -1,6 +1,7 @@
>  config BR2_PACKAGE_OPENVPN
>  	bool "openvpn"
>  	depends on BR2_USE_MMU # fork()
> +	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_16

I think that's a bit brutal. Looking a bit at the OpenVPN code, it
looks like NLMSGERR_ATTR_MAX is only used by the DCO code added in
commit e34437c26b764851555e4acbe2ccca6bec235c7e, and this code can be
disabled using --disable-dco. Which we actually already support:

ifeq ($(BR2_PACKAGE_LIBNL),y)
OPENVPN_CONF_OPTS += --enable-dco
OPENVPN_DEPENDENCIES += libnl
else
OPENVPN_CONF_OPTS += --disable-dco
endif

So I guess the correct fix is rather:

ifeq ($(BR2_PACKAGE_LIBNL)$(BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_16),yy)
OPENVPN_CONF_OPTS += --enable-dco
OPENVPN_DEPENDENCIES += libnl
else
OPENVPN_CONF_OPTS += --disable-dco
endif

Could you check this?

Best regards,

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Buildroot] [PATCH 1/1] package/openvpn: needs headers >= 4.16
  2023-09-18 20:44 [Buildroot] [PATCH 1/1] package/openvpn: needs headers >= 4.16 Fabrice Fontaine
  2023-09-20 20:26 ` Thomas Petazzoni via buildroot
@ 2023-09-25 12:01 ` Peter Korsgaard
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2023-09-25 12:01 UTC (permalink / raw)
  To: Fabrice Fontaine; +Cc: buildroot

>>>>> "Fabrice" == Fabrice Fontaine <fontaine.fabrice@gmail.com> writes:

 > NLMSGERR_ATTR_MAX has been added in kernel 4.16 with
 > https://github.com/torvalds/linux/commit/dc2b9f19e3bdaa87a7c3d123b8bba8a42d96d942
 > resulting in the following build failure since bump to version 2.6.4 in
 > commit a46ac2346558d05afe405dda3730169df4b677d2 and
 > https://github.com/OpenVPN/openvpn/commit/e34437c26b764851555e4acbe2ccca6bec235c7e:

 > dco_linux.c: In function 'ovpn_nl_cb_error':
 > dco_linux.c:303:27: error: 'NLMSGERR_ATTR_MAX' undeclared (first use in this function); did you mean '__CTRL_ATTR_MAX'?
 >      struct nlattr *tb_msg[NLMSGERR_ATTR_MAX + 1];
 >                            ^~~~~~~~~~~~~~~~~
 >                            __CTRL_ATTR_MAX

 > Fixes:
 >  - http://autobuild.buildroot.org/results/69b9737913ac0b5cd2c117d526602874da3ee487

 > Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>

Committed to 2023.08.x, thanks.

-- 
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-09-25 12:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-18 20:44 [Buildroot] [PATCH 1/1] package/openvpn: needs headers >= 4.16 Fabrice Fontaine
2023-09-20 20:26 ` Thomas Petazzoni via buildroot
2023-09-25 12:01 ` Peter Korsgaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox