summaryrefslogtreecommitdiffstats
path: root/ulogd/libipulog
diff options
context:
space:
mode:
authorlaforge <laforge>2001-02-03 18:38:31 +0000
committerlaforge <laforge>2001-02-03 18:38:31 +0000
commit2a28e665330470af426afc43e89368be7b3706b8 (patch)
tree58d03f8a2db9fb251b69e42617cb6c56aee77598 /ulogd/libipulog
parent3327b65b157dfe72165b5b5dc1e8fca674c67943 (diff)
fixes _severe_ libipulog bug
Diffstat (limited to 'ulogd/libipulog')
-rw-r--r--ulogd/libipulog/libipulog.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/ulogd/libipulog/libipulog.c b/ulogd/libipulog/libipulog.c
index 4aa12e5..0d4b9fb 100644
--- a/ulogd/libipulog/libipulog.c
+++ b/ulogd/libipulog/libipulog.c
@@ -1,5 +1,5 @@
/*
- * libipulog.c, $Revision: 1.5 $
+ * libipulog.c, $Revision: 1.6 $
*
* netfilter ULOG userspace library.
*
@@ -9,7 +9,7 @@
* This library is still under development, so be aware of sudden interface
* changes
*
- * $Id: libipulog.c,v 1.5 2000/09/22 06:57:16 laforge Exp $
+ * $Id: libipulog.c,v 1.6 2001/01/30 09:28:04 laforge Exp $
*/
#include <stdlib.h>
@@ -213,8 +213,10 @@ ulog_packet_msg_t *ipulog_get_packet(struct ipulog_handle *h,
}
} else {
/* we are in n-th part of multilink message */
- if (h->last_nlhdr->nlmsg_type == NLMSG_DONE) {
- /* if last part in multilink message, return */
+ if (h->last_nlhdr->nlmsg_type == NLMSG_DONE ||
+ !(h->last_nlhdr->nlmsg_flags & NLM_F_MULTI)) {
+ /* if last part in multilink message,
+ * or no multipart message at all: return */
h->last_nlhdr = NULL;
return NULL;
}
@@ -225,10 +227,7 @@ ulog_packet_msg_t *ipulog_get_packet(struct ipulog_handle *h,
nlh = NLMSG_NEXT(h->last_nlhdr, remain_len);
}
- /* update last_nlhdr field */
- if (nlh->nlmsg_flags & NLM_F_MULTI) {
- h->last_nlhdr = nlh;
- }
+ h->last_nlhdr = nlh;
return NLMSG_DATA(nlh);
}