]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
windivert: compile fixes 8834/head
authorVictor Julien <vjulien@oisf.net>
Sun, 7 May 2023 06:17:31 +0000 (08:17 +0200)
committerVictor Julien <vjulien@oisf.net>
Sun, 7 May 2023 09:10:12 +0000 (11:10 +0200)
src/source-windivert.c
src/suricata.c

index e35d8f1d74b04f8d90ad21c3890db12e2166c17f..a896c5757a7c5c025eaad6e7fd1cb85dacb13fa3 100644 (file)
@@ -88,6 +88,8 @@ TmEcode NoWinDivertSupportExit(ThreadVars *tv, const void *initdata,
 }
 
 #else /* implied we do have WinDivert support */
+#include "action-globals.h"
+#include "win32-syscall.h"
 
 typedef struct WinDivertThreadVars_ {
     WinDivertHandle filter_handle;
index e65426d47ba5276d8e3998b5d4be17742139bbc9..27126e30849e427303f2e949c619ac28f8094147 100644 (file)
 #include "util-time.h"
 #include "util-validate.h"
 
+#ifdef WINDIVERT
+#include "decode-sll.h"
+#include "win32-syscall.h"
+#endif
+
 /*
  * we put this here, because we only use it here in main.
  */
@@ -2449,9 +2454,9 @@ static int ConfigGetCaptureValue(SCInstance *suri)
         int strip_trailing_plus = 0;
         switch (suri->run_mode) {
 #ifdef WINDIVERT
-            case RUNMODE_WINDIVERT:
+            case RUNMODE_WINDIVERT: {
                 /* by default, WinDivert collects from all devices */
-                mtu = GetGlobalMTUWin32();
+                const int mtu = GetGlobalMTUWin32();
 
                 if (mtu > 0) {
                     /* SLL_HEADER_LEN is the longest header + 8 for VLAN */
@@ -2460,6 +2465,7 @@ static int ConfigGetCaptureValue(SCInstance *suri)
                 }
                 default_packet_size = DEFAULT_PACKET_SIZE;
                 break;
+            }
 #endif /* WINDIVERT */
             case RUNMODE_NETMAP:
                 /* in netmap igb0+ has a special meaning, however the