* [ULOGD PATCH 1/9] Set timestamp in NFLOG for INPUT and OUTPUT.
@ 2008-05-19 22:31 Eric Leblond
2008-06-01 23:57 ` Pablo Neira Ayuso
0 siblings, 1 reply; 2+ messages in thread
From: Eric Leblond @ 2008-05-19 22:31 UTC (permalink / raw)
To: netfilter-devel; +Cc: Eric Leblond
Signed-off-by: Eric Leblond <eric@inl.fr>
---
input/packet/ulogd_inppkt_NFLOG.c | 15 ++++++++-------
1 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/input/packet/ulogd_inppkt_NFLOG.c b/input/packet/ulogd_inppkt_NFLOG.c
index f258473..8d08bd8 100644
--- a/input/packet/ulogd_inppkt_NFLOG.c
+++ b/input/packet/ulogd_inppkt_NFLOG.c
@@ -344,13 +344,14 @@ interp_packet(struct ulogd_pluginstance *upi, struct nflog_data *ldata)
/* god knows why timestamp_usec contains crap if timestamp_sec
* == 0 if (pkt->timestamp_sec || pkt->timestamp_usec) { */
- if (nflog_get_timestamp(ldata, &ts) == 0 && ts.tv_sec) {
- /* FIXME: convert endianness */
- ret[NFLOG_KEY_OOB_TIME_SEC].u.value.ui32 = ts.tv_sec & 0xffffffff;
- ret[NFLOG_KEY_OOB_TIME_SEC].flags |= ULOGD_RETF_VALID;
- ret[NFLOG_KEY_OOB_TIME_USEC].u.value.ui32 = ts.tv_usec & 0xffffffff;
- ret[NFLOG_KEY_OOB_TIME_USEC].flags |= ULOGD_RETF_VALID;
- }
+ if (! (nflog_get_timestamp(ldata, &ts) == 0 && ts.tv_sec))
+ gettimeofday(&ts, NULL);
+
+ /* FIXME: convert endianness */
+ ret[NFLOG_KEY_OOB_TIME_SEC].u.value.ui32 = ts.tv_sec & 0xffffffff;
+ ret[NFLOG_KEY_OOB_TIME_SEC].flags |= ULOGD_RETF_VALID;
+ ret[NFLOG_KEY_OOB_TIME_USEC].u.value.ui32 = ts.tv_usec & 0xffffffff;
+ ret[NFLOG_KEY_OOB_TIME_USEC].flags |= ULOGD_RETF_VALID;
ret[NFLOG_KEY_OOB_MARK].u.value.ui32 = mark;
ret[NFLOG_KEY_OOB_MARK].flags |= ULOGD_RETF_VALID;
--
1.5.4.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-06-01 23:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-19 22:31 [ULOGD PATCH 1/9] Set timestamp in NFLOG for INPUT and OUTPUT Eric Leblond
2008-06-01 23:57 ` Pablo Neira Ayuso
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.