aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYunchih Chen <yunchih.cat@gmail.com>2017-12-01 11:24:05 +0800
committerYunchih Chen <yunchih.cat@gmail.com>2017-12-01 11:25:37 +0800
commitcf5a816a464cd38050152c6189e9ae400f888d5c (patch)
treedc79fb99ba570ba1e7af9b21899ec4080d869dfe
parent1336440f83216c58e2558fd07fec307422051cd6 (diff)
downloadnfcollect-cf5a816a464cd38050152c6189e9ae400f888d5c.tar
nfcollect-cf5a816a464cd38050152c6189e9ae400f888d5c.tar.gz
nfcollect-cf5a816a464cd38050152c6189e9ae400f888d5c.tar.bz2
nfcollect-cf5a816a464cd38050152c6189e9ae400f888d5c.tar.lz
nfcollect-cf5a816a464cd38050152c6189e9ae400f888d5c.tar.xz
nfcollect-cf5a816a464cd38050152c6189e9ae400f888d5c.tar.zst
nfcollect-cf5a816a464cd38050152c6189e9ae400f888d5c.zip
Minor fix
-rw-r--r--commit.c1
-rw-r--r--main.h8
-rw-r--r--nflog.c2
3 files changed, 5 insertions, 6 deletions
diff --git a/commit.c b/commit.c
index 3be2964..0db4163 100644
--- a/commit.c
+++ b/commit.c
@@ -4,7 +4,6 @@
extern char *storage_dir;
extern char *storage_prefix;
-const uint32_t write_blk_size = 8196;
void nfl_commit_init() {
diff --git a/main.h b/main.h
index f94c2f6..71ed7ca 100644
--- a/main.h
+++ b/main.h
@@ -100,9 +100,9 @@ typedef struct _nflog_state_t {
nflog_header_t* header;
nflog_entry_t* store;
- struct nflog_handle *nfl_fd;
- struct nflog_g_handle *nfl_group_fd;
+ struct nflog_handle *nfl_fd;
+ struct nflog_g_handle *nfl_group_fd;
- pthread_mutex_t lock;
- pthread_t thread;
+ pthread_mutex_t lock;
+ pthread_t thread;
} nflog_state_t;
diff --git a/nflog.c b/nflog.c
index 455ab50..6d30d32 100644
--- a/nflog.c
+++ b/nflog.c
@@ -74,7 +74,7 @@ static int handle_packet(struct nflog_g_handle *gh, struct nfgenmsg *nfmsg,
entry->uid = (uint32_t)~0;
// get current timestamp
- time(&entry->timestamp);
+ entry->timestamp = time(NULL);
nf->header->n_entries++;
}