netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH iptables] libxtables: fix getaddrinfo return value usage
@ 2014-06-10 13:29 Domen Puncer
  2014-06-11  9:37 ` Pablo Neira Ayuso
  0 siblings, 1 reply; 6+ messages in thread
From: Domen Puncer @ 2014-06-10 13:29 UTC (permalink / raw)
  To: netfilter-devel

getaddrinfo return value on error can also be positive.

Signed-off-by: Domen Puncer Kugler <domen.puncer@samsung.com>
---
 libxtables/xtoptions.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libxtables/xtoptions.c b/libxtables/xtoptions.c
index 9b4c5aa..d26d2f8 100644
--- a/libxtables/xtoptions.c
+++ b/libxtables/xtoptions.c
@@ -519,7 +519,7 @@ static void xtopt_parse_host(struct xt_option_call *cb)
 	int ret;

 	ret = getaddrinfo(cb->arg, NULL, &hints, &res);
-	if (ret < 0)
+	if (ret != 0)
 		xt_params->exit_err(PARAMETER_PROBLEM,
 			"getaddrinfo: %s\n", gai_strerror(ret));

@@ -562,7 +562,7 @@ static int xtables_getportbyname(const char *name)
 	int ret;

 	ret = getaddrinfo(NULL, name, NULL, &res);
-	if (ret < 0)
+	if (ret != 0)
 		return -1;
 	ret = -1;
 	for (p = res; p != NULL; p = p->ai_next) {
@@ -675,7 +675,7 @@ static int xtopt_parse_mask(struct xt_option_call *cb)
 	int ret;

 	ret = getaddrinfo(cb->arg, NULL, &hints, &res);
-	if (ret < 0)
+	if (ret != 0)
 		return 0;

 	memcpy(&cb->val.hmask, xtables_sa_host(res->ai_addr, res->ai_family),

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-06-16  9:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-10 13:29 [PATCH iptables] libxtables: fix getaddrinfo return value usage Domen Puncer
2014-06-11  9:37 ` Pablo Neira Ayuso
2014-06-11  9:48   ` Domen Puncer
2014-06-11 17:55     ` Pablo Neira Ayuso
2014-06-12  7:01       ` Domen Puncer
2014-06-16  9:48         ` Pablo Neira Ayuso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).