summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Knorr <kraxel@bytesex.org>2001-04-12 15:40:05 +0000
committerHarald Welte <laforge@gnumonks.org>2001-04-12 15:40:05 +0000
commit94a7c27009a1f045484e9fb9ccfff37a8f034c10 (patch)
treeb394670b16e6d941a09cb3ada62721200524f5a2
parent81adae9a58248bf0b027708cf9c5b0b7b2b956d7 (diff)
Gerd Knorr's fixes to iplimit match
-rw-r--r--extensions/libipt_connlimit.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/extensions/libipt_connlimit.c b/extensions/libipt_connlimit.c
index 1600dea0..19928ac2 100644
--- a/extensions/libipt_connlimit.c
+++ b/extensions/libipt_connlimit.c
@@ -3,6 +3,7 @@
#include <netdb.h>
#include <string.h>
#include <stdlib.h>
+#include <stddef.h>
#include <getopt.h>
#include <iptables.h>
#include <linux/netfilter_ipv4/ip_conntrack.h>
@@ -99,7 +100,7 @@ print(const struct ipt_ip *ip,
{
struct ipt_iplimit_info *info = (struct ipt_iplimit_info*)match->data;
- printf("#conn/%d %s %d", count_bits(info->mask),
+ printf("#conn/%d %s %d ", count_bits(info->mask),
info->inverse ? "<" : ">", info->limit);
}
@@ -108,23 +109,22 @@ static void save(const struct ipt_ip *ip, const struct ipt_entry_match *match)
{
struct ipt_iplimit_info *info = (struct ipt_iplimit_info*)match->data;
- printf("%s--iplimit-above %d",info->inverse ? "! " : "",info->limit);
- printf(" --iplimit-mask %d",count_bits(info->mask));
+ printf("%s--iplimit-above %d ",info->inverse ? "! " : "",info->limit);
+ printf("--iplimit-mask %d ",count_bits(info->mask));
}
-struct iptables_match iplimit
-= { NULL,
- "iplimit",
- NETFILTER_VERSION,
- IPT_ALIGN(sizeof(struct ipt_iplimit_info)),
- IPT_ALIGN(sizeof(struct ipt_iplimit_info)),
- &help,
- &init,
- &parse,
- &final_check,
- &print,
- &save,
- opts
+static struct iptables_match iplimit = {
+ name: "iplimit",
+ version: NETFILTER_VERSION,
+ size: IPT_ALIGN(sizeof(struct ipt_iplimit_info)),
+ userspacesize: offsetof(struct ipt_iplimit_info,data),
+ help: help,
+ init: init,
+ parse: parse,
+ final_check: final_check,
+ print: print,
+ save: save,
+ extra_opts: opts
};
void _init(void)