summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2014-08-17 17:50:25 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2014-08-17 17:50:25 +0200
commitd53f2baa3b7ce1371c9bebd8842d2ed7f1f6c5de (patch)
tree934e44bd5c80a0502a8e6b7b3d03d1895a13cf2b
parentbd0187a82523db1b82b90ca103b23e4cc3f53acf (diff)
downloadxK-d53f2baa3b7ce1371c9bebd8842d2ed7f1f6c5de.tar.gz
xK-d53f2baa3b7ce1371c9bebd8842d2ed7f1f6c5de.tar.xz
xK-d53f2baa3b7ce1371c9bebd8842d2ed7f1f6c5de.zip
Fix service name to port resolution
-rw-r--r--zyklonb.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/zyklonb.c b/zyklonb.c
index 7c00583..f8d931a 100644
--- a/zyklonb.c
+++ b/zyklonb.c
@@ -995,7 +995,7 @@ socks_connect (const char *socks_host, const char *socks_port,
unsigned long port_no;
const struct servent *serv;
if ((serv = getservbyname (port, "tcp")))
- port_no = (uint16_t) serv->s_port;
+ port_no = (uint16_t) ntohs (serv->s_port);
else if (!xstrtoul (&port_no, port, 10) || !port_no || port_no > UINT16_MAX)
{
error_set (e, "invalid port number");