# define IF_NAMESIZE 16
# endif
#endif
+#elif !defined(__linux) && !defined(HAVE_IFADDRS_H)
+# define SIOCGLIFCONF SIOCGIFCONF
+# define SIOCGLIFFLAGS SIOCGIFFLAGS
+# define LIFREQ ifreq
+# define LIFCONF ifconf
+# define lifr_name ifr_name
+# define lifr_addr ifr_addr
+# define lifr_flags ifr_flags
+# define lifc_len ifc_len
+# define lifc_buf ifc_buf
+# define lifc_req ifc_req
+#ifdef _AIX
+# define ss_family __ss_family
+#endif
+#endif
+#if defined(SIOCGLIFCONF) && defined(SIOCGLIFFLAGS)
/*
* Solaris support
* ---------------
#ifdef ISC_PLATFORM_HAVELIFNUM
lifnum.lifn_family = AF_UNSPEC;
#endif
+#ifdef SIOCGLIFNUM
if (ioctl(ifaces->sock, SIOCGLIFNUM, &lifnum) < 0) {
log_error("Error finding total number of interfaces; %m");
close(ifaces->sock);
#else
ifaces->num = lifnum;
#endif
+#else
+ ifaces->num = 64;
+#endif /* SIOCGLIFNUM */
memset(&ifaces->conf, 0, sizeof(ifaces->conf));
#ifdef ISC_HAVE_LIFC_FAMILY
return 0;
}
strcpy(info->name, p->lifr_name);
- info->addr = p->lifr_addr;
+ memset(&info->addr, 0, sizeof(info->addr));
+ memcpy(&info->addr, &p->lifr_addr, sizeof(p->lifr_addr));
#if defined(sun) || defined(__linux)
/* interface aliases look like "eth0:1" or "wlan1:3" */
ifaces->fp6 = NULL;
#endif
}
-#else /* !HAVE_SIOCGLIFCONF, !__linux */
+#else
/*
* BSD support
AC_DEFINE_UNQUOTED([_PATH_DHCRELAY_PID], ["$withval"],
[File for dhcrelay process information.]))
+# see if ifaddrs.h is available
+AC_CHECK_HEADERS(ifaddrs.h)
+
# figure out what IPv4 interface code to use
AC_CHECK_HEADERS(linux/types.h) # needed for linux/filter.h on old systems
#include <time.h>
#include <net/if.h>
+#undef FDDI
#include <net/route.h>
#include <net/if_arp.h>
#if HAVE_NET_IF_DL_H
* @(#)if_ether.h 8.1 (Berkeley) 6/10/93
*/
+#ifndef netinet_if_ether_h
+#define netinet_if_ether_h
+
/*
* Ethernet address - 6 octets
* this is only used by the ethers(3) functions.
#define ETHERTYPE_ARP 0x0806 /* address resolution protocol */
#define ETHER_HEADER_SIZE (ETHER_ADDR_LEN * 2 + sizeof (u_int16_t))
+
+#endif
#if !defined (SOCKLEN_T)
# define SOCKLEN_T socklen_t
+#elif defined(_AIX)
+#undef SOCKLEN_T
+#define SOCKLEN_T socklen_t
#endif
#if !defined (STDERR_FILENO)
#if defined(LIBC_SCCS) && !defined(lint)
static const char sccsid[] = "@(#)res_send.c 8.1 (Berkeley) 6/4/93";
-static const char rcsid[] = "$Id: res_send.c,v 1.10 2008/01/21 22:49:46 dhankins Exp $";
+static const char rcsid[] = "$Id: res_send.c,v 1.11 2008/01/23 22:49:54 marka Exp $";
#endif /* LIBC_SCCS and not lint */
/*
int trace_mr_select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
unsigned int trace_mr_res_randomid(unsigned int);
+#undef send
#define send trace_mr_send
+#undef recvfrom
#define recvfrom trace_mr_recvfrom
+#undef read
#define read trace_mr_read
+#undef connect
#define connect trace_mr_connect
+#undef socket
#define socket trace_mr_socket
+#undef bind
#define bind trace_mr_bind
+#undef close
#define close trace_mr_close
+#undef select
#define select trace_mr_select
+#undef time
#define time trace_mr_time
#define CHECK_SRVR_ADDR