]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
- Unknown hardware types generate warning instead of error.
authorTed Lemon <source@isc.org>
Fri, 26 Mar 1999 16:43:02 +0000 (16:43 +0000)
committerTed Lemon <source@isc.org>
Fri, 26 Mar 1999 16:43:02 +0000 (16:43 +0000)
- Test for broadcast interfaces instead of not IFF_LOOPBACK.
- Use HAVE_* instead of depending on system headers definitions,
  because some systems may use enums instead.

common/dispatch.c

index becf4dacf61a291422fd83e94de9e37b72b6f805..24505d9ab0e27c6de506cfe724613856a9c1aa16 100644 (file)
@@ -42,7 +42,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: dispatch.c,v 1.47.2.12 1999/02/23 17:37:00 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium.  All rights reserved.\n";
+"$Id: dispatch.c,v 1.47.2.13 1999/03/26 16:43:02 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -139,10 +139,7 @@ void discover_interfaces (state)
                /* Skip loopback, point-to-point and down interfaces,
                   except don't skip down interfaces if we're trying to
                   get a list of configurable interfaces. */
-               if ((ifr.ifr_flags & IFF_LOOPBACK) ||
-#ifdef HAVE_IFF_POINTOPOINT
-                   (ifr.ifr_flags & IFF_POINTOPOINT) ||
-#endif
+               if (!(ifr.ifr_flags & IFF_BROADCAST) ||
                    (!(ifr.ifr_flags & IFF_UP) &&
                     state != DISCOVER_UNCONFIGURED))
                        continue;
@@ -356,6 +353,9 @@ void discover_interfaces (state)
                      case ARPHRD_TUNNEL:
                        /* ignore tunnel interfaces. */
 #endif
+#ifdef HAVE_ARPHRD_ROSE
+                     case ARPHRD_ROSE:
+#endif
 #ifdef HAVE_ARPHRD_LOOPBACK
                      case ARPHRD_LOOPBACK:
                        /* ignore loopback interface */
@@ -368,7 +368,7 @@ void discover_interfaces (state)
                        memcpy (tmp -> hw_address.haddr, sa.sa_data, 6);
                        break;
 
-#ifndef ARPHRD_IEEE802
+#ifndef HAVE_ARPHRD_IEEE802
 # define ARPHRD_IEEE802 HTYPE_IEEE802
 #endif
                      case ARPHRD_IEEE802:
@@ -377,7 +377,7 @@ void discover_interfaces (state)
                        memcpy (tmp -> hw_address.haddr, sa.sa_data, 6);
                        break;
 
-#ifndef ARPHRD_FDDI
+#ifndef HAVE_ARPHRD_FDDI
 # define ARPHRD_FDDI HTYPE_FDDI
 #endif
                      case ARPHRD_FDDI:
@@ -394,9 +394,26 @@ void discover_interfaces (state)
                        break;
 #endif
 
+#ifdef HAVE_ARPHRD_AX25
+                     case ARPHRD_AX25:
+                       tmp -> hw_address.hlen = 6;
+                       tmp -> hw_address.htype = ARPHRD_AX25;
+                       memcpy (tmp -> hw_address.haddr, sa.sa_data, 6);
+                       break;
+#endif
+
+#ifdef HAVE_ARPHRD_NETROM
+                     case ARPHRD_NETROM:
+                       tmp -> hw_address.hlen = 6;
+                       tmp -> hw_address.htype = ARPHRD_NETROM;
+                       memcpy (tmp -> hw_address.haddr, sa.sa_data, 6);
+                       break;
+#endif
+
                      default:
-                       error ("%s: unknown hardware address type %d",
+                       warn ("%s: unknown hardware address type %d",
                               ifr.ifr_name, sa.sa_family);
+                       break;
                }
        }
 #endif /* defined (HAVE_SIOCGIFHWADDR) && !defined (HAVE_AF_LINK) */