]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
app-layer/pd: minor code cleanup
authorVictor Julien <victor@inliniac.net>
Fri, 22 Mar 2019 19:34:06 +0000 (20:34 +0100)
committerVictor Julien <victor@inliniac.net>
Tue, 26 Mar 2019 08:23:33 +0000 (09:23 +0100)
src/app-layer-detect-proto.c

index 9add685f69fc6287a7cbb474513cd9be87b0d49c..afd4ee83d6d36c19dff7bbda4fd231158305c89a 100644 (file)
@@ -1099,18 +1099,13 @@ static void AppLayerProtoDetectPMGetIpprotos(AppProto alproto,
 {
     SCEnter();
 
-    const AppLayerProtoDetectPMSignature *s = NULL;
-    int i, j;
-    uint8_t ipproto;
-
-    for (i = 0; i < FLOW_PROTO_DEFAULT; i++) {
-        ipproto = FlowGetReverseProtoMapping(i);
-        for (j = 0; j < 2; j++) {
+    for (int i = 0; i < FLOW_PROTO_DEFAULT; i++) {
+        uint8_t ipproto = FlowGetReverseProtoMapping(i);
+        for (int j = 0; j < 2; j++) {
             AppLayerProtoDetectPMCtx *pm_ctx = &alpd_ctx.ctx_ipp[i].ctx_pm[j];
 
-            SigIntId x;
-            for (x = 0; x < pm_ctx->max_sig_id;x++) {
-                s = pm_ctx->map[x];
+            for (SigIntId x = 0; x < pm_ctx->max_sig_id; x++) {
+                const AppLayerProtoDetectPMSignature *s = pm_ctx->map[x];
                 if (s->alproto == alproto)
                     ipprotos[ipproto / 8] |= 1 << (ipproto % 8);
             }