From d68f1f0afc23cde92a4940e9f6aec26dedc1c4b3 Mon Sep 17 00:00:00 2001 From: "/C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org" Date: Tue, 25 Mar 2008 10:06:15 +0000 Subject: A specific instance of NFLOG can now be use in multiple stacks. This is done by duplicating the interpretation of the message. Signed-off-by: Eric Leblond --- input/packet/ulogd_inppkt_ULOG.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'input/packet') diff --git a/input/packet/ulogd_inppkt_ULOG.c b/input/packet/ulogd_inppkt_ULOG.c index cf44474..5df6499 100644 --- a/input/packet/ulogd_inppkt_ULOG.c +++ b/input/packet/ulogd_inppkt_ULOG.c @@ -215,6 +215,7 @@ static int interp_packet(struct ulogd_pluginstance *ip, ulog_packet_msg_t *pkt) static int ulog_read_cb(int fd, unsigned int what, void *param) { struct ulogd_pluginstance *upi = (struct ulogd_pluginstance *)param; + struct ulogd_pluginstance *npi = NULL; struct ulog_input *u = (struct ulog_input *) &upi->private; ulog_packet_msg_t *upkt; int len; @@ -239,6 +240,11 @@ static int ulog_read_cb(int fd, unsigned int what, void *param) while ((upkt = ipulog_get_packet(u->libulog_h, u->libulog_buf, len))) { ulogd_log(ULOGD_DEBUG, "==> ulog packet received\n"); + /* since we support the re-use of one instance in + * several different stacks, we duplicate the message + * to let them know */ + llist_for_each_entry(npi, &upi->plist, plist) + interp_packet(npi, upkt); interp_packet(upi, upkt); } } -- cgit v1.2.3