]> git.ipfire.org Git - thirdparty/ulogd2.git/commitdiff
cleanup: fix gcc warnings
authorEric Leblond <eric@inl.fr>
Tue, 29 Jul 2008 10:24:18 +0000 (12:24 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Tue, 29 Jul 2008 10:24:18 +0000 (12:24 +0200)
This patch fixes some gcc warnings:
 * Unused variables
 * Functions with wrong return (or without return)

Signed-off-by: Eric Leblond <eric@inl.fr>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
filter/raw2packet/ulogd_raw2packet_BASE.c
filter/ulogd_filter_IFINDEX.c
filter/ulogd_filter_IP2BIN.c
filter/ulogd_filter_PWSNIFF.c
output/mysql/ulogd_output_MYSQL.c
output/pgsql/ulogd_output_PGSQL.c
src/ulogd.c
util/db.c
util/printpkt.c

index dde1cf3a70164a2cf777b01413532216324cad2d..7c6fd26c464195666da54f363f48c336a04ddfad 100644 (file)
@@ -920,9 +920,6 @@ static int _interp_arp(struct ulogd_pluginstance *pi, u_int32_t len)
 
 static int _interp_bridge(struct ulogd_pluginstance *pi, u_int32_t len)
 {
-       struct ulogd_key *ret = pi->output.keys;
-       const struct sk_buff *skb =
-               GET_VALUE(pi->input.keys, INKEY_RAW_PCKT).ptr;
        const u_int16_t proto =
                GET_VALUE(pi->input.keys, INKEY_OOB_PROTOCOL).ui16;
 
index 64911279fcf3d83e80b1ee2310bc12fa1e0e7f5e..f7571bd899a200e249c26c7137c56c0d84b080ff 100644 (file)
@@ -84,7 +84,7 @@ static int nlif_read_cb(int fd, unsigned int what, void *param)
        if (!(what & ULOGD_FD_READ))
                return 0;
 
-       nlif_catch(nlif_inst);
+       return nlif_catch(nlif_inst);
 }
 
 static int ifindex_start(struct ulogd_pluginstance *upi)
index c4b44fa80967cef4e02ff206d2bfb85eb19dbffa..2d9fc16022e3fd008fa4b5dec2cfa5f7ab8fe6d7 100644 (file)
@@ -147,7 +147,7 @@ static char *ip2bin(struct ulogd_key* inp, int index, char family)
                default:
                        /* TODO handle error */
                        ulogd_log(ULOGD_NOTICE, "Unknown protocol family\n");
-                       return;
+                       return NULL;
        }
 
        buffer = tmp;
@@ -161,7 +161,7 @@ static char *ip2bin(struct ulogd_key* inp, int index, char family)
                                addr8[0], addr8[1], addr8[2], addr8[3]);
                if (written != 2 * 4) {
                        buffer[0] = 0;
-                       return;
+                       return NULL;
                }
                buffer += written;
                addr8 += 4;
index 95d92b5ab3c4b988262f25cd4426a6fcbab92496..290e4cb615f0f1b17d3fa3d9dc6edb222d72821a 100644 (file)
@@ -60,7 +60,6 @@ static unsigned char *_get_next_blank(unsigned char* begp, unsigned char *endp)
 
 static int interp_pwsniff(struct ulogd_pluginstance *pi)
 {
-       struct ulogd_key *inp = pi->input.keys;
        struct ulogd_key *ret = pi->output.keys;
        struct iphdr *iph;
        void *protoh;
index fd650bf8436d4beab7bb9d0f2b5441983881a59d..562424bb7d3c6950945adc5516d4cfa631ed1f72 100644 (file)
@@ -102,7 +102,6 @@ static int get_columns_mysql(struct ulogd_pluginstance *upi)
        struct mysql_instance *mi = (struct mysql_instance *) upi->private;
        MYSQL_RES *result;
        MYSQL_FIELD *field;
-       struct ulogd_key *f, *f2;
        int i;
 
        if (!mi->dbh) {
@@ -144,7 +143,6 @@ static int get_columns_mysql(struct ulogd_pluginstance *upi)
        for (i = 0; field = mysql_fetch_field(result); i++) {
                char buf[ULOGD_MAX_KEYLEN+1];
                char *underscore;
-               int id;
 
                /* replace all underscores with dots */
                strncpy(buf, field->name, ULOGD_MAX_KEYLEN);
index 7ece62646111b421b467a3f1cfc612a5267d4c31..b04526a99d7fa3fa56878ae157ef8d618908ecf6 100644 (file)
@@ -183,7 +183,6 @@ static int get_columns_pgsql(struct ulogd_pluginstance *upi)
        for (i = 0; i < PQntuples(pi->pgres); i++) {
                char buf[ULOGD_MAX_KEYLEN+1];
                char *underscore;
-               int id;
 
                /* replace all underscores with dots */
                strncpy(buf, PQgetvalue(pi->pgres, i, 0), ULOGD_MAX_KEYLEN);
index 4e369844b3ce84e024f1fa57b9424d75546e7e76..33d58ee94be1e1f8d30b629982f427a2886b9b1a 100644 (file)
@@ -204,7 +204,6 @@ int ulogd_wildcard_inputkeys(struct ulogd_pluginstance *upi)
 
        /* second pass: copy key names */
        llist_for_each_entry(pi_cur, &stack->list, list) {
-               struct ulogd_key *cur;
                int i;
 
                for (i = 0; i < pi_cur->plugin->output.num_keys; i++)
@@ -1022,7 +1021,7 @@ static struct option opts[] = {
        { "help", 0, NULL, 'h' },
        { "configfile", 1, NULL, 'c'},
        { "uid", 1, NULL, 'u' },
-       { "info", 1, NULL, 'i'},
+       { "info", 1, NULL, 'i' },
        { 0 }
 };
 
index 946458abb6fb8b340742bfd3179da4cfbc713040..9b4da8d28243cfb5b7ba9ea697cb3aff478978c2 100644 (file)
--- a/util/db.c
+++ b/util/db.c
@@ -31,6 +31,7 @@
 #include <errno.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
+#include <time.h>
 
 #include <ulogd/ulogd.h>
 #include <ulogd/db.h>
@@ -62,8 +63,6 @@ static int sql_createstmt(struct ulogd_pluginstance *upi)
 {
        struct db_instance *mi = (struct db_instance *) upi->private;
        unsigned int size;
-       char buf[ULOGD_MAX_KEYLEN];
-       char *underscore;
        int i;
        char *table = table_ce(upi->config_kset).u.string;
        char *procedure = procedure_ce(upi->config_kset).u.string;
@@ -245,8 +244,6 @@ static int __interp_db(struct ulogd_pluginstance *upi)
                }
                
                switch (res->type) {
-                       char *tmpstr;
-                       struct in_addr addr;
                case ULOGD_RET_INT8:
                        sprintf(di->stmt_ins, "%d,", res->u.value.i8);
                        break;
index 90fec0ed75c20b0bf9897543f96fc161b509a9eb..c64a4cb12ad3e6a5eeeac5a640e5b1456b64835d 100644 (file)
@@ -276,7 +276,6 @@ static int printpkt_ipv4(struct ulogd_key *res, char *buf)
 static int printpkt_ipv6(struct ulogd_key *res, char *buf)
 {
        char *buf_cur = buf;
-       char tmp[INET6_ADDRSTRLEN];
 
        if (pp_is_valid(res, KEY_IP_SADDR))
                buf_cur += sprintf(buf_cur, "SRC=%s ",
@@ -353,7 +352,6 @@ int printpkt_arp(struct ulogd_key *res, char *buf)
        char *buf_cur = buf;
        u_int16_t code = 0;
        u_int8_t *mac;
-       char tmp[INET_ADDRSTRLEN];
 
        if (pp_is_valid(res, KEY_ARP_SPA))
                buf_cur += sprintf(buf_cur, "SRC=%s ",