From: Eric Leblond <eric@regit.org>
To: netfilter-devel@vger.kernel.org
Cc: Eric Leblond <eric@regit.org>
Subject: [PATCH 4/5] pgsql: only disable key if it starts with underscore
Date: Wed, 1 Aug 2012 23:27:15 +0200 [thread overview]
Message-ID: <1343856436-11129-5-git-send-email-eric@regit.org> (raw)
In-Reply-To: <1343856436-11129-1-git-send-email-eric@regit.org>
ulogd2 was magically making inactive the first key of description
table. This patch improves this system by only doing so when
the key start with an undescore. This way, system like nfacct which
do not have a primary key can be implemented easily.
---
output/pgsql/ulogd_output_PGSQL.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/output/pgsql/ulogd_output_PGSQL.c b/output/pgsql/ulogd_output_PGSQL.c
index 9529b1c..44600b0 100644
--- a/output/pgsql/ulogd_output_PGSQL.c
+++ b/output/pgsql/ulogd_output_PGSQL.c
@@ -195,8 +195,10 @@ static int get_columns_pgsql(struct ulogd_pluginstance *upi)
strncpy(upi->input.keys[i].name, buf, ULOGD_MAX_KEYLEN);
}
- /* ID is a sequence */
- upi->input.keys[0].flags |= ULOGD_KEYF_INACTIVE;
+ /* ID (starting by '.') is a sequence */
+ if (upi->input.keys[0].name[0] == '.') {
+ upi->input.keys[0].flags |= ULOGD_KEYF_INACTIVE;
+ }
PQclear(pi->pgres);
return 0;
--
1.7.10.4
next prev parent reply other threads:[~2012-08-01 21:28 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-01 21:27 [ulogd patch 0/5] nfacct and pgsql update Eric Leblond
2012-08-01 21:27 ` [PATCH 1/5] nfacct: add variable to not zero counter after read Eric Leblond
2012-08-03 9:24 ` Pablo Neira Ayuso
2012-08-01 21:27 ` [PATCH 2/5] pgsql schema: add nfacct table Eric Leblond
2012-08-03 9:29 ` Pablo Neira Ayuso
2012-08-01 21:27 ` [PATCH 3/5] pgsql schema: fix timestamp default value Eric Leblond
2012-08-03 9:29 ` Pablo Neira Ayuso
2012-08-01 21:27 ` Eric Leblond [this message]
2012-08-03 9:29 ` [PATCH 4/5] pgsql: only disable key if it starts with underscore Pablo Neira Ayuso
2012-08-01 21:27 ` [PATCH 5/5] nfacct: add timestamp option Eric Leblond
2012-08-03 9:35 ` Pablo Neira Ayuso
2012-08-03 9:43 ` Eric Leblond
2012-08-03 11:24 ` Pablo Neira Ayuso
2012-08-03 14:54 ` Pablo Neira Ayuso
2012-09-01 12:49 ` Mr Dash Four
2012-09-02 20:03 ` Mr Dash Four
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1343856436-11129-5-git-send-email-eric@regit.org \
--to=eric@regit.org \
--cc=netfilter-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).