If ret was negative, ntohs may make it positive, which is undesired. Signed-off-by: Jan Engelhardt <jengelh@xxxxxxxxxx> --- xtoptions.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/xtoptions.c b/xtoptions.c index c3cc40e..8478d26 100644 --- a/xtoptions.c +++ b/xtoptions.c @@ -379,6 +379,8 @@ static int xtables_getportbyname(const char *name) } } freeaddrinfo(res); + if (ret < 0) + return ret; return ntohs(ret); } -- 1.7.1 -- 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