aboutsummaryrefslogtreecommitdiff
path: root/ares
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2007-02-01 15:36:56 +0000
committerYang Tse <yangsita@gmail.com>2007-02-01 15:36:56 +0000
commitd2dd3d7e16fcebdb34d41c944c5a5aef0d0d8bcf (patch)
treec3e413a5019a6f812a9bf6c37153e933f36529ed /ares
parent1c63ceb317f8bed76edeb63df4d77986f60c8710 (diff)
compiler warning fix
Diffstat (limited to 'ares')
-rw-r--r--ares/ares_getnameinfo.c6
-rw-r--r--ares/ares_process.c4
2 files changed, 6 insertions, 4 deletions
diff --git a/ares/ares_getnameinfo.c b/ares/ares_getnameinfo.c
index 51e36fb10..117c6c9a4 100644
--- a/ares/ares_getnameinfo.c
+++ b/ares/ares_getnameinfo.c
@@ -110,7 +110,8 @@ void ares_getnameinfo(ares_channel channel, const struct sockaddr *sa, socklen_t
port = addr->sin_port;
else
port = addr6->sin6_port;
- service = lookup_service(port, flags, buf, sizeof(buf));
+ service = lookup_service((unsigned short)(port & 0xffff),
+ flags, buf, sizeof(buf));
callback(arg, ARES_SUCCESS, NULL, service);
return;
}
@@ -151,7 +152,8 @@ void ares_getnameinfo(ares_channel channel, const struct sockaddr *sa, socklen_t
}
/* They also want a service */
if (flags & ARES_NI_LOOKUPSERVICE)
- service = lookup_service(port, flags, srvbuf, sizeof(srvbuf));
+ service = lookup_service((unsigned short)(port & 0xffff),
+ flags, srvbuf, sizeof(srvbuf));
callback(arg, ARES_SUCCESS, ipbuf, service);
return;
}
diff --git a/ares/ares_process.c b/ares/ares_process.c
index a3a25ba48..4b4ff35a7 100644
--- a/ares/ares_process.c
+++ b/ares/ares_process.c
@@ -609,7 +609,7 @@ static int open_tcp_socket(ares_channel channel, struct server_state *server)
memset(&sockin, 0, sizeof(sockin));
sockin.sin_family = AF_INET;
sockin.sin_addr = server->addr;
- sockin.sin_port = channel->tcp_port;
+ sockin.sin_port = (unsigned short)(channel->tcp_port & 0xffff);
if (connect(s, (struct sockaddr *) &sockin, sizeof(sockin)) == -1) {
int err = GET_ERRNO();
@@ -642,7 +642,7 @@ static int open_udp_socket(ares_channel channel, struct server_state *server)
memset(&sockin, 0, sizeof(sockin));
sockin.sin_family = AF_INET;
sockin.sin_addr = server->addr;
- sockin.sin_port = channel->udp_port;
+ sockin.sin_port = (unsigned short)(channel->udp_port & 0xffff);
if (connect(s, (struct sockaddr *) &sockin, sizeof(sockin)) == -1)
{
closesocket(s);