]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
loglevel patch was missing one line (strange...)
authorHarald Welte <laforge@gnumonks.org>
Mon, 22 Oct 2001 08:16:24 +0000 (08:16 +0000)
committerHarald Welte <laforge@gnumonks.org>
Mon, 22 Oct 2001 08:16:24 +0000 (08:16 +0000)
extensions/libipt_LOG.c

index c7673d91ea43ec7a173d68bbe59f470fb55abaad..68a9f652a4d054daa47b9b81b9fcd7493e96dc95 100644 (file)
@@ -67,6 +67,7 @@ static u_int8_t
 parse_level(const char *level)
 {
        unsigned int lev = -1;
+       unsigned int set = 0;
 
        if (string_to_number(level, 0, 7, &lev) == -1) {
                unsigned int i = 0;
@@ -76,7 +77,7 @@ parse_level(const char *level)
                     i++) {
                        if (strncasecmp(level, ipt_log_names[i].name,
                                        strlen(level)) == 0) {
-                               if (lev != -1)
+                               if (set++)
                                        exit_error(PARAMETER_PROBLEM,
                                                   "log-level `%s' ambiguous",
                                                   level);
@@ -84,7 +85,7 @@ parse_level(const char *level)
                        }
                }
 
-               if (lev == -1)
+               if (!set)
                        exit_error(PARAMETER_PROBLEM,
                                   "log-level `%s' unknown", level);
        }