Skip to contentSkip to conversation

Ulogd2: fix db OUTPUT system

PATCH Eric Leblond 2 participants 2 messages Jan 11, 2008 – Jan 12, 2008 netfilter

lore
Share & tools
lore
#0 lore raw

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.

---
 util/db.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
util/db.c +4 -1
index 13401ae..65d0f39 100644
@@ -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
#1 lore raw
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.