[Openvpn-devel,v1] Add missing includes for C files and their own headers

Message ID 20261006132012.30845-1-gert@greenie.muc.de
State New
Headers
Series [Openvpn-devel,v1] Add missing includes for C files and their own headers |

Commit Message

Gert Doering Oct. 6, 2026, 1:20 p.m. UTC
  From: Frank Lichtenheld <frank@lichtenheld.com>

We don't strictly need those, but it is much better to
have them since the compiler will then ensure that we
do not have subtle differences between declarations and
definitions.

Also fix
- socks.h not being able to be included on its own
- open_tun_afunix stub for Windows having wrong
  parameters

Change-Id: I33b246dea9eb9383e1ca928e1330ba840b7f990c
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Razvan Cojocaru <razvanc@mailbox.org>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1984
---

This change was reviewed on Gerrit and approved by at least one
developer. I request to merge it to master.

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1984
This mail reflects revision 1 of this Change.

Acked-by according to Gerrit (reflected above):
Razvan Cojocaru <razvanc@mailbox.org>
  

Patch

diff --git a/src/openvpn/comp-lz4.c b/src/openvpn/comp-lz4.c
index 48797b0..57c6bb3 100644
--- a/src/openvpn/comp-lz4.c
+++ b/src/openvpn/comp-lz4.c
@@ -31,6 +31,7 @@ 
 #include <lz4.h>
 
 #include "comp.h"
+#include "comp-lz4.h"
 #include "error.h"
 
 #include "memdbg.h"
diff --git a/src/openvpn/cryptoapi.c b/src/openvpn/cryptoapi.c
index ad2706c..ef3c94c 100644
--- a/src/openvpn/cryptoapi.c
+++ b/src/openvpn/cryptoapi.c
@@ -47,6 +47,7 @@ 
 #include <ctype.h>
 
 #include "buffer.h"
+#include "cryptoapi.h"
 #include "openssl_compat.h"
 #include "win32.h"
 #include "xkey_common.h"
diff --git a/src/openvpn/dco_win.c b/src/openvpn/dco_win.c
index c230a90..6e5e295 100644
--- a/src/openvpn/dco_win.c
+++ b/src/openvpn/dco_win.c
@@ -27,6 +27,7 @@ 
 #include "syshead.h"
 
 #include "dco.h"
+#include "dco_win.h"
 #include "forward.h"
 #include "tun.h"
 #include "crypto.h"
diff --git a/src/openvpn/socks.c b/src/openvpn/socks.c
index 65ecb3c..b84da24 100644
--- a/src/openvpn/socks.c
+++ b/src/openvpn/socks.c
@@ -34,6 +34,7 @@ 
 
 #include "syshead.h"
 
+#include "socks.h"
 #include "common.h"
 #include "misc.h"
 #include "win32.h"
diff --git a/src/openvpn/socks.h b/src/openvpn/socks.h
index 846113d..caed18c 100644
--- a/src/openvpn/socks.h
+++ b/src/openvpn/socks.h
@@ -29,6 +29,8 @@ 
 #define SOCKS_H
 
 #include "buffer.h"
+#include "interval.h"
+#include "sig.h"
 
 struct openvpn_sockaddr;
 struct link_socket_actual;
diff --git a/src/openvpn/tun_afunix.c b/src/openvpn/tun_afunix.c
index a67a472..f494d42 100644
--- a/src/openvpn/tun_afunix.c
+++ b/src/openvpn/tun_afunix.c
@@ -35,6 +35,7 @@ 
 #include "argv.h"
 #include "options.h"
 #include "socket.h"
+#include "tun_afunix.h"
 
 #ifndef WIN32
 /* Windows does implement some AF_UNIX functionality but key features
@@ -172,8 +173,7 @@ 
 }
 #else  /* ifndef WIN32 */
 void
-open_tun_afunix(const char *dev, const char *dev_type, int mtu, struct tuntap *tt,
-                struct env_set env)
+open_tun_afunix(struct options *o, int mtu, struct tuntap *tt, struct env_set *orig_env)
 {
     msg(M_ERR, "AF_UNIX socket support not available on this platform");
 }
diff --git a/tests/unit_tests/openvpn/siphash_openssl.c b/tests/unit_tests/openvpn/siphash_openssl.c
index 99a7763..52f13b8 100644
--- a/tests/unit_tests/openvpn/siphash_openssl.c
+++ b/tests/unit_tests/openvpn/siphash_openssl.c
@@ -26,6 +26,7 @@ 
 #endif
 
 #include "siphash.h"
+#include "siphash_openssl.h"
 
 #ifdef ENABLE_CRYPTO_OPENSSL
 #include <openssl/opensslv.h>