[PATCH] Bugzilla 482: Allow symbolic port in REDIRECT --to-port

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Signed-off-by: Kristof Provost <kristof@xxxxxxxxxx>
- ---
 extensions/libipt_REDIRECT.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/extensions/libipt_REDIRECT.c b/extensions/libipt_REDIRECT.c
index b4c73bb..c03562b 100644
- --- a/extensions/libipt_REDIRECT.c
+++ b/extensions/libipt_REDIRECT.c
@@ -49,6 +49,9 @@ parse_ports(const char *arg, struct ip_nat_multi_range *mr)
 		exit_error(PARAMETER_PROBLEM, "IP address not permitted\n");
 
 	port = atoi(arg);
+	if (port == 0)
+		port = service_to_port(arg, NULL);
+
 	if (port == 0 || port > 65535)
 		exit_error(PARAMETER_PROBLEM, "Port `%s' not valid\n", arg);
 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFIOcDAUEZ9DhGwDugRAlRNAJ9pWRB+JNhJtNzCmtoioWeISdScPwCeJiCi
b3D0yAzePmT52f37CM88MrA=
=Vph2
-----END PGP SIGNATURE-----
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux