Message ID | 5397084D.8020703@samsung.com |
---|---|
State | Accepted |
Headers | show |
On Tue, Jun 10, 2014 at 02:29:49PM +0100, Domen Puncer wrote:
> getaddrinfo return value on error can also be positive.
At quick glance, all EAI_* that I see are negative.
What problem are you experience? What case are you trying to catch?
Thanks.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
On 11/06/14 10:37, Pablo Neira Ayuso wrote: > On Tue, Jun 10, 2014 at 02:29:49PM +0100, Domen Puncer wrote: >> getaddrinfo return value on error can also be positive. > > At quick glance, all EAI_* that I see are negative. You don't see all of them :-) On Android they're positive, e.g.: android-ndk-r9d/platforms/android-19/arch-arm/usr/include/netdb.h 147 #define EAI_NONAME 8 /* hostname nor servname provided, or not known */ And as a plus, it's not bad to conform to specs. > > What problem are you experience? What case are you trying to catch? > > Thanks. > -- To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Wed, Jun 11, 2014 at 10:48:19AM +0100, Domen Puncer wrote: > On 11/06/14 10:37, Pablo Neira Ayuso wrote: > > On Tue, Jun 10, 2014 at 02:29:49PM +0100, Domen Puncer wrote: > >> getaddrinfo return value on error can also be positive. > > > > At quick glance, all EAI_* that I see are negative. > > You don't see all of them :-) > On Android they're positive, e.g.: > android-ndk-r9d/platforms/android-19/arch-arm/usr/include/netdb.h > 147 #define EAI_NONAME 8 /* hostname nor servname provided, > or not known */ I suspected something like this.. Please, next time include this in the patch description since the beginning, thanks. > And as a plus, it's not bad to conform to specs. It sounds like a reasonable assumption to me. Do you have more patches like this in your queue? -- To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On 11/06/14 18:55, Pablo Neira Ayuso wrote: > On Wed, Jun 11, 2014 at 10:48:19AM +0100, Domen Puncer wrote: >> On 11/06/14 10:37, Pablo Neira Ayuso wrote: >>> On Tue, Jun 10, 2014 at 02:29:49PM +0100, Domen Puncer wrote: >>>> getaddrinfo return value on error can also be positive. >>> >>> At quick glance, all EAI_* that I see are negative. >> >> You don't see all of them :-) >> On Android they're positive, e.g.: >> android-ndk-r9d/platforms/android-19/arch-arm/usr/include/netdb.h >> 147 #define EAI_NONAME 8 /* hostname nor servname provided, >> or not known */ > > I suspected something like this.. > > Please, next time include this in the patch description since the > beginning, thanks. OK. Will do so. > >> And as a plus, it's not bad to conform to specs. > > It sounds like a reasonable assumption to me. > > Do you have more patches like this in your queue? Sorry, this was just a one-off. Best regards, Domen -- To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Thu, Jun 12, 2014 at 08:01:29AM +0100, Domen Puncer wrote: > On 11/06/14 18:55, Pablo Neira Ayuso wrote: > > On Wed, Jun 11, 2014 at 10:48:19AM +0100, Domen Puncer wrote: > >> On 11/06/14 10:37, Pablo Neira Ayuso wrote: > >>> On Tue, Jun 10, 2014 at 02:29:49PM +0100, Domen Puncer wrote: > >>>> getaddrinfo return value on error can also be positive. > >>> > >>> At quick glance, all EAI_* that I see are negative. > >> > >> You don't see all of them :-) > >> On Android they're positive, e.g.: > >> android-ndk-r9d/platforms/android-19/arch-arm/usr/include/netdb.h > >> 147 #define EAI_NONAME 8 /* hostname nor servname provided, > >> or not known */ > > > > I suspected something like this.. > > > > Please, next time include this in the patch description since the > > beginning, thanks. > > OK. Will do so. Applied. I have appended the information above into the description. -- To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
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),
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(-) -- To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html