summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2001-03-25 19:03:23 +0000
committerHarald Welte <laforge@gnumonks.org>2001-03-25 19:03:23 +0000
commit18f1aff721e19486d87342abb594831b08b1083e (patch)
tree5bac984301160ec0a1f5a1eb9027afe0b0c10fb0
parentfeb41546d26a92a5df6d36bfad38af9d8407d6bf (diff)
updated SAME match
-rwxr-xr-xextensions/.SAME-test2
-rw-r--r--extensions/libipt_SAME.c13
2 files changed, 7 insertions, 8 deletions
diff --git a/extensions/.SAME-test b/extensions/.SAME-test
deleted file mode 100755
index 26f58dd0..00000000
--- a/extensions/.SAME-test
+++ /dev/null
@@ -1,2 +0,0 @@
-#! /bin/sh
-[ -f $KERNEL_DIR/net/ipv4/netfilter/ipt_SAME.c ] && echo SAME
diff --git a/extensions/libipt_SAME.c b/extensions/libipt_SAME.c
index 1d1e2361..68f745c8 100644
--- a/extensions/libipt_SAME.c
+++ b/extensions/libipt_SAME.c
@@ -1,3 +1,4 @@
+/* Shared library add-on to iptables to add simple non load-balancing SNAT support. */
#include <stdio.h>
#include <netdb.h>
#include <string.h>
@@ -15,13 +16,13 @@ help(void)
{
printf(
"SAME v%s options:\n"
-" --to-source <ipaddr>-<ipaddr>\n"
+" --to <ipaddr>-<ipaddr>\n"
" Addresses to map source to.\n",
NETFILTER_VERSION);
}
static struct option opts[] = {
- { "to-source", 1, 0, '1' },
+ { "to", 1, 0, '1' },
{ 0 }
};
@@ -78,7 +79,7 @@ parse(int c, char **argv, int invert, unsigned int *flags,
case '1':
if (check_inverse(optarg, &invert))
exit_error(PARAMETER_PROBLEM,
- "Unexpected `!' after --to-source");
+ "Unexpected `!' after --to");
parse_to(optarg, &mr->range[0]);
*flags = 1;
@@ -89,12 +90,12 @@ parse(int c, char **argv, int invert, unsigned int *flags,
}
}
-/* Final check; need --to-dest. */
+/* Final check; need --to. */
static void final_check(unsigned int flags)
{
if (!flags)
exit_error(PARAMETER_PROBLEM,
- "BALANCE needs --to-source");
+ "SAME needs --to");
}
/* Prints out the targinfo. */
@@ -125,7 +126,7 @@ save(const struct ipt_ip *ip, const struct ipt_entry_target *target)
struct in_addr a;
a.s_addr = r->min_ip;
- printf("--to-source %s", addr_to_dotted(&a));
+ printf("--to %s", addr_to_dotted(&a));
a.s_addr = r->max_ip;
printf("-%s ", addr_to_dotted(&a));
}