]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
Remove reference to interface index. Remove isc_log_write references
authorDanny Mayer <mayer@ntp.org>
Sun, 2 Jan 2005 03:14:34 +0000 (22:14 -0500)
committerDanny Mayer <mayer@ntp.org>
Sun, 2 Jan 2005 03:14:34 +0000 (22:14 -0500)
bk: 41d7671a8JS2cS9M7v0Gx1qpMTT99g

libisc/ifiter_getifaddrs.c
libisc/ifiter_ioctl.c
libisc/ifiter_sysctl.c

index fd2a38bcff1fb5eebef53c2ebf5d296a2cf89042..fd4a2d9f27aa9d26af4007bf883af74a56bf0595 100644 (file)
@@ -119,7 +119,6 @@ internal_current(isc_interfaceiter_t *iter) {
 
        memset(iter->current.name, 0, sizeof(iter->current.name));
        memcpy(iter->current.name, ifa->ifa_name, namelen);
-       iter->current.ifindex = ifa.ifa_index;  /* Save the if index */
 
        iter->current.flags = 0;
 
index 064dbb65ce41fc53adde7a5c31a3a3f9d6c3b56b..72c49f367b95dcda6cdce0180442ff8e7fefb025 100644 (file)
@@ -454,8 +454,7 @@ linux_if_inet6_current(isc_interfaceiter_t *iter) {
        if (iter->valid != ISC_R_SUCCESS)
                return (iter->valid);
        if (iter->proc == NULL) {
-               isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL,
-                             ISC_LOGMODULE_INTERFACE, ISC_LOG_ERROR,
+               UNEXPECTED_ERROR(__FILE__, __LINE__,
                              "/proc/net/if_inet6:iter->proc == NULL");
                return (ISC_R_FAILURE);
        }
@@ -463,15 +462,13 @@ linux_if_inet6_current(isc_interfaceiter_t *iter) {
        res = sscanf(iter->entry, "%32[a-f0-9] %x %x %x %x %16s\n",
                     address, &ifindex, &prefix, &flag3, &flag4, name);
        if (res != 6) {
-               isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL,
-                             ISC_LOGMODULE_INTERFACE, ISC_LOG_ERROR,
+               UNEXPECTED_ERROR(__FILE__, __LINE__,
                              "/proc/net/if_inet6:sscanf() -> %d (expected 6)",
                              res);
                return (ISC_R_FAILURE);
        }
        if (strlen(address) != 32) {
-               isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL,
-                             ISC_LOGMODULE_INTERFACE, ISC_LOG_ERROR,
+               UNEXPECTED_ERROR(__FILE__, __LINE__,
                              "/proc/net/if_inet6:strlen(%s) != 32", address);
                return (ISC_R_FAILURE);
        }
@@ -558,16 +555,6 @@ internal_current4(isc_interfaceiter_t *iter) {
        memset(iter->current.name, 0, sizeof(iter->current.name));
        memcpy(iter->current.name, ifreq.ifr_name, sizeof(ifreq.ifr_name));
 
-       /* Some older O/S's don't have the interface index. Since ifr_index is
-        * usually a macro definition into the actual structure we
-        * use that to determine if we should get it.
-        */
-#ifdef ifr_index
-       iter->current.ifindex = ifreq.ifr_index;        /* Save the if index */
-#else
-       iter->current.ifindex = 0;
-#endif
-
        get_addr(family, &iter->current.address,
                 (struct sockaddr *)&ifrp->ifr_addr, ifreq.ifr_name);
 
@@ -645,9 +632,7 @@ internal_current4(isc_interfaceiter_t *iter) {
        prefixlen = lifreq.lifr_addrlen;
 #else
        isc_netaddr_format(&iter->current.address, sabuf, sizeof(sabuf));
-       isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL,
-                     ISC_LOGMODULE_INTERFACE,
-                     ISC_LOG_INFO,
+       UNEXPECTED_ERROR(__FILE__, __LINE__,
                      isc_msgcat_get(isc_msgcat,
                                     ISC_MSGSET_IFITERIOCTL,
                                     ISC_MSG_GETIFCONFIG,
@@ -781,7 +766,6 @@ internal_current6(isc_interfaceiter_t *iter) {
        INSIST(sizeof(lifreq.lifr_name) <= sizeof(iter->current.name));
        memset(iter->current.name, 0, sizeof(iter->current.name));
        memcpy(iter->current.name, lifreq.lifr_name, sizeof(lifreq.lifr_name));
-       iter->current.ifindex = lifreq.lifr_index;      /* Save the if index */
 
        get_addr(family, &iter->current.address,
                 (struct sockaddr *)&lifreq.lifr_addr, lifreq.lifr_name);
index a2916abd13bbc4484e6e198e5d8006654331cc23..bee63c52813fd2be473700ef2e363d2b4efbc023 100644 (file)
@@ -170,7 +170,6 @@ internal_current(isc_interfaceiter_t *iter) {
 
                memset(iter->current.name, 0, sizeof(iter->current.name));
                memcpy(iter->current.name, sdl->sdl_data, namelen);
-               iter->current.ifindex = sdl->sdl_index; /* Save the if index */
 
                iter->current.flags = 0;