summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Eitzenberger <heitzenberger@astaro.com>2009-10-08 17:26:33 +0200
committerHarald Welte <laforge@gnumonks.org>2010-10-21 19:15:36 +0200
commit4b9c8769d39790f0abebd8408a83fd6b2025d0d7 (patch)
tree87f0389a7c7cd5d5d0b631e0ff642a9fe15e2df1
parenta085cb4369d12d1dbce2654c932f5d322ae5074a (diff)
NFLOG: only set a valid interface index
Signed-off-by: Holger Eitzenberger <holger@eitzenberger.org>
-rw-r--r--input/packet/ulogd_inppkt_NFLOG.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/input/packet/ulogd_inppkt_NFLOG.c b/input/packet/ulogd_inppkt_NFLOG.c
index 1e5e644..a84f632 100644
--- a/input/packet/ulogd_inppkt_NFLOG.c
+++ b/input/packet/ulogd_inppkt_NFLOG.c
@@ -194,8 +194,10 @@ nflog_handle_msg(struct nl_object *obj, void *arg)
key_set_u32(&out[K_OOB_TIME_USEC], tv->tv_usec);
}
- key_set_u32(&out[K_OOB_IFI_IN], nfnl_log_get_indev(nflog_obj));
- key_set_u32(&out[K_OOB_IFI_OUT], nfnl_log_get_outdev(nflog_obj));
+ if (nfnl_log_get_indev(nflog_obj))
+ key_set_u32(&out[K_OOB_IFI_IN], nfnl_log_get_indev(nflog_obj));
+ if (nfnl_log_get_outdev(nflog_obj))
+ key_set_u32(&out[K_OOB_IFI_OUT], nfnl_log_get_outdev(nflog_obj));
if (nfnl_log_test_seq(nflog_obj))
key_set_u32(&out[K_OOB_SEQ], nfnl_log_get_seq(nflog_obj));