summaryrefslogtreecommitdiffstats
path: root/extensions
diff options
context:
space:
mode:
authorlaforge <laforge>2003-04-27 13:07:18 +0000
committerlaforge <laforge>2003-04-27 13:07:18 +0000
commitee49a81bae86be8b59ba3ac1b3df0a7fb458b9ec (patch)
tree43f2f30ee131e460827989f567fa8cb41b65b39d /extensions
parentc5fbe750e1a9825a7dfec3f0a2d552f13f54a5e4 (diff)
the following two patches move the call to check_inverse() to a saner
place and surround the condition name by double-quotes in save(). (Stephane Ouellette)
Diffstat (limited to 'extensions')
-rw-r--r--extensions/libip6t_condition.c7
-rw-r--r--extensions/libipt_condition.c7
2 files changed, 8 insertions, 6 deletions
diff --git a/extensions/libip6t_condition.c b/extensions/libip6t_condition.c
index 783b466..f58b3bc 100644
--- a/extensions/libip6t_condition.c
+++ b/extensions/libip6t_condition.c
@@ -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);
}
diff --git a/extensions/libipt_condition.c b/extensions/libipt_condition.c
index f15c94c..750111b 100644
--- a/extensions/libipt_condition.c
+++ b/extensions/libipt_condition.c
@@ -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);
}