On Fri May 11 02:28:09 2012, sthiba...@debian.org wrote: > Any news on this? We really need to get some patch integrated in > Debian, either the one we proposed, as an interim, or something from > upstream, or something else? I'm sorry, but due to resource limitations, we were unable to include fix for realpath and use-sockets in upcoming 4.2.4. However, we were able to update the patch to a version that is almost ready for merge.
Please find our internal patch attached. That is *not* an official ISC patch. It did not go through our normal testing process. Feel free to use it, though. Tomek Mrugalski ISC DHCP Engineer
? hurd.patch Index: RELNOTES =================================================================== RCS file: /proj/cvs/prod/DHCP/RELNOTES,v retrieving revision 1.462 retrieving revision 1.462.4.2 diff -u -r1.462 -r1.462.4.2 --- RELNOTES 16 Feb 2012 22:07:04 -0000 1.462 +++ RELNOTES 28 Feb 2012 15:44:01 -0000 1.462.4.2 @@ -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: client/dhclient.c =================================================================== RCS file: /proj/cvs/prod/DHCP/client/dhclient.c,v retrieving revision 1.185 retrieving revision 1.185.4.1 diff -u -r1.185 -r1.185.4.1 --- client/dhclient.c 3 Feb 2012 22:47:42 -0000 1.185 +++ client/dhclient.c 28 Feb 2012 15:44:01 -0000 1.185.4.1 @@ -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: common/bpf.c =================================================================== RCS file: /proj/cvs/prod/DHCP/common/bpf.c,v retrieving revision 1.62 retrieving revision 1.62.202.1 diff -u -r1.62 -r1.62.202.1 --- common/bpf.c 24 Nov 2009 02:06:56 -0000 1.62 +++ common/bpf.c 28 Feb 2012 15:15:18 -0000 1.62.202.1 @@ -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: common/lpf.c =================================================================== RCS file: /proj/cvs/prod/DHCP/common/lpf.c,v retrieving revision 1.41 retrieving revision 1.41.64.1 diff -u -r1.41 -r1.41.64.1 --- common/lpf.c 10 May 2011 14:27:56 -0000 1.41 +++ common/lpf.c 28 Feb 2012 15:15:18 -0000 1.41.64.1 @@ -28,7 +28,6 @@ #include "dhcpd.h" #if defined (USE_LPF_SEND) || defined (USE_LPF_RECEIVE) -#include <sys/ioctl.h> #include <sys/uio.h> #include <errno.h> @@ -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 <sys/ioctl.h> #include <net/if.h> +#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: includes/osdep.h =================================================================== RCS file: /proj/cvs/prod/DHCP/includes/osdep.h,v retrieving revision 1.44 retrieving revision 1.44.122.1 diff -u -r1.44 -r1.44.122.1 --- includes/osdep.h 9 Sep 2010 22:18:02 -0000 1.44 +++ includes/osdep.h 28 Feb 2012 15:15:16 -0000 1.44.122.1 @@ -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: server/dhcpd.c =================================================================== RCS file: /proj/cvs/prod/DHCP/server/dhcpd.c,v retrieving revision 1.158 retrieving revision 1.158.76.1 diff -u -r1.158 -r1.158.76.1 --- server/dhcpd.c 21 Apr 2011 13:24:24 -0000 1.158 +++ server/dhcpd.c 28 Feb 2012 15:44:01 -0000 1.158.76.1 @@ -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) {