#define SMB_STRDUP(s) strdup(s)
#endif
+#ifndef HOST_NAME_MAX
+#define HOST_NAME_MAX 255
+#endif
+
static int check_hostent_err(struct hostent *hp)
{
+#ifndef INET6
+ extern int h_errno;
+#endif
if (!hp) {
switch (h_errno) {
case HOST_NOT_FOUND:
int *perr)
{
return canon_name_from_hostent(
- gethostbyaddr(&ip, sizeof(ip), AF_INET),
+ gethostbyaddr((void *)&ip, sizeof ip, AF_INET),
perr);
}
*/
static int getaddr_info_single_addr(const char *service,
- uint32_t addr,
+ uint32 addr,
const struct addrinfo *hints,
struct addrinfo **res)
{
if (!(flags & NI_NUMERICHOST)) {
struct hostent *hp = gethostbyaddr(
- &((struct sockaddr_in *)sa)->sin_addr,
- sizeof(struct in_addr),
+ (void *)&((struct sockaddr_in *)sa)->sin_addr,
+ sizeof (struct in_addr),
sa->sa_family);
ret = check_hostent_err(hp);
if (ret == 0) {
return EAI_FAIL;
}
- if (salen < sizeof(struct sockaddr_in)) {
+ if (salen < (socklen_t)sizeof (struct sockaddr_in)) {
return EAI_FAIL;
}