diff options
-rw-r--r-- | qa/testsuite/03nat | 4 | ||||
-rw-r--r-- | src/conntrack.c | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/qa/testsuite/03nat b/qa/testsuite/03nat index 8043af6..69fbff7 100644 --- a/qa/testsuite/03nat +++ b/qa/testsuite/03nat @@ -29,8 +29,8 @@ # create -I -s 1.1.1.1 -d 2.2.2.2 --dst-nat 3.3.3.3:80 -p tcp --sport 10 --dport 20 --state LISTEN -u SEEN_REPLY -t 50 ; OK # show --L --dst-nat :80 ; OK +-L --dst-nat 3.3.3.3:80 ; OK # show --L --any-nat :80 ; OK +-L --any-nat 3.3.3.3:80 ; OK # delete -D -s 1.1.1.1 ; OK diff --git a/src/conntrack.c b/src/conntrack.c index 82fe844..a5b49dd 100644 --- a/src/conntrack.c +++ b/src/conntrack.c @@ -816,6 +816,8 @@ nat_parse(char *arg, int portok, struct nf_conntrack *obj, int type) if (colon) { uint16_t port; + *colon = '\0'; + if (!portok) exit_error(PARAMETER_PROBLEM, "Need TCP or UDP with port specification"); @@ -841,7 +843,7 @@ nat_parse(char *arg, int portok, struct nf_conntrack *obj, int type) } if (parse_addr(arg, &parse) == AF_UNSPEC) - return; + exit_error(PARAMETER_PROBLEM, "Invalid IP address `%s'", arg); if (type == CT_OPT_SRC_NAT || type == CT_OPT_ANY_NAT) nfct_set_attr_u32(obj, ATTR_SNAT_IPV4, parse.v4); |