]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
app-layer: use already defined constant
authorPhilippe Antoine <pantoine@oisf.net>
Fri, 21 Jun 2024 17:14:23 +0000 (19:14 +0200)
committerVictor Julien <victor@inliniac.net>
Tue, 2 Jul 2024 09:52:38 +0000 (11:52 +0200)
FLOW_PROTO_APPLAYER_MAX

src/app-layer.c

index 0cf8405eab0eb65fb921c894c9e2b3ef4d3dca86..11b36f6a082cdd02d972d786a9b39b2c7399e2d5 100644 (file)
@@ -1139,7 +1139,6 @@ static void AppLayerSetupExceptionPolicyPerProtoCounters(
     }
 }
 
-#define IPPROTOS_MAX 2
 void AppLayerSetupCounters(void)
 {
     const uint8_t ipprotos[] = { IPPROTO_TCP, IPPROTO_UDP };
@@ -1162,7 +1161,7 @@ void AppLayerSetupCounters(void)
 
     AppLayerProtoDetectSupportedAppProtocols(alprotos);
 
-    for (uint8_t p = 0; p < IPPROTOS_MAX; p++) {
+    for (uint8_t p = 0; p < FLOW_PROTO_APPLAYER_MAX; p++) {
         const uint8_t ipproto = ipprotos[p];
         const uint8_t ipproto_map = FlowGetProtoMapping(ipproto);
         const char *ipproto_suffix = (ipproto == IPPROTO_TCP) ? "_tcp" : "_udp";
@@ -1257,7 +1256,7 @@ void AppLayerRegisterThreadCounters(ThreadVars *tv)
         }
     }
 
-    for (uint8_t p = 0; p < IPPROTOS_MAX; p++) {
+    for (uint8_t p = 0; p < FLOW_PROTO_APPLAYER_MAX; p++) {
         const uint8_t ipproto = ipprotos[p];
         const uint8_t ipproto_map = FlowGetProtoMapping(ipproto);