diff options
author | Daniel Stenberg <daniel@haxx.se> | 2012-02-25 22:42:39 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2012-03-16 16:06:03 +0100 |
commit | 506d5862768b3b26969de9daab3fa77b7cb1ab7d (patch) | |
tree | 65f667c7955cf64f576a6579e5b7f7f0bba5f403 /ares_init.c | |
parent | 1c26242c52725631834db250589ccdde8dab49cf (diff) | |
download | c-ares-506d5862768b3b26969de9daab3fa77b7cb1ab7d.tar.gz c-ares-506d5862768b3b26969de9daab3fa77b7cb1ab7d.tar.bz2 c-ares-506d5862768b3b26969de9daab3fa77b7cb1ab7d.zip |
port numbers: convert them to network order!
When the config options ARES_OPT_UDP_PORT or ARES_OPT_TCP_PORT are used,
make sure to convert them to network byte order!
Bug: http://c-ares.haxx.se/mail/c-ares-archive-2012-02/0004.shtml
Diffstat (limited to 'ares_init.c')
-rw-r--r-- | ares_init.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ares_init.c b/ares_init.c index 252569f..ea2a978 100644 --- a/ares_init.c +++ b/ares_init.c @@ -434,9 +434,9 @@ static int init_by_options(ares_channel channel, if ((optmask & ARES_OPT_ROTATE) && channel->rotate == -1) channel->rotate = 1; if ((optmask & ARES_OPT_UDP_PORT) && channel->udp_port == -1) - channel->udp_port = options->udp_port; + channel->udp_port = htons(options->udp_port); if ((optmask & ARES_OPT_TCP_PORT) && channel->tcp_port == -1) - channel->tcp_port = options->tcp_port; + channel->tcp_port = htons(options->tcp_port); if ((optmask & ARES_OPT_SOCK_STATE_CB) && channel->sock_state_cb == NULL) { channel->sock_state_cb = options->sock_state_cb; |