]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
Add SCTP/DCCP support to NAT targets
authorPatrick McHardy <kaber@trash.net>
Tue, 4 Nov 2008 12:22:40 +0000 (13:22 +0100)
committerPatrick McHardy <kaber@trash.net>
Tue, 4 Nov 2008 12:22:40 +0000 (13:22 +0100)
Signed-off-by: Patrick McHardy <kaber@trash.net>
extensions/libipt_DNAT.c
extensions/libipt_MASQUERADE.c
extensions/libipt_REDIRECT.c
extensions/libipt_SNAT.c

index b5c6ff563a7270a1a5ffcc89a9ac4704f3e6c228..5608947e17abeb3ca48238a53671cd72898e58d2 100644 (file)
@@ -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
index 76707651e6091f5e4268180aa363590278412d51..32410c09d39c9f60bd40bb8e1a72644fb57803c4 100644 (file)
@@ -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,
index ffef3bf85fd547cdcdd63b9d589490f7ab045a45..e30c139248a06a16ba2ad013039ccb2b9ff7417b 100644 (file)
@@ -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,
index b2a4925facb3951c48299fd6bcff8aea06316cdd..7d04761b712b3811422efe621549484855fc962d 100644 (file)
@@ -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