]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
flow/storage: use const for getter 8042/head
authorVictor Julien <vjulien@oisf.net>
Thu, 20 Oct 2022 05:41:09 +0000 (07:41 +0200)
committerVictor Julien <vjulien@oisf.net>
Thu, 20 Oct 2022 05:47:39 +0000 (07:47 +0200)
src/flow-storage.c
src/flow-storage.h
src/output-json.c

index d4f89e8a2d841b997763c375a828f35f6aaf288e..d1146542d92d085fe7871656d5d86a5b49fddb0b 100644 (file)
@@ -36,7 +36,7 @@ unsigned int FlowStorageSize(void)
     return StorageGetSize(STORAGE_FLOW);
 }
 
-void *FlowGetStorageById(Flow *f, FlowStorageId id)
+void *FlowGetStorageById(const Flow *f, FlowStorageId id)
 {
     return StorageGetById((Storage *)((void *)f + sizeof(Flow)), STORAGE_FLOW, id.id);
 }
index f896f2311db9c5a21553111e4ea7000665aefc18..29a0496a385892b0d1d6adc6a540b22437d3a206 100644 (file)
@@ -35,7 +35,7 @@ typedef struct FlowStorageId {
 
 unsigned int FlowStorageSize(void);
 
-void *FlowGetStorageById(Flow *h, FlowStorageId id);
+void *FlowGetStorageById(const Flow *h, FlowStorageId id);
 int FlowSetStorageById(Flow *h, FlowStorageId id, void *ptr);
 void *FlowAllocStorageById(Flow *h, FlowStorageId id);
 
index 9a1d21886e08fae3be27a353c7f0c943c4347912..0b6ea4abf14f74d10fa791777da3b32c5755ece4 100644 (file)
@@ -767,7 +767,7 @@ static int CreateJSONEther(JsonBuilder *js, const Packet *p, const Flow *f)
     } else if (f != NULL) {
         /* we are creating an ether object in a flow context, so we need to
            append to arrays */
-        MacSet *ms = FlowGetStorageById((Flow *)f, MacSetGetFlowStorageID());
+        MacSet *ms = FlowGetStorageById(f, MacSetGetFlowStorageID());
         if (ms != NULL && MacSetSize(ms) > 0) {
             jb_open_object(js, "ether");
             JSONMACAddrInfo info;