summaryrefslogtreecommitdiffstats
path: root/ulogd/sqlite3
diff options
context:
space:
mode:
authorlaforge <laforge>2005-02-16 10:05:31 +0000
committerlaforge <laforge>2005-02-16 10:05:31 +0000
commit98eb3dd982420b64cc35010c4134caeeeb726081 (patch)
tree9bb84ded82c7b468617da90abf6e258cef3d97c2 /ulogd/sqlite3
parentd66a1983b792780b68c2c3b44ac8cd7de06ce66d (diff)
fix log-ip-as-string on x86_64 (Javi Averbach)
Diffstat (limited to 'ulogd/sqlite3')
-rw-r--r--ulogd/sqlite3/ulogd_SQLITE3.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/ulogd/sqlite3/ulogd_SQLITE3.c b/ulogd/sqlite3/ulogd_SQLITE3.c
index cc45f9a..284da3c 100644
--- a/ulogd/sqlite3/ulogd_SQLITE3.c
+++ b/ulogd/sqlite3/ulogd_SQLITE3.c
@@ -29,6 +29,7 @@
#include <stdlib.h>
#include <string.h>
+#include <arpa/inet.h>
#include <ulogd/ulogd.h>
#include <ulogd/conffile.h>
#include <sqlite3.h>
@@ -92,6 +93,7 @@ static int _sqlite3_output(ulog_iret_t *result)
int col_counter;
#ifdef IP_AS_STRING
char *ipaddr;
+ struct in_addr *addr;
#endif
col_counter = 0;
@@ -130,7 +132,9 @@ static int _sqlite3_output(ulog_iret_t *result)
break;
case ULOGD_RET_IPADDR:
#ifdef IP_AS_STRING
- ipaddr = inet_ntoa(ntohl(res->value.ui32));
+ memset(&addr, 0, sizeof(addr));
+ addr.s_addr = ntohl(res->value.ui32);
+ ipaddr = inet_ntoa(addr);
sqlite3_bind_text(p_stmt,col_counter,ipaddr,strlen(ipaddr),SQLITE_STATIC);
break;
#endif /* IP_AS_STRING */