From: "flichtenheld (Code Review)"
Date: Thu, 31 Jul 2025 11:17:33 +0000
References:
Reply-To: frank@...2641..., arne-openvpn@...1227...,
openvpn-devel@lists.sourceforge.net
Message-ID: <78179ad118e0a33fd5dd46e1293c076aad5a65b6-HTML@...2715...>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Disposition: inline
Content-Type: multipart/alternative; boundary="LRPjGAzCLSg="; charset=UTF-8
Subject: [Openvpn-devel] [S] Change in openvpn[release/2.6]: dco linux:
avoid redefining ovpn enums (2.6)
List-Id:
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
To: plaisthos
Cc: openvpn-devel
--LRPjGAzCLSg=
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Attention is currently required from: plaisthos.
Hello plaisthos,
I'd like you to do a code review.
Please visit
http://gerrit.openvpn.net/c/openvpn/+/1122?usp=3Demail
to review the following change.
Change subject: dco linux: avoid redefining ovpn enums (2.6)
......................................................................
dco linux: avoid redefining ovpn enums (2.6)
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.
This is the port to release/2.6 based on commit
1d3c2b67a73a0aa011c13e62f876d24e49d41df0.
Change-Id: I41c5dfc7489352a9534ff6b1585a5a81e0623ab1
Signed-off-by: Frank Lichtenheld
---
M src/openvpn/dco_linux.h
M src/openvpn/ovpn_dco_linux.h
2 files changed, 9 insertions(+), 4 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/22/1122/1
diff --git a/src/openvpn/dco_linux.h b/src/openvpn/dco_linux.h
index 511519a..62435d1 100644
--- a/src/openvpn/dco_linux.h
+++ b/src/openvpn/dco_linux.h
@@ -26,11 +26,11 @@
#include "event.h"
=20
-#include "ovpn_dco_linux.h"
-
#include
#include
+#include "ovpn_dco_linux.h"
+
typedef enum ovpn_key_slot dco_key_slot_t;
typedef enum ovpn_cipher_alg dco_cipher_t;
diff --git a/src/openvpn/ovpn_dco_linux.h b/src/openvpn/ovpn_dco_linux.h
index 73e19b5..34abc6a 100644
--- a/src/openvpn/ovpn_dco_linux.h
+++ b/src/openvpn/ovpn_dco_linux.h
@@ -237,14 +237,17 @@
OVPN_PACKET_ATTR_MAX =3D __OVPN_PACKET_ATTR_AFTER_LAST - 1,
};
+#ifndef IFLA_OVPN_MAX
+
enum ovpn_ifla_attrs {
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)
+
enum ovpn_mode {
__OVPN_MODE_FIRST =3D 0,
OVPN_MODE_P2P =3D __OVPN_MODE_FIRST,
@@ -253,4 +256,6 @@
__OVPN_MODE_AFTER_LAST,
};
+#endif /* ifndef IFLA_OVPN_MAX */
+
#endif /* _UAPI_LINUX_OVPN_DCO_H_ */
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1122?usp=3Demail
To unsubscribe, or for help writing mail filters, visit http://gerrit.openv=
pn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: release/2.6
Gerrit-Change-Id: I41c5dfc7489352a9534ff6b1585a5a81e0623ab1
Gerrit-Change-Number: 1122
Gerrit-PatchSet: 1
Gerrit-Owner: flichtenheld
Gerrit-Reviewer: plaisthos
Gerrit-CC: openvpn-devel
Gerrit-Attention: plaisthos
Gerrit-MessageType: newchange
--LRPjGAzCLSg=
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Attention is currently required from: plaisthos.
flichtenheld would like plaisthos to review this change.
V=
iew Change
dco linux: avoid redefining ovpn enums (2.6) Starting=
with Linux kernel version 6.16, a couple of ovpn-related enum definitio=
ns were introduced in the `include/uapi/linux/if_link.h` header. Redefin=
ing 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 definitio=
ns from the system header when available. This is the port to releas=
e/2.6 based on commit 1d3c2b67a73a0aa011c13e62f876d24e49d41df0. C=
hange-Id: I41c5dfc7489352a9534ff6b1585a5a81e0623ab1 Signed-off-by: Frank=
Lichtenheld <frank@...2641...> --- M src/openvpn/dco_linux.hM src/openvpn/ovpn_dco_linux.h 2 files changed, 9 insertions(+), 4 del=
etions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/ch=
anges/22/1122/1 diff --git a/src/openvpn/dco_linux.h b/src/openvpn/=
dco_linux.h index 511519a..62435d1 100644 -=
-- a/src/openvpn/dco_linux.h +++ b/src/openvpn/dco_linux.h<=
/span>@@ -26,11 +26,11 @@ #inc=
lude "event.h" -#include "ovpn_dco_linux.h" - #include <netlink=
/socket.h> #include <netlink/netlink.h> +#include &q=
uot;ovpn_dco_linux.h" + typedef enum ovpn_key_slot dco_key_slot_t; <=
br> typedef enum ovpn_cipher_alg dco_cipher_t; diff --git a/src/openvpn/ovpn_dco_linux.h b/src/openvpn/ovpn_dc=
o_linux.h index 73e19b5..34abc6a 100644 ---=
a/src/openvpn/ovpn_dco_linux.h +++ b/src/openvpn/ovpn_dco_=
linux.h @@ -237,14 +237,17 @@ OVPN_PACKET=
_ATTR_MAX =3D __OVPN_PACKET_ATTR_AFTER_LAST - 1, }; =
+#ifndef =
IFLA_OVPN_MAX + enum ovpn_ifla_attrs { IFLA_OVPN_UNSPEC =3D 0=
, IFLA_OVPN_MODE, - __IFLA_OVPN_AFTER_LAST, - IFLA_OVPN_MAX =3D __IFLA_OVPN_AFTER_LAS=
T - 1, + __IFLA_OVPN_=
MAX, }; +#define IFLA_OVPN_MAX (__IFLA_OVPN_MAX - 1) + enum ovpn_=
mode { __OVPN_MODE_FIRST =3D 0, OVPN_MO=
DE_P2P =3D __OVPN_MODE_FIRST, @@ -253,4 +256,6 @@ __OVPN_MODE_AFTER_LAST, }; +#endif /* ifndef IFLA_OV=
PN_MAX */ + #endif /* _UAPI_LINUX_OVPN_DCO_H_ */
To view, visit change 1122 . To unsubscribe, or for help writing mail filt=
ers, visit settings .
=
<=
meta itemprop=3D"name" content=3D"View Change"/>
Gerrit-Project: openvpn
Gerrit-Branch: release/2.6
Gerrit-Change-Id: I41c5dfc7489352a9534ff6b1585=
a5a81e0623ab1
Gerrit-Change-Number: 1122
Gerrit-PatchSet: 1
Gerrit-Owner: flichtenheld <frank@...2723...=
.>
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-MessageType: newchange
--LRPjGAzCLSg=--