summaryrefslogtreecommitdiffstats
path: root/_log/src/libnfnetlink_log.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 16:49:57 +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 16:49:57 +0000
commit2ae5bdfb8261e491d2778f3455e2f827306acd14 (patch)
treefafbcbda013ca6bb061df901cfed558686e106b2 /_log/src/libnfnetlink_log.c
parentaf617f69903e4a70fb081f20277fa1943cb740be (diff)
initial (incomplete) backwards compatibility libipulug api
Diffstat (limited to '_log/src/libnfnetlink_log.c')
-rw-r--r--_log/src/libnfnetlink_log.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/_log/src/libnfnetlink_log.c b/_log/src/libnfnetlink_log.c
index 5bf2264..d0bd124 100644
--- a/_log/src/libnfnetlink_log.c
+++ b/_log/src/libnfnetlink_log.c
@@ -28,7 +28,7 @@
#include <linux/netlink.h>
#include <linux/netfilter/nfnetlink.h>
#include <linux/netfilter/nfnetlink_log.h>
-#include "libnfnetlink_log.h"
+#include <libnfnetlink_log/libnfnetlink_log.h>
#define HEADER_LEN (NLMSG_LENGTH(sizeof(struct nlmsghdr)) \
+NLMSG_LENGTH(sizeof(struct nfgenmsg)))
@@ -154,12 +154,17 @@ int nfulnl_set_nlbufsiz(struct nfulnl_g_handle *gh, u_int32_t nlbufsiz)
{
char buf[HEADER_LEN+NFA_LENGTH(sizeof(u_int32_t))];
struct nlmsghdr *nmh = (struct nlmsghdr *) buf;
+ int status;
nfnl_fill_hdr(&gh->h->nfnlh, nmh, 0, AF_UNSPEC, gh->id,
NFULNL_MSG_CONFIG, NLM_F_REQUEST|NLM_F_ACK);
nfnl_addattr32(nmh, sizeof(buf), NFULA_CFG_NLBUFSIZ, htonl(nlbufsiz));
- return nfnl_send(&gh->h->nfnlh, nmh);
+ status = nfnl_send(&gh->h->nfnlh, nmh);
+
+ /* we try to have space for at least 10 messages in the socket buffer */
+ if (status >= 0)
+ nfnl_rcvbufsiz(&gh->h->nfnlh, 10*nlbufsiz);
}