Skip to content
Permalink
Browse files

Posix compatibility enhancement

  • Loading branch information
michaelortmann authored and vanosg committed Nov 27, 2019
1 parent c46a9f8 commit ec5d20446ca480538bc3c45b6c364eca538bd3f6
Showing with 2 additions and 6 deletions.
  1. +2 −6 src/mod/dns.mod/coredns.c
@@ -692,7 +692,6 @@ void ptrstring6(struct in6_addr *ip6, char *buf, size_t sz)
*p++ = '.';
*p++ = hex[(ip6->s6_addr[i] >> 4) & 0x0f];
*p++ = '.';
*p = '\0';
}
strcpy(p, "ip6.arpa"); /* ip6.int is deprecated */
}
@@ -1242,7 +1241,6 @@ static void dns_forward(char *hostn)
static int init_dns_network(void)
{
int option;
struct in_addr inaddr;

resfd = socket(AF_INET, SOCK_DGRAM, 0);
if (resfd == -1) {
@@ -1258,17 +1256,15 @@ static int init_dns_network(void)
return 0;
}
option = 1;
if (setsockopt(resfd, SOL_SOCKET, SO_BROADCAST, (char *) &option,
sizeof(option))) {
if (setsockopt(resfd, SOL_SOCKET, SO_BROADCAST, &option, sizeof option)) {
putlog(LOG_MISC, "*",
"Unable to setsockopt() on nameserver communication socket: %s",
strerror(errno));
killsock(resfd);
return 0;
}

egg_inet_aton("127.0.0.1", &inaddr);
localhost = inaddr.s_addr;
localhost = htonl(INADDR_LOOPBACK);
return 1;
}

0 comments on commit ec5d204

Please sign in to comment.
You can’t perform that action at this time.