]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
capture: remove unnecessary mtu check
authorVictor Julien <vjulien@oisf.net>
Wed, 30 Nov 2022 17:22:48 +0000 (18:22 +0100)
committerVictor Julien <vjulien@oisf.net>
Wed, 14 Dec 2022 19:04:39 +0000 (20:04 +0100)
src/decode.h
src/suricata.c

index 6709aa775ba032db0d0b90151f171bde3c9aa4a6..b229d38c371da3f3f182ab5b45e0f25fb607afe7 100644 (file)
@@ -650,7 +650,6 @@ typedef struct Packet_
 } Packet;
 
 /** highest mtu of the interfaces we monitor */
-extern int g_default_mtu;
 #define DEFAULT_MTU 1500
 #define MINIMUM_MTU 68      /**< ipv4 minimum: rfc791 */
 
index 1f0921353044d819ab07e7df942e9d2ac582d3c5..3dfbdf3541371680fe9008b09b6e3ef7192d7af4 100644 (file)
@@ -182,9 +182,6 @@ int g_detect_disabled = 0;
 /** set caps or not */
 int sc_set_caps = FALSE;
 
-/** highest mtu of the interfaces we monitor */
-int g_default_mtu = 0;
-
 bool g_system = false;
 
 /** disable randomness to get reproducible results accross runs */
@@ -2408,7 +2405,6 @@ static int ConfigGetCaptureValue(SCInstance *suri)
      * back on a sane default. */
     const char *temp_default_packet_size;
     if ((ConfGet("default-packet-size", &temp_default_packet_size)) != 1) {
-        int mtu = 0;
         int lthread;
         int nlive;
         int strip_trailing_plus = 0;
@@ -2419,13 +2415,10 @@ static int ConfigGetCaptureValue(SCInstance *suri)
                 mtu = GetGlobalMTUWin32();
 
                 if (mtu > 0) {
-                    g_default_mtu = mtu;
                     /* SLL_HEADER_LEN is the longest header + 8 for VLAN */
                     default_packet_size = mtu + SLL_HEADER_LEN + 8;
                     break;
                 }
-
-                g_default_mtu = DEFAULT_MTU;
                 default_packet_size = DEFAULT_PACKET_SIZE;
                 break;
 #endif /* WINDIVERT */
@@ -2454,9 +2447,6 @@ static int ConfigGetCaptureValue(SCInstance *suri)
                             dev[len-1] = '\0';
                         }
                     }
-                    mtu = GetIfaceMTU(dev);
-                    g_default_mtu = MAX(mtu, g_default_mtu);
-
                     unsigned int iface_max_packet_size = GetIfaceMaxPacketSize(dev);
                     if (iface_max_packet_size > default_packet_size)
                         default_packet_size = iface_max_packet_size;
@@ -2465,7 +2455,6 @@ static int ConfigGetCaptureValue(SCInstance *suri)
                     break;
                 /* fall through */
             default:
-                g_default_mtu = DEFAULT_MTU;
                 default_packet_size = DEFAULT_PACKET_SIZE;
         }
     } else {