Fix warnings on android ndk

This commit is contained in:
Jeremy Lakeman 2017-08-29 13:19:35 +09:30
parent e8effa75e4
commit cf4306cff2
2 changed files with 4 additions and 2 deletions

View File

@ -1290,8 +1290,10 @@ static int netlink_socket()
addr.nl_family = AF_NETLINK;
addr.nl_groups = RTMGRP_IPV4_IFADDR;
if (bind(sock, (struct sockaddr *)&addr, sizeof(addr)) == -1)
if (bind(sock, (struct sockaddr *)&addr, sizeof(addr)) == -1){
close(sock);
return WHYF_perror("bind(%d,AF_NETLINK,%lu)", sock, (unsigned long)sizeof(addr));
}
DEBUGF(overlayinterfaces, "bind(%d,AF_NETLINK,%lu)", sock, (unsigned long)sizeof(addr));

View File

@ -369,7 +369,7 @@ int socket_resolve_name(int family, const char *name, const char *service, struc
struct addrinfo *p = addresses;
while(p){
if (p->ai_addrlen < sizeof(address->raw) && (p->ai_addr->sa_family == AF_INET || p->ai_addr->sa_family == AF_INET6)){
if (p->ai_addrlen < (socklen_t)sizeof(address->raw) && (p->ai_addr->sa_family == AF_INET || p->ai_addr->sa_family == AF_INET6)){
address->addrlen = p->ai_addrlen;
memcpy(&address->addr, p->ai_addr, p->ai_addrlen);
ret = 0;