mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-10-22 13:57:03 +08:00
Makefile: Conditionalize IPV6 files and build some commands as .rel
At least ifconfig has "static" global C constructors and you have to force the objects in.
This commit is contained in:
@@ -340,6 +340,7 @@ gethostanswer(const querybuf *answer, int anslen, const char *qname, int qtype,
|
||||
break;
|
||||
#else
|
||||
he->h_name = bp;
|
||||
#ifdef INET6
|
||||
if (statp->options & RES_USE_INET6) {
|
||||
n = strlen(bp) + 1; /* for the \0 */
|
||||
if (n >= MAXHOSTNAMELEN) {
|
||||
@@ -349,6 +350,7 @@ gethostanswer(const querybuf *answer, int anslen, const char *qname, int qtype,
|
||||
bp += n;
|
||||
_map_v4v6_hostent(he, &bp, ep);
|
||||
}
|
||||
#endif
|
||||
RES_SET_H_ERRNO(statp, NETDB_SUCCESS);
|
||||
return (0);
|
||||
#endif
|
||||
@@ -424,8 +426,10 @@ gethostanswer(const querybuf *answer, int anslen, const char *qname, int qtype,
|
||||
he->h_name = bp;
|
||||
bp += n;
|
||||
}
|
||||
#ifdef INET6
|
||||
if (statp->options & RES_USE_INET6)
|
||||
_map_v4v6_hostent(he, &bp, ep);
|
||||
#endif
|
||||
RES_SET_H_ERRNO(statp, NETDB_SUCCESS);
|
||||
return (0);
|
||||
}
|
||||
@@ -699,11 +703,13 @@ _dns_gethostbyaddr(void *rval, void *cb_data, va_list ap)
|
||||
memcpy(hed->host_addr, uaddr, len);
|
||||
hed->h_addr_ptrs[0] = (char *)hed->host_addr;
|
||||
hed->h_addr_ptrs[1] = NULL;
|
||||
#ifdef INET6
|
||||
if (af == AF_INET && (statp->options & RES_USE_INET6)) {
|
||||
_map_v4v6_address((char*)hed->host_addr, (char*)hed->host_addr);
|
||||
he.h_addrtype = AF_INET6;
|
||||
he.h_length = NS_IN6ADDRSZ;
|
||||
}
|
||||
#endif
|
||||
if (__copy_hostent(&he, hptr, buffer, buflen) != 0) {
|
||||
*errnop = errno;
|
||||
RES_SET_H_ERRNO(statp, NETDB_INTERNAL);
|
||||
|
Reference in New Issue
Block a user