[Openvpn-devel,XS] Change in openvpn[master]: Haiku: Fix short interface path length

Message ID f00596f42cf6fc3b5103ac7dc089cec0186927ee-HTML@gerrit.openvpn.net
State Superseded
Headers show
Series [Openvpn-devel,XS] Change in openvpn[master]: Haiku: Fix short interface path length | expand

Commit Message

d12fk (Code Review) Jan. 28, 2025, 1:50 a.m. UTC
Attention is currently required from: flichtenheld, plaisthos.

Hello plaisthos, flichtenheld,

I'd like you to do a code review.
Please visit

    http://gerrit.openvpn.net/c/openvpn/+/689?usp=email

to review the following change.


Change subject: Haiku: Fix short interface path length
......................................................................

Haiku: Fix short interface path length

* Haiku uses full paths for interface names, 16 characters
  isn't enough.

Change-Id: I6de60ed5c03ea45e1d7a3f7777bfc8ed5075e84d
---
M src/openvpn/route.h
1 file changed, 7 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/89/689/1

Patch

diff --git a/src/openvpn/route.h b/src/openvpn/route.h
index 421e7d2..69b06b8 100644
--- a/src/openvpn/route.h
+++ b/src/openvpn/route.h
@@ -155,6 +155,8 @@ 
     /* gateway interface */
 #ifdef _WIN32
     DWORD adapter_index; /* interface or ~0 if undefined */
+#elif defined(TARGET_HAIKU)
+    char iface[PATH_MAX]; /* iface names are full /dev path with driver name */
 #else
     char iface[16]; /* interface name (null terminated), may be empty */
 #endif
@@ -186,8 +188,13 @@ 
 #else
     /* non linux platform don't have this constant defined */
 #ifndef IFNAMSIZ
+#if defined(TARGET_HAIKU)
+/* iface names are full /dev path with driver name */
+#define IFNAMSIZ PATH_MAX
+#else
 #define IFNAMSIZ 16
 #endif
+#endif
     char iface[IFNAMSIZ]; /* interface name (null terminated), may be empty */
 #endif