From: "cron2 (Code Review)" Date: Mon, 23 Jun 2025 14:34:28 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, ralf@...2726..., frank@...2641..., antonio@...2726... Message-ID: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="KnzEBaltbQA="; 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: ralf_lici Cc: plaisthos , flichtenheld , openvpn-devel --KnzEBaltbQA= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/10= 64?usp=3Demail ) 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 Message-Id: <20250623140748.13960-1-gert@...1296...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg31= 961.html Signed-off-by: Gert Doering --- M src/openvpn/dco_linux.h 1 file changed, 7 insertions(+), 2 deletions(-) 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 @@ /* 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: 3 Gerrit-Owner: ralf_lici Gerrit-Reviewer: flichtenheld Gerrit-Reviewer: ordex Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-MessageType: merged --KnzEBaltbQA= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 submitted this change.

View Change

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: I4fa2d= 578f9c0a5a8aa24ca1d396102ef2ed9a425
Signed-off-by: Ralf Lici <ralf@...1186...= .2726...>
Message-Id: <20250623140748.13960-1-gert@...1296...><= br>URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/ms= g31961.html
Signed-off-by: Gert Doering <gert@...1296...>
---M src/openvpn/dco_linux.h
1 file changed, 7 insertions(+), 2 deletions= (-)

diff --git a/src/openvpn/dco_linux.h b/src/openvpn/dco_linux.hindex 273a6ad..4e441ec 100644
--- a/src/openvpn/dco_= linux.h
+++ b/src/openvpn/dco_linux.h
@@ -4= 0,6 +40,8 @@

/* OVPN section */
+#ifndef IF= LA_OVPN_MAX
+<= br> enum ovpn_mode {
OVPN_MODE_P2P,
OVPN_MODE_MP,
@@ -49,10 +51,13 @@
= IFLA_OVPN_UNSPEC =3D 0,
IFLA_OVPN_MODE,
- __IFLA_OV= PN_AFTER_LAST,
- IFL= A_OVPN_MAX =3D __IFLA_OVPN_AFTER_LAST - 1,
+ __IFLA_OVPN_MAX,
};
<= span>
+#define IFLA_= OVPN_MAX (__IFLA_OVPN_MAX - 1)
+
+#endif /= * ifndef IFLA_OVPN_MAX */
+
typedef struct
{
= struct nl_sock *nl_sock;

To view, v= isit cha= nge 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: 3
Gerrit-Owner: ralf_lici <ralf@...2726...>= ;
Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
Gerrit-Reviewer: ordex <antonio@...2726...&= gt;
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-MessageType: merged
--KnzEBaltbQA=--