Index: DHCP/RELNOTES diff -u DHCP/RELNOTES:1.462 DHCP/RELNOTES:1.462.4.2 --- DHCP/RELNOTES:1.462 Thu Feb 16 22:07:04 2012 +++ DHCP/RELNOTES Tue Feb 28 15:44:01 2012 @@ -49,6 +49,14 @@ to perform an fsync() operation on the lease database before reply, which improves performance. [ISC-Bugs #22228] +*** mergeme +- A problem with missing get_hw_addr function when --enable-use-sockets + was used is now solved on GNU/Linux, BSD and GNU/Hurd systems. Note + that use-sockets feature was not tested on those systems. Client and + server code no longer use MAX_PATH constant that is not defined on + GNU/Hurd systems. [ISC-Bugs 25979] +*** mergeme + Changes since 4.2.3 ! Add a check for a null pointer before calling the regexec function. Index: DHCP/client/dhclient.c diff -u DHCP/client/dhclient.c:1.185 DHCP/client/dhclient.c:1.185.4.1 --- DHCP/client/dhclient.c:1.185 Fri Feb 3 22:47:42 2012 +++ DHCP/client/dhclient.c Tue Feb 28 15:44:01 2012 @@ -374,21 +374,17 @@ * to be reopened after chdir() has been called */ if (path_dhclient_db[0] != '/') { - char *path = dmalloc(PATH_MAX, MDL); - if (path == NULL) - log_fatal("No memory for filename\n"); - path_dhclient_db = realpath(path_dhclient_db, path); + const char *old_path = path_dhclient_db; + path_dhclient_db = realpath(path_dhclient_db, NULL); if (path_dhclient_db == NULL) - log_fatal("%s: %s", path, strerror(errno)); + log_fatal("Failed to get realpath for %s: %s", old_path, strerror(errno)); } if (path_dhclient_script[0] != '/') { - char *path = dmalloc(PATH_MAX, MDL); - if (path == NULL) - log_fatal("No memory for filename\n"); - path_dhclient_script = realpath(path_dhclient_script, path); + const char *old_path = path_dhclient_script; + path_dhclient_script = realpath(path_dhclient_script, NULL); if (path_dhclient_script == NULL) - log_fatal("%s: %s", path, strerror(errno)); + log_fatal("Failed to get realpath for %s: %s", old_path, strerror(errno)); } /* Index: DHCP/common/bpf.c diff -u DHCP/common/bpf.c:1.62 DHCP/common/bpf.c:1.62.202.1 --- DHCP/common/bpf.c:1.62 Tue Nov 24 02:06:56 2009 +++ DHCP/common/bpf.c Tue Feb 28 15:15:18 2012 @@ -550,7 +550,9 @@ interface_dereference (&fbi, MDL); } } +#endif +#if defined(USE_BPF_RECEIVE) || defined(USE_BPF_HWADDR) void get_hw_addr(const char *name, struct hardware *hw) { struct ifaddrs *ifa; Index: DHCP/common/lpf.c diff -u DHCP/common/lpf.c:1.41 DHCP/common/lpf.c:1.41.64.1 --- DHCP/common/lpf.c:1.41 Tue May 10 14:27:56 2011 +++ DHCP/common/lpf.c Tue Feb 28 15:15:18 2012 @@ -28,7 +28,6 @@ #include "dhcpd.h" #if defined (USE_LPF_SEND) || defined (USE_LPF_RECEIVE) -#include #include #include @@ -40,8 +39,14 @@ #include "includes/netinet/ip.h" #include "includes/netinet/udp.h" #include "includes/netinet/if_ether.h" +#endif + +#if defined (USE_LPF_RECEIVE) || defined (USE_LPF_HWADDR) +#include #include +#endif +#if defined (USE_LPF_SEND) || defined (USE_LPF_RECEIVE) /* Reinitializes the specified interface after an address change. This is not required for packet-filter APIs. */ @@ -417,7 +422,9 @@ interface_dereference (&fbi, MDL); } } +#endif +#if defined (USE_LPF_RECEIVE) || defined (USE_LPF_HWADDR) void get_hw_addr(const char *name, struct hardware *hw) { int sock; Index: DHCP/includes/osdep.h diff -u DHCP/includes/osdep.h:1.44 DHCP/includes/osdep.h:1.44.122.1 --- DHCP/includes/osdep.h:1.44 Thu Sep 9 22:18:02 2010 +++ DHCP/includes/osdep.h Tue Feb 28 15:15:16 2012 @@ -108,6 +108,10 @@ # define USE_SOCKET_RECEIVE # if defined(HAVE_DLPI) # define USE_DLPI_HWADDR +# elif defined(HAVE_LPF) +# define USE_LPF_HWADDR +# elif defined(HAVE_BPF) +# define USE_BPF_HWADDR # endif #endif Index: DHCP/server/dhcpd.c diff -u DHCP/server/dhcpd.c:1.158 DHCP/server/dhcpd.c:1.158.76.1 --- DHCP/server/dhcpd.c:1.158 Thu Apr 21 13:24:24 2011 +++ DHCP/server/dhcpd.c Tue Feb 28 15:44:01 2012 @@ -464,12 +464,11 @@ * to be reopened after chdir() has been called */ if (path_dhcpd_db[0] != '/') { - char *path = dmalloc(PATH_MAX, MDL); - if (path == NULL) - log_fatal("No memory for filename\n"); - path_dhcpd_db = realpath(path_dhcpd_db, path); + const char *path = path_dhcpd_db; + path_dhcpd_db = realpath(path_dhcpd_db, NULL); if (path_dhcpd_db == NULL) - log_fatal("%s: %s", path, strerror(errno)); + log_fatal("Failed to get realpath for %s: %s", path, + strerror(errno)); } if (!quiet) {