]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
the following two patches move the call to check_inverse() to a saner
authorStephane Ouellette <ouellettes@videotron.ca>
Sun, 27 Apr 2003 13:07:18 +0000 (13:07 +0000)
committerHarald Welte <laforge@gnumonks.org>
Sun, 27 Apr 2003 13:07:18 +0000 (13:07 +0000)
place and surround the condition name by double-quotes in save(). (Stephane Ouellette)

extensions/libip6t_condition.c
extensions/libipt_condition.c

index 783b4662f6e5e7abdb7b32b8b6d8886b6a73d976..f58b3bc3629594410e610b45f85e92333c4ae818 100644 (file)
@@ -1,3 +1,4 @@
+/* Shared library add-on to ip6tables for condition match */
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -39,13 +40,13 @@ parse(int c, char **argv, int invert, unsigned int *flags,
        struct condition6_info *info =
            (struct condition6_info *) (*match)->data;
 
-       check_inverse(optarg, &invert, &optind, 0);
-
        if (c == 'X') {
                if (*flags)
                        exit_error(PARAMETER_PROBLEM,
                                   "Can't specify multiple conditions");
 
+               check_inverse(optarg, &invert, &optind, 0);
+
                if (strlen(argv[optind - 1]) < CONDITION6_NAME_LEN)
                        strcpy(info->name, argv[optind - 1]);
                else
@@ -88,7 +89,7 @@ save(const struct ip6t_ip6 *ip,
        const struct condition6_info *info =
            (const struct condition6_info *) match->data;
 
-       printf("--condition %s%s ", (info->invert) ? "! " : "", info->name);
+       printf("--condition %s\"%s\" ", (info->invert) ? "! " : "", info->name);
 }
 
 
index f15c94ca3f56feebabfd83db04eff14207df921f..750111b49bb507d8aa28749c29db619bf46e77d4 100644 (file)
@@ -1,3 +1,4 @@
+/* Shared library add-on to iptables for condition match */
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -39,13 +40,13 @@ parse(int c, char **argv, int invert, unsigned int *flags,
        struct condition_info *info =
            (struct condition_info *) (*match)->data;
 
-       check_inverse(optarg, &invert, &optind, 0);
-
        if (c == 'X') {
                if (*flags)
                        exit_error(PARAMETER_PROBLEM,
                                   "Can't specify multiple conditions");
 
+               check_inverse(optarg, &invert, &optind, 0);
+
                if (strlen(argv[optind - 1]) < CONDITION_NAME_LEN)
                        strcpy(info->name, argv[optind - 1]);
                else
@@ -88,7 +89,7 @@ save(const struct ipt_ip *ip,
        const struct condition_info *info =
            (const struct condition_info *) match->data;
 
-       printf("--condition %s%s ", (info->invert) ? "! " : "", info->name);
+       printf("--condition %s\"%s\" ", (info->invert) ? "! " : "", info->name);
 }