From fbd38d805b2fca970369c16fe3cd936272288165 Mon Sep 17 00:00:00 2001 From: Franck Joncourt Date: Fri, 12 Apr 2013 14:48:26 +0200 Subject: [PATCH] Added some else statements and their comments. --- client/fwknop.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/client/fwknop.c b/client/fwknop.c index 722e42db..f80a04dd 100644 --- a/client/fwknop.c +++ b/client/fwknop.c @@ -161,8 +161,14 @@ is_hostname_str_with_port(const char *str, char *hostname, size_t hostname_bufsi strlcpy(hostname, h, hostname_bufsize); valid = 1; } + + /* The port is out of range or the ip is an ipv6 or ipv4 address */ + else; } + /* No port found in the string, let's skip */ + else; + return valid; } @@ -906,6 +912,7 @@ set_nat_access(fko_ctx_t ctx, fko_cli_options_t *options, const char * const acc } } + /* Check if there is a hostname to resolve as an ip address in the NAT access buffer */ if (is_hostname_str_with_port(nat_access_buf, hostname, sizeof(hostname), &port)) { /* Speed up the name resolution by forcing ipv4 (AF_INET). @@ -925,6 +932,9 @@ set_nat_access(fko_ctx_t ctx, fko_cli_options_t *options, const char * const acc dst_ip_str, port); } + /* Nothing to resolve */ + else; + if(options->nat_rand_port) { /* Must print to stdout what the random port is since