]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
- Compilation on Solaris with USE_SOCKETS defined in includes/site.h has
authorDavid Hankins <dhankins@isc.org>
Thu, 30 Apr 2009 18:42:52 +0000 (18:42 +0000)
committerDavid Hankins <dhankins@isc.org>
Thu, 30 Apr 2009 18:42:52 +0000 (18:42 +0000)
  been repaired.  Other USE_ overrides should work better. [ISC-Bugs #19434]

- A check for the local flavor of IFNAMSIZ had a broken 'else' condition,
  that probably still resulted in the correct behaviour (but wouldn't use
  a larger defined value provided by the host OS). [ISC-Bugs #19434]

RELNOTES
common/discover.c
common/dlpi.c
configure.ac
includes/dhcpd.h
includes/osdep.h
includes/site.h

index 1f1d39a4dfaa12296650896952230df5a561ad1e..118ad8e35134b3f7ee2415cc19462b8cda600cba 100644 (file)
--- a/RELNOTES
+++ b/RELNOTES
@@ -120,6 +120,13 @@ work on other platforms. Please report any problems and suggested fixes to
 - Fixed failover reconnection retry code to continue to retry to reconnect
   rather than restarting the listener.
 
+- Compilation on Solaris with USE_SOCKETS defined in includes/site.h has
+  been repaired.  Other USE_ overrides should work better.
+
+- A check for the local flavor of IFNAMSIZ had a broken 'else' condition,
+  that probably still resulted in the correct behaviour (but wouldn't use
+  a larger defined value provided by the host OS).
+
                        Changes since 4.1.0b1
 
 - A missing "else" in dhcrelay.c could have caused an interface not to
index f2df447ae57fd6efa99b332e21bb874cd681ac53..77a4e7a915efbac76d5030dd34b109a3e69d2e33 100644 (file)
@@ -184,7 +184,7 @@ isc_result_t interface_initialize (omapi_object_t *ipo,
 #ifndef IF_NAMESIZE
 # if defined(LIFNAMSIZ)
 #  define IF_NAMESIZE  LIFNAMSIZ
-# elseif defined(IFNAMSIZ)
+# elif defined(IFNAMSIZ)
 #  define IF_NAMESIZE  IFNAMSIZ
 # else
 #  define IF_NAMESIZE  16
index 56f6b3a9b1c6edae9dc75b922f227cf414944dcd..4d2f77344621e7b97a768289c4a31354fb542ef5 100644 (file)
@@ -87,7 +87,8 @@
 
 #include "dhcpd.h"
 
-#if defined (USE_DLPI_SEND) || defined (USE_DLPI_RECEIVE)
+#if defined (USE_DLPI_SEND) || defined (USE_DLPI_RECEIVE) || \
+    defined(USE_DLPI_HWADDR)
 
 # include <sys/ioctl.h>
 # include <sys/time.h>
@@ -149,6 +150,10 @@ static int dlpiokack PROTO ((int fd, char *bufp));
 static int dlpiinfoack PROTO ((int fd, char *bufp));
 static int dlpiphysaddrack PROTO ((int fd, char *bufp));
 static int dlpibindack PROTO ((int fd, char *bufp));
+#if defined(USE_DLPI_SEND) || defined(USE_DLPI_RECEIVE)
+/* These functions are not used if we're only sourcing the get_hw_addr()
+ * function (for USE_SOCKETS).
+ */
 static int dlpiunitdatareq PROTO ((int fd, unsigned char *addr,
                                   int addrlen, unsigned long minpri,
                                   unsigned long maxpri, unsigned char *data,
@@ -161,7 +166,7 @@ static int dlpiunitdataind PROTO ((int fd,
                                   unsigned long *grpaddr,
                                   unsigned char *data,
                                   int datalen));
-
+#endif /* !USE_DLPI_HWADDR: USE_DLPI_SEND || USE_DLPI_RECEIVE */
 static int     expected PROTO ((unsigned long prim, union DL_primitives *dlp,
                                  int msgflags));
 static int     strgetmsg PROTO ((int fd, struct strbuf *ctlp,
@@ -1090,6 +1095,7 @@ int dlpiphysaddrack (fd, bufp)
        return 0;
 }
 
+#if defined(USE_DLPI_SEND) || defined(USE_DLPI_RECEIVE)
 int dlpiunitdatareq (fd, addr, addrlen, minpri, maxpri, dbuf, dbuflen)
        int fd;
        unsigned char *addr;
@@ -1207,6 +1213,7 @@ static int dlpiunitdataind (fd, daddr, daddrlen,
 
        return data.len;
 }
+#endif /* !USE_DLPI_HWADDR: USE_DLPI_RECEIVE || USE_DLPI_SEND */
 
 /*
  * expected - see if we got what we wanted.
@@ -1298,6 +1305,7 @@ static int strgetmsg (fd, ctlp, datap, flagsp, caller)
        return 0;
 }
 
+#if defined(USE_DLPI_SEND)
 int can_unicast_without_arp (ip)
        struct interface_info *ip;
 {
@@ -1331,6 +1339,7 @@ void maybe_setup_fallback ()
                interface_dereference (&fbi, MDL);
        }
 }
+#endif /* USE_DLPI_SEND */
 
 void 
 get_hw_addr(const char *name, struct hardware *hw) {
@@ -1414,4 +1423,4 @@ get_hw_addr(const char *name, struct hardware *hw) {
 
        close(sock);
 }
-#endif /* USE_DLPI */
+#endif /* USE_DLPI_SEND || USE_DLPI_RECEIVE || USE_DLPI_HWADDR */
index 8fcfde374574251257e69df2de5619017b5d9d33..e62c689bf9252068fb96699ed5f3d390436f72a4 100644 (file)
@@ -332,24 +332,23 @@ AC_CHECK_HEADER(linux/filter.h, DO_LPF=1, ,
 ])
 if test -n "$DO_LPF"
 then
-       AC_DEFINE([USE_LPF], [1], 
+       AC_DEFINE([HAVE_LPF], [1], 
                  [Define to 1 to use the Linux Packet Filter interface code.])
 else
        AC_CHECK_HEADER(sys/dlpi.h, DO_DLPI=1)
        if test -n "$DO_DLPI"
        then
-               AC_DEFINE([USE_DLPI], [1], 
+               AC_DEFINE([HAVE_DLPI], [1], 
                          [Define to 1 to use DLPI interface code.])
        else
                AC_CHECK_HEADER(net/bpf.h, DO_BPF=1)
                if test -n "$DO_BPF"
                then
-                       AC_DEFINE([USE_BPF], [""],
+                       AC_DEFINE([HAVE_BPF], [""],
                                  [Define to 1 to use the 
                                   Berkeley Packet Filter interface code.])
                fi
        fi
-
 fi
 
 # SIOCGLIFCONF uses some transport structures.  Trick is not all platforms
index d020b5fcf9a68cefa7c584f1ef4724bb2c1a02a1..22db8aeaf2aa6486d266c0a15ab35d9616813a73 100644 (file)
@@ -1152,7 +1152,8 @@ struct interface_info {
 
        /* Only used by DHCP client code. */
        struct client_state *client;
-# if defined (USE_DLPI_SEND) || defined (USE_DLPI_RECEIVE)
+# if defined(USE_DLPI_SEND) || defined(USE_DLPI_RECEIVE) || \
+     defined(USE_DLPI_HWADDR)
        int dlpi_sap_length;
        struct hardware dlpi_broadcast_addr;
 # endif /* DLPI_SEND || DLPI_RECEIVE */
index 4f0d95acd9feef514301eee89f935bab7bb18e8f..340ae1e10f3aeb11879624d3177ea58a4120d495 100644 (file)
@@ -83,7 +83,14 @@ typedef uint32_t u_int32_t;
     !defined (USE_NIT_RECEIVE) && \
     !defined (USE_DLPI_SEND) && \
     !defined (USE_DLPI_RECEIVE)
-#  define USE_DEFAULT_NETWORK
+/* Determine default socket API to USE. */
+# if defined(HAVE_BPF)
+#  define USE_BPF 1
+# elif defined(HAVE_LPF)
+#  define USE_LPF 1
+# elif defined(HAVE_DLPI)
+#  define USE_DLPI 1
+# endif
 #endif
 
 #if !defined (TIME_MAX)
@@ -107,6 +114,9 @@ typedef uint32_t u_int32_t;
 #ifdef USE_SOCKETS
 #  define USE_SOCKET_SEND
 #  define USE_SOCKET_RECEIVE
+#  if defined(HAVE_DLPI)
+#    define USE_DLPI_HWADDR
+#  endif
 #endif
 
 #ifdef USE_RAW_SOCKETS
index 651a98c2c688615e73445db26457f4a6733e752c..c77947d5de78035140fafdf8a574ad01ac38ac51 100644 (file)
    you don't choose, one will be chosen for you in your system's config
    header.    DON'T MESS WITH THIS UNLESS YOU KNOW WHAT YOU'RE DOING!!! */
 
-/* Define this to use the standard BSD socket API.
+/* Define USE_SOCKETS to use the standard BSD socket API.
 
    On many systems, the BSD socket API does not provide the ability to
    send packets to the 255.255.255.255 broadcast address, which can