From: "ralf_lici (Code Review)" Date: Mon, 23 Jun 2025 13:15:54 +0000 In-Reply-To: References: Reply-To: ralf@...2726..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: <9cd6fa11147ae3a55cecd1c34e15732411e4f790-EmailReplacePatchSet-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="oYAhk9sGV1s="; charset=UTF-8 Subject: [Openvpn-devel] [XS] Change in openvpn[master]: dco linux: avoid redefining ovpn enums List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos , flichtenheld Cc: openvpn-devel --oYAhk9sGV1s= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: flichtenheld, plaisthos. Hello flichtenheld, plaisthos, I'd like you to reexamine a change. Please visit http://gerrit.openvpn.net/c/openvpn/+/1064?usp=3Demail to look at the new patch set (#2). Change subject: dco linux: avoid redefining ovpn enums ...................................................................... dco linux: avoid redefining ovpn enums Starting with Linux kernel version 6.16, a couple of ovpn-related enum definitions were introduced in the `include/uapi/linux/if_link.h` header. Redefining them in openvpn when they are already present in the system headers can lead to conflicts or build issues. This commit ensures that enum redefinitions are avoided by conditionally using the existing definitions from the system header when available. Change-Id: I4fa2d578f9c0a5a8aa24ca1d396102ef2ed9a425 Signed-off-by: Ralf Lici --- M src/openvpn/dco_linux.h 1 file changed, 7 insertions(+), 2 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/64/1064/2 diff --git a/src/openvpn/dco_linux.h b/src/openvpn/dco_linux.h index 273a6ad..4e441ec 100644 --- a/src/openvpn/dco_linux.h +++ b/src/openvpn/dco_linux.h @@ -40,6 +40,8 @@ =20 /* OVPN section */ +#ifndef IFLA_OVPN_MAX + enum ovpn_mode { OVPN_MODE_P2P, OVPN_MODE_MP, @@ -49,10 +51,13 @@ IFLA_OVPN_UNSPEC =3D 0, IFLA_OVPN_MODE, - __IFLA_OVPN_AFTER_LAST, - IFLA_OVPN_MAX =3D __IFLA_OVPN_AFTER_LAST - 1, + __IFLA_OVPN_MAX, }; +#define IFLA_OVPN_MAX (__IFLA_OVPN_MAX - 1) + +#endif /* ifndef IFLA_OVPN_MAX */ + typedef struct { struct nl_sock *nl_sock; -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1064?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I4fa2d578f9c0a5a8aa24ca1d396102ef2ed9a425 Gerrit-Change-Number: 1064 Gerrit-PatchSet: 2 Gerrit-Owner: ralf_lici Gerrit-Reviewer: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos Gerrit-Attention: flichtenheld Gerrit-MessageType: newpatchset --oYAhk9sGV1s= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is currently required from: flichtenheld, plaisthos.

ralf_lici uploaded patch set #2 to this change.

<= a href=3D"http://gerrit.openvpn.net/c/openvpn/+/1064?usp=3Demail">View Chan= ge

dco linux: avoid redefining ovpn enums

Starting with Linux ke= rnel version 6.16, a couple of ovpn-related enum
definitions were introd= uced in the `include/uapi/linux/if_link.h`
header. Redefining them in op= envpn when they are already present in the
system headers can lead to co= nflicts or build issues.

This commit ensures that enum redefinitions= are avoided by conditionally
using the existing definitions from the sy= stem header when available.

Change-Id: I4fa2d578f9c0a5a8aa24ca1d3961= 02ef2ed9a425
Signed-off-by: Ralf Lici <ralf@...2726...>
---
= M src/openvpn/dco_linux.h
1 file changed, 7 insertions(+), 2 deletions(-= )

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/64=
/1064/2
diff --git a/src/openvpn/dco_linux.h b/src/openvpn/dco_linu=
x.h
index 273a6ad..4e441ec 100644
--- a/src= /openvpn/dco_linux.h
+++ b/src/openvpn/dco_linux.h@@ -40,6 +40,8 @@

/* OVPN sectio= n */

+
enum ovpn_mode {
OVPN_MODE_P2P,=
OVPN_MODE_MP,
@@ -49,10 +51,13 @@
IFLA_OVPN_UNSPEC =3D 0,
IFLA_OVPN_MO= DE,

-= __IFLA_OVPN_AFTER_LAST,
- IFLA_OVPN_MAX =3D __IFLA_OVPN_AFTER_LAST - 1,
+ __IFLA_OVPN_MAX,
}= ;

+= #define IFLA_OVPN_MAX (__IFLA_OVPN_MAX - 1)
+
+#endif /* ifndef IFLA_OVPN_MAX */
+
typedef struct
{
struct nl_sock *nl_sock;

=

To view, visit change 1064. To unsubscribe, or for help writing mail filters= , visit settings.

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I4fa2d578f9c0a5a8aa24ca1d396= 102ef2ed9a425
Gerrit-Change-Number: 1064
Gerrit-PatchSet: 2
Gerrit-Owner: ralf_lici <ralf@...2726...>= ;
Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-Attention: plaisthos <arne-openvpn@...220...= ..1227...>
Gerrit-Attention: flichtenheld <frank@...2375...= 41...>
Gerrit-MessageType: newpatchset
--oYAhk9sGV1s=--