From 5a942f9501f7ce287e1c37c553eb02a1e269e081 Mon Sep 17 00:00:00 2001 From: Patrick McHardy Date: Tue, 4 Nov 2008 13:22:40 +0100 Subject: Add SCTP/DCCP support to NAT targets Signed-off-by: Patrick McHardy --- extensions/libipt_DNAT.c | 4 +++- extensions/libipt_MASQUERADE.c | 4 +++- extensions/libipt_REDIRECT.c | 4 +++- extensions/libipt_SNAT.c | 4 +++- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/extensions/libipt_DNAT.c b/extensions/libipt_DNAT.c index b5c6ff56..5608947e 100644 --- a/extensions/libipt_DNAT.c +++ b/extensions/libipt_DNAT.c @@ -69,7 +69,7 @@ parse_to(char *arg, int portok, struct ipt_natinfo *info) if (!portok) exit_error(PARAMETER_PROBLEM, - "Need TCP or UDP with port specification"); + "Need TCP, UDP, SCTP or DCCP with port specification"); range.flags |= IP_NAT_RANGE_PROTO_SPECIFIED; @@ -142,6 +142,8 @@ static int DNAT_parse(int c, char **argv, int invert, unsigned int *flags, if (entry->ip.proto == IPPROTO_TCP || entry->ip.proto == IPPROTO_UDP + || entry->ip.proto == IPPROTO_SCTP + || entry->ip.proto == IPPROTO_DCCP || entry->ip.proto == IPPROTO_ICMP) portok = 1; else diff --git a/extensions/libipt_MASQUERADE.c b/extensions/libipt_MASQUERADE.c index 76707651..32410c09 100644 --- a/extensions/libipt_MASQUERADE.c +++ b/extensions/libipt_MASQUERADE.c @@ -77,6 +77,8 @@ static int MASQUERADE_parse(int c, char **argv, int invert, unsigned int *flags, if (entry->ip.proto == IPPROTO_TCP || entry->ip.proto == IPPROTO_UDP + || entry->ip.proto == IPPROTO_SCTP + || entry->ip.proto == IPPROTO_DCCP || entry->ip.proto == IPPROTO_ICMP) portok = 1; else @@ -86,7 +88,7 @@ static int MASQUERADE_parse(int c, char **argv, int invert, unsigned int *flags, case '1': if (!portok) exit_error(PARAMETER_PROBLEM, - "Need TCP or UDP with port specification"); + "Need TCP, UDP, SCTP or DCCP with port specification"); if (check_inverse(optarg, &invert, NULL, 0)) exit_error(PARAMETER_PROBLEM, diff --git a/extensions/libipt_REDIRECT.c b/extensions/libipt_REDIRECT.c index ffef3bf8..e30c1392 100644 --- a/extensions/libipt_REDIRECT.c +++ b/extensions/libipt_REDIRECT.c @@ -84,6 +84,8 @@ static int REDIRECT_parse(int c, char **argv, int invert, unsigned int *flags, if (entry->ip.proto == IPPROTO_TCP || entry->ip.proto == IPPROTO_UDP + || entry->ip.proto == IPPROTO_SCTP + || entry->ip.proto == IPPROTO_DCCP || entry->ip.proto == IPPROTO_ICMP) portok = 1; else @@ -93,7 +95,7 @@ static int REDIRECT_parse(int c, char **argv, int invert, unsigned int *flags, case '1': if (!portok) exit_error(PARAMETER_PROBLEM, - "Need TCP or UDP with port specification"); + "Need TCP, UDP, SCTP or DCCP with port specification"); if (check_inverse(optarg, &invert, NULL, 0)) exit_error(PARAMETER_PROBLEM, diff --git a/extensions/libipt_SNAT.c b/extensions/libipt_SNAT.c index b2a4925f..7d04761b 100644 --- a/extensions/libipt_SNAT.c +++ b/extensions/libipt_SNAT.c @@ -69,7 +69,7 @@ parse_to(char *arg, int portok, struct ipt_natinfo *info) if (!portok) exit_error(PARAMETER_PROBLEM, - "Need TCP or UDP with port specification"); + "Need TCP, UDP, SCTP or DCCP with port specification"); range.flags |= IP_NAT_RANGE_PROTO_SPECIFIED; @@ -142,6 +142,8 @@ static int SNAT_parse(int c, char **argv, int invert, unsigned int *flags, if (entry->ip.proto == IPPROTO_TCP || entry->ip.proto == IPPROTO_UDP + || entry->ip.proto == IPPROTO_SCTP + || entry->ip.proto == IPPROTO_DCCP || entry->ip.proto == IPPROTO_ICMP) portok = 1; else -- cgit v1.2.3