From 55cf11fdc2ede6bbd89d387fa8ec9f4524c72e46 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Thu, 20 Oct 2022 07:41:09 +0200 Subject: [PATCH] flow/storage: use const for getter --- src/flow-storage.c | 2 +- src/flow-storage.h | 2 +- src/output-json.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/flow-storage.c b/src/flow-storage.c index d4f89e8a2d..d1146542d9 100644 --- a/src/flow-storage.c +++ b/src/flow-storage.c @@ -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); } diff --git a/src/flow-storage.h b/src/flow-storage.h index f896f2311d..29a0496a38 100644 --- a/src/flow-storage.h +++ b/src/flow-storage.h @@ -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); diff --git a/src/output-json.c b/src/output-json.c index 9a1d21886e..0b6ea4abf1 100644 --- a/src/output-json.c +++ b/src/output-json.c @@ -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; -- 2.47.2