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 --- a/client/dhclient.c 3 Feb 2012 22:47:42 -0000 1.185 +++ b/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 --- a/common/bpf.c 24 Nov 2009 02:06:56 -0000 1.62 +++ b/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 --- a/common/lpf.c 10 May 2011 14:27:56 -0000 1.41 +++ b/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 #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: 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 --- a/includes/osdep.h 9 Sep 2010 22:18:02 -0000 1.44 +++ b/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) || defined (__GNU__) +# 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 --- a/server/dhcpd.c 21 Apr 2011 13:24:24 -0000 1.158 +++ b/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) {