summaryrefslogtreecommitdiffstats
path: root/src/libipulog_compat.c
diff options
context:
space:
mode:
author/C=DE/ST=Berlin/L=Berlin/O=Netfilter Project/OU=Development/CN=laforge/emailAddress=laforge@netfilter.org </C=DE/ST=Berlin/L=Berlin/O=Netfilter Project/OU=Development/CN=laforge/emailAddress=laforge@netfilter.org>2005-07-30 20:46:43 +0000
committer/C=DE/ST=Berlin/L=Berlin/O=Netfilter Project/OU=Development/CN=laforge/emailAddress=laforge@netfilter.org </C=DE/ST=Berlin/L=Berlin/O=Netfilter Project/OU=Development/CN=laforge/emailAddress=laforge@netfilter.org>2005-07-30 20:46:43 +0000
commitad6426bc6da725dc3a1059a96787300e3fd69c61 (patch)
tree2d712f0f8a0bf1657b0cdb7c0a7b7717307f2d69 /src/libipulog_compat.c
parentf9d3f04f9a968113e5f00276951714a1037c7307 (diff)
new directory structure, make sure include files are installed properly
Diffstat (limited to 'src/libipulog_compat.c')
-rw-r--r--src/libipulog_compat.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/libipulog_compat.c b/src/libipulog_compat.c
index b59d55a..b6fc82e 100644
--- a/src/libipulog_compat.c
+++ b/src/libipulog_compat.c
@@ -6,7 +6,7 @@
#include <sys/socket.h>
#include <netinet/in.h>
#include <libnfnetlink_log/libnfnetlink_log.h>
-#include <libipulog/libipulog.h>
+#include <libnfnetlink_log/libipulog.h>
/* private */
#define PAYLOAD_SIZE 0xffff
@@ -128,8 +128,10 @@ ulog_packet_msg_t *ipulog_get_packet(struct ipulog_handle *h,
if (!h->last_nlh)
nlh = nfnl_get_msg_first(&h->nfulh.nfnlh, buf, len);
- else
+ else {
+next_msg:
nlh = nfnl_get_msg_next(&h->nfulh.nfnlh, buf, len);
+ }
h->last_nlh = nlh;
if (!nlh)
@@ -137,12 +139,13 @@ ulog_packet_msg_t *ipulog_get_packet(struct ipulog_handle *h,
nfnl_parse_attr(tb, NFULA_MAX, NFM_NFA(nlh), NFM_PAYLOAD(nlh));
- if (!tb[NFULA_PACKET_HDR-1]) {
- /* ERROR */
- }
- hdr = NFA_DATA(tb[NFULA_PACKET_HDR-1]);
+ if (!tb[NFULA_PACKET_HDR-1])
+ goto next_msg;
+ /* now build the fake ulog_packet_msg */
+ hdr = NFA_DATA(tb[NFULA_PACKET_HDR-1]);
h->upmsg.hook = hdr->hook;
+
if (tb[NFULA_MARK-1])
h->upmsg.mark = ntohl(*(u_int32_t *)NFA_DATA(tb[NFULA_MARK-1]));
else