]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
flow: fix integer warnings
authorPhilippe Antoine <contact@catenacyber.fr>
Thu, 14 Apr 2022 12:44:20 +0000 (14:44 +0200)
committerVictor Julien <vjulien@oisf.net>
Thu, 14 Apr 2022 20:44:18 +0000 (22:44 +0200)
Ticket: 4516

src/flow-timeout.c
src/flow.c
src/stream-tcp-reassemble.c
src/stream-tcp.h

index d6cca4900873aaaffe9e183738e504426f5083f9..1fa057ae296683ebd30af61eb6ef6fc188e44778 100644 (file)
@@ -300,8 +300,8 @@ int FlowForceReassemblyNeedReassembly(Flow *f)
     }
 
     TcpSession *ssn = (TcpSession *)f->protoctx;
-    int client = StreamNeedsReassembly(ssn, STREAM_TOSERVER);
-    int server = StreamNeedsReassembly(ssn, STREAM_TOCLIENT);
+    uint8_t client = StreamNeedsReassembly(ssn, STREAM_TOSERVER);
+    uint8_t server = StreamNeedsReassembly(ssn, STREAM_TOCLIENT);
 
     /* if state is not fully closed we assume that we haven't fully
      * inspected the app layer state yet */
index c1353a8a31e64a44cd43bc7db765b02fa4d5a1ea..b77c318d1ad5dee183d5b87dd4bfbce8c984d2c3 100644 (file)
@@ -1159,7 +1159,8 @@ void FlowUpdateState(Flow *f, const enum FlowState s)
 {
     if (s != f->flow_state) {
         /* set the state */
-        f->flow_state = s;
+        // Explicit cast from the enum type to the compact version
+        f->flow_state = (FlowStateType)s;
 
         /* update timeout policy and value */
         const uint32_t timeout_policy = FlowGetTimeoutPolicy(f);
index cdc3e66dd3bfe93112d31c8490cb7a4871b93ba0..114dba6e974ee8d378a8706e51b7cf60b5a3b9c4 100644 (file)
@@ -800,7 +800,7 @@ static int StreamTcpReassembleRawCheckLimit(const TcpSession *ssn,
 /**
  *  \brief see what if any work the TCP session still needs
  */
-int StreamNeedsReassembly(const TcpSession *ssn, uint8_t direction)
+uint8_t StreamNeedsReassembly(const TcpSession *ssn, uint8_t direction)
 {
     const TcpStream *stream = NULL;
 #ifdef DEBUG
index 3b4f4fc8a4054d6a30a3b3379778ca12ec287a9b..4284f5e73f8d7715d97f6e580b4b28a16d1c22f3 100644 (file)
@@ -175,7 +175,7 @@ enum {
 };
 
 TmEcode StreamTcp (ThreadVars *, Packet *, void *, PacketQueueNoLock *);
-int StreamNeedsReassembly(const TcpSession *ssn, uint8_t direction);
+uint8_t StreamNeedsReassembly(const TcpSession *ssn, uint8_t direction);
 TmEcode StreamTcpThreadInit(ThreadVars *, void *, void **);
 TmEcode StreamTcpThreadDeinit(ThreadVars *tv, void *data);
 void StreamTcpRegisterTests (void);