Remove the meaningless on Linux if_dl.h header.
This was misleading 'configure' into thinking we actually support AF_LINK,
but we're Linux, so we don't, and we never implemented the functions we
declared here either.
Reported to AOSP by Jun-ya Kato.
(cherry-pick of 5056f1fad1187cd67729bb04ba72397d78256f03.)
Change-Id: Ic67f674d2221497c8166994812bb5fc7f0831066
diff --git a/libc/netbsd/net/getnameinfo.c b/libc/netbsd/net/getnameinfo.c
index d3d0011..fcc47e7 100644
--- a/libc/netbsd/net/getnameinfo.c
+++ b/libc/netbsd/net/getnameinfo.c
@@ -53,7 +53,9 @@
#include <sys/types.h>
#include <sys/socket.h>
#include <net/if.h>
+#if defined(ANDROID_CHANGES) && defined(AF_LINK)
#include <net/if_dl.h>
+#endif
#include <net/if_ieee1394.h>
#include <net/if_types.h>
#include <netinet/in.h>
@@ -104,8 +106,10 @@
static int ip6_sa2str __P((const struct sockaddr_in6 *, char *, size_t,
int));
#endif
+#if defined(ANDROID_CHANGES) && defined(AF_LINK)
static int getnameinfo_link __P((const struct sockaddr *, socklen_t, char *,
socklen_t, char *, socklen_t, int));
+#endif
static int hexname __P((const u_int8_t *, size_t, char *, socklen_t));
/*
@@ -119,7 +123,7 @@
case AF_INET6:
return getnameinfo_inet(sa, salen, host, hostlen,
serv, servlen, flags);
-#if 0
+#if defined(ANDROID_CHANGES) && defined(AF_LINK)
case AF_LINK:
return getnameinfo_link(sa, salen, host, hostlen,
serv, servlen, flags);
@@ -390,7 +394,7 @@
#endif
if (hp) {
-#if 0
+#if defined(ANDROID_CHANGES) && defined(AF_LINK)
/*
* commented out, since "for local host" is not
* implemented here - see RFC2553 p30
@@ -528,6 +532,7 @@
#endif /* INET6 */
+#if defined(ANDROID_CHANGES) && defined(AF_LINK)
/*
* getnameinfo_link():
* Format a link-layer address into a printable format, paying attention to
@@ -605,6 +610,7 @@
(size_t)sdl->sdl_alen, host, hostlen);
}
}
+#endif
static int
hexname(cp, len, host, hostlen)