char *buff;
ipaddr_t ripaddr;
tcpport_t rport;
-#ifdef __NBSD_LIBC
-static tcpport_t lport = htons(0xF000);
-#else
-static tcpport_t lport = HTONS(0xF000);
-#endif
+static tcpport_t lport;
int s;
int i;
int wpid;
char port[32];
int wasopen;
+ lport = htons(0xF000);
+
#ifdef DEBUG
printf("DOdata %s %s %d %d\n", datacom, file, direction, fd);
#endif
unsigned ancount;
struct hostent localhost;
static char *noaliases[]= { nil };
- static ipaddr_t localaddr= HTONL(LOCALHOST);
+ static ipaddr_t localaddr;
static char *localaddrlist[]= { (char *) &localaddr, nil };
+ localaddr = HTONL(LOCALHOST);
+
if (single) return 0;
/* Assume we can answer. */
sethostent(0);
do {
- switch (type) {
- case HTONS(T_A):
+ int type_host = NTOHS(type);
+ switch (type_host) {
+ case T_A:
if (namecmp(qname, he->h_name) == 0) {
addA:
r= dn_comp((u8_t *) he->h_name, cp, arraylimit(dns.data) - cp,
break;
}
/*FALL THROUGH*/
- case HTONS(T_CNAME):
+ case T_CNAME:
domain= namechr(he->h_name, '.');
for (i= 0; he->h_aliases[i] != nil; i++) {
namecpy(name, he->h_aliases[i]);
}
}
break;
- case HTONS(T_PTR):
+ case T_PTR:
if (ancount > 0) break;
if (he->h_name[0] == '%') break;
sprintf((char *) name, "%d.%d.%d.%d.in-addr.arpa",