diff options
author | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2017-02-23 13:35:42 +0100 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2017-02-23 16:42:44 +0100 |
commit | 7860d2791841228bcc655813f7b177644ee381d2 (patch) | |
tree | 39ae5d6bd7d85bdee2ecd8424006c1a407c3d718 | |
parent | 0ee567e828da92cc0ddf9b0332a700e1d62bfd70 (diff) | |
download | gnutls-7860d2791841228bcc655813f7b177644ee381d2.tar.gz |
gnutls-cli-debug: fixed protocol to port discovery
That is, if --starttls-proto is provided the default port
selected will be converted to host byte order as expected.
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
-rw-r--r-- | src/socket.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/socket.c b/src/socket.c index 9c5ca8b685..626066e0fe 100644 --- a/src/socket.c +++ b/src/socket.c @@ -336,8 +336,9 @@ starttls_proto_to_port(const char *app_proto) s = getservbyname(app_proto, NULL); if (s != NULL) { - return s->s_port; + return ntohs(s->s_port); } + endservent(); return 443; |