]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
Fix misc issues picked up by coccinelle.
authorVictor Julien <victor@inliniac.net>
Tue, 27 Mar 2012 15:05:39 +0000 (17:05 +0200)
committerVictor Julien <victor@inliniac.net>
Wed, 28 Mar 2012 09:32:46 +0000 (11:32 +0200)
src/flow.c
src/host.c
src/source-napatech.c

index 62f3e09c27216e9ff94e428c27f8b143f26926e5..c37ba0b7b332dc1e8dcb4a1453f0121dd766811c 100644 (file)
@@ -398,7 +398,7 @@ void FlowInitConfig(char quiet)
                 "Memcap: %"PRIu64", Hash table size %"PRIu64". Calculate "
                 "total hash size by multiplying \"flow.hash-size\" with %"PRIuMAX", "
                 "which is the hash bucket size.", flow_config.memcap, hash_size,
-                sizeof(FlowBucket));
+                (uintmax_t)sizeof(FlowBucket));
         exit(EXIT_FAILURE);
     }
     flow_hash = SCCalloc(flow_config.hash_size, sizeof(FlowBucket));
index 7d98278270a2c76f3a15673ac70725fe08b969e2..d1694d9c4222f781e047f3246bdea1663333dd16 100644 (file)
@@ -175,7 +175,7 @@ void HostInitConfig(char quiet)
                 "Memcap: %"PRIu64", Hash table size %"PRIu64". Calculate "
                 "total hash size by multiplying \"host.hash-size\" with %"PRIuMAX", "
                 "which is the hash bucket size.", host_config.memcap, hash_size,
-                sizeof(HostHashRow));
+                (uintmax_t)sizeof(HostHashRow));
         exit(EXIT_FAILURE);
     }
     host_hash = SCCalloc(host_config.hash_size, sizeof(HostHashRow));
index 4fc8b9b47315a0145e6e4590fea28034e894a2ea..1a50b356181c369fd2e25918549cd2c8b207d1f4 100644 (file)
@@ -321,13 +321,13 @@ TmEcode NapatechDecode(ThreadVars *tv, Packet *p, void *data, PacketQueue *pq,
     SCPerfCounterIncr(dtv->counter_pkts, tv->sc_perf_pca);
     SCPerfCounterIncr(dtv->counter_pkts_per_sec, tv->sc_perf_pca);
 
-    SCPerfCounterAddUI64(dtv->counter_bytes, tv->sc_perf_pca, p->pktlen);
-    SCPerfCounterAddDouble(dtv->counter_bytes_per_sec, tv->sc_perf_pca, p->pktlen);
-    SCPerfCounterAddDouble(dtv->counter_mbit_per_sec, tv->sc_perf_pca,
-            (p->pktlen * 8)/1000000.0);
+    SCPerfCounterAddUI64(dtv->counter_bytes, tv->sc_perf_pca, GET_PKT_LEN(p));
+//    SCPerfCounterAddDouble(dtv->counter_bytes_per_sec, tv->sc_perf_pca, GET_PKT_LEN(p));
+//    SCPerfCounterAddDouble(dtv->counter_mbit_per_sec, tv->sc_perf_pca,
+//            (GET_PKT_LEN(p) * 8)/1000000.0);
 
-    SCPerfCounterAddUI64(dtv->counter_avg_pkt_size, tv->sc_perf_pca, p->pktlen);
-    SCPerfCounterSetUI64(dtv->counter_max_pkt_size, tv->sc_perf_pca, p->pktlen);
+    SCPerfCounterAddUI64(dtv->counter_avg_pkt_size, tv->sc_perf_pca, GET_PKT_LEN(p));
+    SCPerfCounterSetUI64(dtv->counter_max_pkt_size, tv->sc_perf_pca, GET_PKT_LEN(p));
 
     switch (p->datalink) {
         case LINKTYPE_ETHERNET: