X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=extensions%2Flibipt_REDIRECT.c;h=e29bf2ff7b6fc205252410b78e50852d3c7113c5;hb=782ed68bce7c9b3cc29eb4351ec13ede40a7ee49;hp=052b533c4e5c43b19cfe85a30683017297ab0ba9;hpb=f7b70cf9e00324b89b02de213bcd0dde7044d035;p=iptables.git diff --git a/extensions/libipt_REDIRECT.c b/extensions/libipt_REDIRECT.c index 052b533..e29bf2f 100644 --- a/extensions/libipt_REDIRECT.c +++ b/extensions/libipt_REDIRECT.c @@ -33,8 +33,6 @@ init(struct ipt_entry_target *t, unsigned int *nfcache) /* Actually, it's 0, but it's ignored at the moment. */ mr->rangesize = 1; - /* Can't cache this */ - *nfcache |= NFC_UNKNOWN; } /* Parses ports */ @@ -83,7 +81,8 @@ parse(int c, char **argv, int invert, unsigned int *flags, int portok; if (entry->ip.proto == IPPROTO_TCP - || entry->ip.proto == IPPROTO_UDP) + || entry->ip.proto == IPPROTO_UDP + || entry->ip.proto == IPPROTO_ICMP) portok = 1; else portok = 0; @@ -147,20 +146,19 @@ save(const struct ipt_ip *ip, const struct ipt_entry_target *target) } } -static -struct iptables_target redir -= { NULL, - "REDIRECT", - IPTABLES_VERSION, - IPT_ALIGN(sizeof(struct ip_nat_multi_range)), - IPT_ALIGN(sizeof(struct ip_nat_multi_range)), - &help, - &init, - &parse, - &final_check, - &print, - &save, - opts +static struct iptables_target redir = { + .next = NULL, + .name = "REDIRECT", + .version = IPTABLES_VERSION, + .size = IPT_ALIGN(sizeof(struct ip_nat_multi_range)), + .userspacesize = IPT_ALIGN(sizeof(struct ip_nat_multi_range)), + .help = &help, + .init = &init, + .parse = &parse, + .final_check = &final_check, + .print = &print, + .save = &save, + .extra_opts = opts }; void _init(void)