diff options
author | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2017-02-23 13:35:42 +0100 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2017-02-23 13:40:39 +0100 |
commit | dbf47f55ba4c84cf285582c2adead4e1b0ab82f7 (patch) | |
tree | 1494dd11271625dc3a2b4fa17d14db68efa88f44 | |
parent | d510a50554c0f785b55a7d5f4e8aed7fd1effe2e (diff) | |
download | gnutls-dbf47f55ba4c84cf285582c2adead4e1b0ab82f7.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; |