diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/isc/inet_ntop.c | 1 | ||||
| -rw-r--r-- | lib/isc/log.c | 24 | ||||
| -rw-r--r-- | lib/isc/result.c | 12 | ||||
| -rw-r--r-- | lib/isc/unix/file.c | 6 | ||||
| -rw-r--r-- | lib/isc/unix/ifiter_getifaddrs.c | 3 | ||||
| -rw-r--r-- | lib/isc/unix/ifiter_ioctl.c | 18 | ||||
| -rw-r--r-- | lib/isc/unix/net.c | 3 |
7 files changed, 43 insertions, 24 deletions
diff --git a/lib/isc/inet_ntop.c b/lib/isc/inet_ntop.c index 26d5dcad1f0a..773018031b9d 100644 --- a/lib/isc/inet_ntop.c +++ b/lib/isc/inet_ntop.c @@ -135,6 +135,7 @@ inet_ntop6(const unsigned char *src, char *dst, size_t size) words[i / 2] |= (src[i] << ((1 - (i % 2)) << 3)); best.base = -1; cur.base = -1; + best.len = cur.len = 0; for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++) { if (words[i] == 0) { if (cur.base == -1) diff --git a/lib/isc/log.c b/lib/isc/log.c index ce98303fecaf..38f0c4ff51e6 100644 --- a/lib/isc/log.c +++ b/lib/isc/log.c @@ -1143,7 +1143,7 @@ sync_channellist(isc_logconfig_t *lcfg) { static isc_result_t greatest_version(isc_logchannel_t *channel, int *greatestp) { /* XXXDCL HIGHLY NT */ - char *basename, *digit_end; + char *basenam, *digit_end; const char *dirname; int version, greatest = -1; unsigned int basenamelen; @@ -1160,23 +1160,23 @@ greatest_version(isc_logchannel_t *channel, int *greatestp) { * It is safe to DE_CONST the file.name because it was copied * with isc_mem_strdup in isc_log_createchannel. */ - basename = strrchr(FILE_NAME(channel), sep); + basenam = strrchr(FILE_NAME(channel), sep); #ifdef _WIN32 basename2 = strrchr(FILE_NAME(channel), '\\'); - if ((basename != NULL && basename2 != NULL && basename2 > basename) || - (basename == NULL && basename2 != NULL)) { - basename = basename2; + if ((basenam != NULL && basename2 != NULL && basename2 > basenam) || + (basenam == NULL && basename2 != NULL)) { + basenam = basename2; sep = '\\'; } #endif - if (basename != NULL) { - *basename++ = '\0'; + if (basenam != NULL) { + *basenam++ = '\0'; dirname = FILE_NAME(channel); } else { - DE_CONST(FILE_NAME(channel), basename); + DE_CONST(FILE_NAME(channel), basenam); dirname = "."; } - basenamelen = strlen(basename); + basenamelen = strlen(basenam); isc_dir_init(&dir); result = isc_dir_open(&dir, dirname); @@ -1184,8 +1184,8 @@ greatest_version(isc_logchannel_t *channel, int *greatestp) { /* * Replace the file separator if it was taken out. */ - if (basename != FILE_NAME(channel)) - *(basename - 1) = sep; + if (basenam != FILE_NAME(channel)) + *(basenam - 1) = sep; /* * Return if the directory open failed. @@ -1195,7 +1195,7 @@ greatest_version(isc_logchannel_t *channel, int *greatestp) { while (isc_dir_read(&dir) == ISC_R_SUCCESS) { if (dir.entry.length > basenamelen && - strncmp(dir.entry.name, basename, basenamelen) == 0 && + strncmp(dir.entry.name, basenam, basenamelen) == 0 && dir.entry.name[basenamelen] == '.') { version = strtol(&dir.entry.name[basenamelen + 1], diff --git a/lib/isc/result.c b/lib/isc/result.c index 520f1613acd1..da57272dfc27 100644 --- a/lib/isc/result.c +++ b/lib/isc/result.c @@ -172,7 +172,7 @@ const char * isc_result_totext(isc_result_t result) { resulttable *table; const char *txt, *default_text; - int index; + int idx; initialize(); @@ -183,15 +183,15 @@ isc_result_totext(isc_result_t result) { table != NULL; table = ISC_LIST_NEXT(table, link)) { if (result >= table->base && result <= table->last) { - index = (int)(result - table->base); - default_text = table->text[index]; + idx = (int)(result - table->base); + default_text = table->text[idx]; /* - * Note: we use 'index + 1' as the message number - * instead of index because isc_msgcat_get() requires + * Note: we use 'idx + 1' as the message number + * instead of idx because isc_msgcat_get() requires * the message number to be > 0. */ txt = isc_msgcat_get(table->msgcat, table->set, - index + 1, default_text); + idx + 1, default_text); break; } } diff --git a/lib/isc/unix/file.c b/lib/isc/unix/file.c index 3b59e86b0755..9eda4a33bc80 100644 --- a/lib/isc/unix/file.c +++ b/lib/isc/unix/file.c @@ -508,7 +508,7 @@ isc_file_safecreate(const char *filename, FILE **fp) { } isc_result_t -isc_file_splitpath(isc_mem_t *mctx, char *path, char **dirname, char **basename) +isc_file_splitpath(isc_mem_t *mctx, char *path, char **dirnam, char **basenam) { char *dir, *file, *slash; @@ -537,8 +537,8 @@ isc_file_splitpath(isc_mem_t *mctx, char *path, char **dirname, char **basename) return (ISC_R_INVALIDFILE); } - *dirname = dir; - *basename = file; + *dirnam = dir; + *basenam = file; return (ISC_R_SUCCESS); } diff --git a/lib/isc/unix/ifiter_getifaddrs.c b/lib/isc/unix/ifiter_getifaddrs.c index c2e4044ac008..425b9b4c3d35 100644 --- a/lib/isc/unix/ifiter_getifaddrs.c +++ b/lib/isc/unix/ifiter_getifaddrs.c @@ -212,6 +212,9 @@ internal_current(isc_interfaceiter_t *iter) { get_addr(family, &iter->current.broadcast, ifa->ifa_broadaddr, ifa->ifa_name); +#ifdef ISC_PLATFORM_HAVEIFNAMETOINDEX + iter->current.ifindex = if_nametoindex(iter->current.name); +#endif return (ISC_R_SUCCESS); } diff --git a/lib/isc/unix/ifiter_ioctl.c b/lib/isc/unix/ifiter_ioctl.c index a684867ce71f..c8e4970e6b33 100644 --- a/lib/isc/unix/ifiter_ioctl.c +++ b/lib/isc/unix/ifiter_ioctl.c @@ -109,6 +109,10 @@ struct isc_interfaceiter { #endif #endif +/* Silence a warning when this file is #included */ +int +isc_ioctl(int fildes, int req, char *arg); + int isc_ioctl(int fildes, int req, char *arg) { int trys; @@ -588,6 +592,9 @@ internal_current4(isc_interfaceiter_t *iter) { } iter->current.netmask.type.in6.s6_addr[i] = (~0 << bits) & 0xff; } +#ifdef ISC_PLATFORM_HAVEIFNAMETOINDEX + iter->current.ifindex = if_nametoindex(iter->current.name); +#endif return (ISC_R_SUCCESS); inet: @@ -664,6 +671,9 @@ internal_current4(isc_interfaceiter_t *iter) { } get_addr(family, &iter->current.netmask, (struct sockaddr *)&ifreq.ifr_addr, ifreq.ifr_name); +#ifdef ISC_PLATFORM_HAVEIFNAMETOINDEX + iter->current.ifindex = if_nametoindex(iter->current.name); +#endif return (ISC_R_SUCCESS); } @@ -704,7 +714,6 @@ internal_current6(isc_interfaceiter_t *iter) { get_addr(family, &iter->current.address, (struct sockaddr *)&lifreq.lifr_addr, lifreq.lifr_name); - iter->current.ifindex = lifreq.lifr_index; if (isc_netaddr_islinklocal(&iter->current.address)) isc_netaddr_setzone(&iter->current.address, (isc_uint32_t)lifreq.lifr_index); @@ -844,7 +853,9 @@ internal_current6(isc_interfaceiter_t *iter) { iter->current.netmask.type.in6.s6_addr[i / 8] = (~0 << bits) & 0xff; } - +#ifdef ISC_PLATFORM_HAVEIFNAMETOINDEX + iter->current.ifindex = if_nametoindex(iter->current.name); +#endif return (ISC_R_SUCCESS); } #endif @@ -867,6 +878,9 @@ internal_current6(isc_interfaceiter_t *iter) { get_addr(family, &iter->current.netmask, (struct sockaddr *)&lifreq.lifr_addr, lifreq.lifr_name); +#ifdef ISC_PLATFORM_HAVEIFNAMETOINDEX + iter->current.ifindex = if_nametoindex(iter->current.name); +#endif return (ISC_R_SUCCESS); } #endif diff --git a/lib/isc/unix/net.c b/lib/isc/unix/net.c index 2ba17d165067..7056668ca0cd 100644 --- a/lib/isc/unix/net.c +++ b/lib/isc/unix/net.c @@ -106,7 +106,8 @@ const struct in6_addr isc_net_in6addrloop = IN6ADDR_LOOPBACK_INIT; static isc_once_t once_ipv6only = ISC_ONCE_INIT; # endif -# if defined(ISC_PLATFORM_HAVEIN6PKTINFO) +# if defined(ISC_PLATFORM_HAVEIPV6) && \ + defined(WANT_IPV6) && defined(ISC_PLATFORM_HAVEIN6PKTINFO) static isc_once_t once_ipv6pktinfo = ISC_ONCE_INIT; # endif #endif /* ISC_PLATFORM_HAVEIPV6 */ |
