summaryrefslogtreecommitdiff
path: root/ares_getnameinfo.c
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2007-02-06 03:31:27 +0000
committerYang Tse <yangsita@gmail.com>2007-02-06 03:31:27 +0000
commitb9c00a23cef0ea4f6b14c2e074653bde276afcd7 (patch)
tree2fe81c78e15cc55504a722997c829067406cb62f /ares_getnameinfo.c
parent69b6529167a3ad27a52ac0ba5bf8ab4c5d71d94c (diff)
downloadc-ares-b9c00a23cef0ea4f6b14c2e074653bde276afcd7.tar.gz
c-ares-b9c00a23cef0ea4f6b14c2e074653bde276afcd7.tar.bz2
c-ares-b9c00a23cef0ea4f6b14c2e074653bde276afcd7.zip
compiler warning fix
Diffstat (limited to 'ares_getnameinfo.c')
-rw-r--r--ares_getnameinfo.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/ares_getnameinfo.c b/ares_getnameinfo.c
index 5499705..a63c9b6 100644
--- a/ares_getnameinfo.c
+++ b/ares_getnameinfo.c
@@ -322,6 +322,9 @@ static char *lookup_service(unsigned short port, int flags,
static void append_scopeid(struct sockaddr_in6 *addr6, unsigned int flags,
char *buf, size_t buflen)
{
+#ifdef HAVE_IF_INDEXTONAME
+ int is_ll, is_mcll;
+#endif
char fmt_u[] = "%u";
char fmt_lu[] = "%lu";
char tmpbuf[IF_NAMESIZE + 2];
@@ -331,9 +334,10 @@ static void append_scopeid(struct sockaddr_in6 *addr6, unsigned int flags,
tmpbuf[0] = '%';
#ifdef HAVE_IF_INDEXTONAME
+ is_ll = IN6_IS_ADDR_LINKLOCAL(&addr6->sin6_addr);
+ is_mcll = IN6_IS_ADDR_MC_LINKLOCAL(&addr6->sin6_addr);
if ((flags & ARES_NI_NUMERICSCOPE) ||
- (!IN6_IS_ADDR_LINKLOCAL(&addr6->sin6_addr)
- && !IN6_IS_ADDR_MC_LINKLOCAL(&addr6->sin6_addr)))
+ (!is_ll && !is_mcll))
{
sprintf(&tmpbuf[1], fmt, addr6->sin6_scope_id);
}