#ifndef lint
static char copyright[] =
-"$Id: dispatch.c,v 1.47.2.10 1999/02/13 19:17:03 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
+"$Id: dispatch.c,v 1.47.2.11 1999/02/19 18:17:33 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
except don't skip down interfaces if we're trying to
get a list of configurable interfaces. */
if ((ifr.ifr_flags & IFF_LOOPBACK) ||
-#ifdef IFF_POINTOPOINT
+#ifdef HAVE_IFF_POINTOPOINT
(ifr.ifr_flags & IFF_POINTOPOINT) ||
#endif
(!(ifr.ifr_flags & IFF_UP) &&
/* If we have the capability, extract link information
and record it in a linked list. */
-#ifdef AF_LINK
+#ifdef HAVE_AF_LINK
if (ifp -> ifr_addr.sa_family == AF_LINK) {
struct sockaddr_dl *foo = ((struct sockaddr_dl *)
(&ifp -> ifr_addr));
/* Now cycle through all the interfaces we found, looking for
hardware addresses. */
-#if defined (SIOCGIFHWADDR) && !defined (AF_LINK)
+#if defined (HAVE_SIOCGIFHWADDR) && !defined (HAVE_AF_LINK)
for (tmp = interfaces; tmp; tmp = tmp -> next) {
struct ifreq ifr;
struct sockaddr sa;
sa = *(struct sockaddr *)&ifr.ifr_hwaddr;
switch (sa.sa_family) {
-#ifdef ARPHRD_LOOPBACK
+#ifdef HAVE_ARPHRD_TUNNEL
+ case ARPHRD_TUNNEL:
+ /* ignore tunnel interfaces. */
+#endif
+#ifdef HAVE_ARPHRD_LOOPBACK
case ARPHRD_LOOPBACK:
/* ignore loopback interface */
break;
memcpy (tmp -> hw_address.haddr, sa.sa_data, 16);
break;
-#ifdef ARPHRD_METRICOM
+#ifdef HAVE_ARPHRD_METRICOM
case ARPHRD_METRICOM:
tmp -> hw_address.hlen = 6;
tmp -> hw_address.htype = ARPHRD_METRICOM;
ifr.ifr_name, sa.sa_family);
}
}
-#endif /* defined (SIOCGIFHWADDR) && !defined (AF_LINK) */
+#endif /* defined (HAVE_SIOCGIFHWADDR) && !defined (HAVE_AF_LINK) */
/* If we're just trying to get a list of interfaces that we might
be able to configure, we can quit now. */
#ifndef lint
static char copyright[] =
-"$Id: socket.c,v 1.26.2.7 1999/02/13 19:20:07 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
+"$Id: socket.c,v 1.26.2.8 1999/02/19 18:17:34 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
int sock;
int flag;
-#if !defined (SO_BINDTODEVICE) && !defined (USE_FALLBACK)
+#if !defined (HAVE_SO_BINDTODEVICE) && !defined (USE_FALLBACK)
/* Make sure only one interface is registered. */
if (once)
error ("The standard socket API can only support %s",
if (bind (sock, (struct sockaddr *)&name, sizeof name) < 0)
error ("Can't bind to dhcp address: %m");
-#if defined (SO_BINDTODEVICE)
+#if defined (HAVE_SO_BINDTODEVICE)
/* Bind this socket to this interface. */
if (info -> ifp &&
setsockopt (sock, SOL_SOCKET, SO_BINDTODEVICE,
# define USE_LPF
# define LINUX_SLASHPROC_DISCOVERY
# define PROCDEV_DEVICE "/proc/net/dev"
+# define HAVE_ARPHRD_TUNNEL
# else
# define USE_SOCKETS
# define IGNORE_HOSTUNREACH
#define ALIAS_NAMES_PERMUTED
#define SKIP_DUMMY_INTERFACES
+#define HAVE_ARPHRD_METRICOM
+#define HAVE_ARPHRD_IEEE802
+#define HAVE_ARPHRD_LOOPBACK
+#define HAVE_SO_BINDTODEVICE
+#define HAVE_SIOCGIFHWADDR
#ifndef BPF_FORMAT
# define BPF_FORMAT "/dev/bpf%d"
#endif
+
+#if defined (IFF_POINTOPOINT) && !defined (HAVE_IFF_POINTOPOINT)
+# define HAVE_IFF_POINTOPOINT
+#endif
+
+#if defined (AF_LINK) && !defined (HAVE_AF_LINK)
+# define HAVE_AF_LINK
+#endif
+
+#if defined (ARPHRD_TUNNEL) && !defined (HAVE_ARPHRD_TUNNEL)
+# define HAVE_ARPHRD_TUNNEL
+#endif
+
+#if defined (ARPHRD_LOOPBACK) && !defined (HAVE_ARPHRD_LOOPBACK)
+# define HAVE_ARPHRD_LOOPBACK
+#endif
+
+#if defined (ARPHRD_METRICOM) && !defined (HAVE_ARPHRD_METRICOM)
+# define HAVE_ARPHRD_METRICOM
+#endif
+
+#if defined (SO_BINDTODEVICE) && !defined (HAVE_SO_BINDTODEVICE)
+# define HAVE_SO_BINDTODEVICE
+#endif
+
+#if defined (SIOCGIFHWADDR) && !defined (HAVE_SIOCGIFHWADDR)
+# define HAVE_SIOCGIFHWADDR
+#endif
+
+#if defined (AF_LINK) && !defined (HAVE_AF_LINK)
+# define HAVE_AF_LINK
+#endif
+