From patchwork Wed Aug 1 21:27:15 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Leblond X-Patchwork-Id: 174606 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id ED8512C009B for ; Thu, 2 Aug 2012 07:28:38 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755468Ab2HAV2h (ORCPT ); Wed, 1 Aug 2012 17:28:37 -0400 Received: from ks28632.kimsufi.com ([91.121.96.152]:49519 "EHLO ks28632.kimsufi.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755516Ab2HAV2f (ORCPT ); Wed, 1 Aug 2012 17:28:35 -0400 Received: from ip-92-50-100-48.unitymediagroup.de ([92.50.100.48] helo=tiger.regit.org) by ks28632.kimsufi.com with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from ) id 1SwgT4-0005bd-UZ; Wed, 01 Aug 2012 23:28:35 +0200 From: Eric Leblond To: netfilter-devel@vger.kernel.org Cc: Eric Leblond Subject: [PATCH 4/5] pgsql: only disable key if it starts with underscore Date: Wed, 1 Aug 2012 23:27:15 +0200 Message-Id: <1343856436-11129-5-git-send-email-eric@regit.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1343856436-11129-1-git-send-email-eric@regit.org> References: <1343856436-11129-1-git-send-email-eric@regit.org> Sender: netfilter-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.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;