]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
Fixes for older platforms not returning the interface index and not supporting IPv6
authorDanny Mayer <mayer@ntp.org>
Sun, 30 Nov 2003 02:24:54 +0000 (21:24 -0500)
committerDanny Mayer <mayer@ntp.org>
Sun, 30 Nov 2003 02:24:54 +0000 (21:24 -0500)
bk: 3fc954f6KOgal2sSOx3VcFLdJfbuNQ

libisc/ifiter_ioctl.c
libisc/interfaceiter.c

index 3b724e64bcb6993a2a0599133360f2381067eb3f..711e493a67677c0d834c716bda870924f6b1278a 100644 (file)
@@ -401,7 +401,16 @@ internal_current4(isc_interfaceiter_t *iter) {
        INSIST(sizeof(ifreq.ifr_name) <= sizeof(iter->current.name));
        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);
index f4576aa83630940793bd36f5955ad3cd63f3485c..37eff74065944a232ee89ba696e6711a6d19518a 100644 (file)
@@ -78,6 +78,7 @@ get_addr(unsigned int family, isc_netaddr_t *dst, struct sockaddr *src) {
        }
 }
 
+#ifdef ISC_PLATFORM_HAVEIPV6
 /*
  * Get the scope id here for multicasting purposes
  * For the KAME stack we need to play games to get the scope.
@@ -109,6 +110,7 @@ get_scopeid(unsigned int family, struct sockaddr *src) {
        }
        return (0);
 }
+#endif
 /*
  * Include system-dependent code.
  */