summaryrefslogtreecommitdiffstats
path: root/xtoptions.c
diff options
context:
space:
mode:
authorJan Engelhardt <jengelh@medozas.de>2011-04-14 13:54:24 +0200
committerJan Engelhardt <jengelh@medozas.de>2011-04-14 13:54:54 +0200
commit44517bda3d8130638882f69478a8091316f30cbb (patch)
tree02d272bd02f4895f1e6c013f6522776ea433afa2 /xtoptions.c
parentd44c31ac8e52f34e058f44aba14f679abcc7edf9 (diff)
xtoptions: respect return value in xtables_getportbyname
If ret was negative, ntohs may make it positive, which is undesired. Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Diffstat (limited to 'xtoptions.c')
-rw-r--r--xtoptions.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/xtoptions.c b/xtoptions.c
index c3cc40e6..8478d26d 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);
}