Ulogd2: fix db OUTPUT system
Hi,
The following patch fixes MySQL and Pgsql output modules.
The callback function was not correctly initialized and this was leading to a crash by calling the a NULL function. This patch correctly inits the callback.
BR,
Signature · 2 lines
Eric Leblond <[email protected]> INL
From c1e08c8445c80124ca362866f57949ee398df8cc Mon Sep 17 00:00:00 2001
From: Eric leblond <[email protected]>
Date: Fri, 11 Jan 2008 23:05:32 +0100
Subject: [PATCH] Set callback in db module to avoid calling NULL function.
Signed-off-by Eric leblond <[email protected]>
--- util/db.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)
util/db.c +4 -1
@@ -114,6 +114,8 @@ static int sql_createstmt(struct ulogd_pluginstance *upi)return 0 ; } +static int _init_db (struct ulogd_pluginstance *upi); +int ulogd_db_configure (struct ulogd_pluginstance *upi,struct ulogd_pluginstance_stack *stack) {
@@ -164,6 +166,8 @@ int ulogd_db_start(struct ulogd_pluginstance *upi)if (ret <0 ) di->driver->close_db (upi); + di->interp = &_init_db; +return ret; }
@@ -181,7 +185,6 @@ int ulogd_db_stop(struct ulogd_pluginstance *upi)return 0 ; } -static int _init_db (struct ulogd_pluginstance *upi);static int _init_reconnect (struct ulogd_pluginstance *upi) {
Signature · 1 line
1.5.2.5
Quoted 7 lines · Eric Leblond
Hi,
The following patch fixes MySQL and Pgsql output modules.
The callback function was not correctly initialized and this was leading to a crash by calling the a NULL function. This patch correctly inits the callback.
Also applied, thanks.