hpux: ioctl(SIOCGLIFCONF) failure -> debug(1)

This commit is contained in:
Mark Andrews
2002-07-01 01:08:37 +00:00
parent 54532c5413
commit fe4d3e1992
3 changed files with 31 additions and 7 deletions

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: log.h,v 1.42 2002/02/20 03:35:34 marka Exp $ */
/* $Id: log.h,v 1.43 2002/07/01 01:08:35 marka Exp $ */
#ifndef ISC_LOG_H
#define ISC_LOG_H 1
@@ -140,6 +140,7 @@ LIBISC_EXTERNAL_DATA extern isc_logmodule_t isc_modules[];
#define ISC_LOGMODULE_SOCKET (&isc_modules[0])
#define ISC_LOGMODULE_TIME (&isc_modules[1])
#define ISC_LOGMODULE_INTERFACE (&isc_modules[3])
ISC_LANG_BEGINDECLS

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: log.c,v 1.76 2002/06/03 04:34:19 marka Exp $ */
/* $Id: log.c,v 1.77 2002/07/01 01:08:34 marka Exp $ */
/* Principal Authors: DCL */
@@ -197,6 +197,7 @@ LIBISC_EXTERNAL_DATA isc_logcategory_t isc_categories[] = {
LIBISC_EXTERNAL_DATA isc_logmodule_t isc_modules[] = {
{ "socket", 0 },
{ "time", 0 },
{ "interface", 0 },
{ NULL, 0 }
};

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: ifiter_ioctl.c,v 1.29 2002/06/07 00:03:50 marka Exp $ */
/* $Id: ifiter_ioctl.c,v 1.30 2002/07/01 01:08:37 marka Exp $ */
/*
* Obtain the list of network interfaces using the SIOCGLIFCONF ioctl.
@@ -189,6 +189,26 @@ getbuf6(isc_interfaceiter_t *iter) {
*/
if (ioctl(iter->socket, SIOCGLIFCONF, (char *)&iter->lifc)
== -1) {
#ifdef __hpux
/*
* IPv6 interface scanning is not available on all
* kernels w/ IPv6 sockets.
*/
if (errno == ENOENT) {
isc__strerror(errno, strbuf, sizeof(strbuf));
isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL,
ISC_LOGMODULE_INTERFACE,
ISC_LOG_DEBUG(1),
isc_msgcat_get(isc_msgcat,
ISC_MSGSET_IFITERIOCTL,
ISC_MSG_GETIFCONFIG,
"get interface "
"configuration: %s"),
strbuf);
result = ISC_R_FAILURE;
goto cleanup;
}
#endif
if (errno != EINVAL) {
isc__strerror(errno, strbuf, sizeof(strbuf));
UNEXPECTED_ERROR(__FILE__, __LINE__,
@@ -198,7 +218,8 @@ getbuf6(isc_interfaceiter_t *iter) {
"get interface "
"configuration: %s"),
strbuf);
goto unexpected;
result = ISC_R_UNEXPECTED;
goto cleanup;
}
/*
* EINVAL. Retry with a bigger buffer.
@@ -226,7 +247,8 @@ getbuf6(isc_interfaceiter_t *iter) {
"configuration: "
"maximum buffer "
"size exceeded"));
goto unexpected;
result = ISC_R_UNEXPECTED;
goto cleanup;
}
isc_mem_put(iter->mctx, iter->buf, iter->bufsize);
@@ -236,10 +258,10 @@ getbuf6(isc_interfaceiter_t *iter) {
iter->mode = 6;
return (ISC_R_SUCCESS);
unexpected:
cleanup:
isc_mem_put(iter->mctx, iter->buf, iter->bufsize);
iter->buf = NULL;
return (ISC_R_UNEXPECTED);
return (result);
#endif
}