From d53f2baa3b7ce1371c9bebd8842d2ed7f1f6c5de Mon Sep 17 00:00:00 2001
From: Přemysl Janouch
Date: Sun, 17 Aug 2014 17:50:25 +0200
Subject: Fix service name to port resolution
---
zyklonb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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");
--
cgit v1.2.3-70-g09d2