[pkg-dhcp-devel] Bug#747017: isc-dhcp: Please upload hurd fixes to unstable
Gabriele Giacone
1o5g4r8o at gmail.com
Sun May 4 19:15:47 UTC 2014
Source: isc-dhcp
Severity: important
Tags: patch d-i
User: debian-hurd at lists.debian.org
Usertags: hurd
Dear Maintainer,
isc-dhcp 4.3.0a1-2.1 uploaded to experimental via NMU fixed FTBFS on
hurd-i386. See #616290.
Getting such fixes in unstable is necessary to resolve debian-installer
FTBFS in unstable and consequently to generate official installation
media.
Upstream released 4.3.0 a couple of months ago.
I see two options:
1) uploading 4.3.0a1-2.1 or 4.3.0 to unstable.
2) if you follow upstream by uploading Current-Stable releases (4.2.x)
to unstable and Current releases (4.3.x) to experimental, fixes need to
be backported to 4.2.4. Attached debdiff.
Both 1) and 2) changes are available respectively in experimental and
master branches at
http://anonscm.debian.org/gitweb/?p=users/gg0-guest/isc-dhcp.git
Thanks for considering,
--
G..e
-------------- next part --------------
diff -Nru isc-dhcp-4.2.4/debian/bind-patches/hurd isc-dhcp-4.2.4/debian/bind-patches/hurd
--- isc-dhcp-4.2.4/debian/bind-patches/hurd 1970-01-01 01:00:00.000000000 +0100
+++ isc-dhcp-4.2.4/debian/bind-patches/hurd 2014-05-04 17:47:18.000000000 +0200
@@ -0,0 +1,34 @@
+--- a/configure.in 2011-12-04 23:21:32.000000000 +0100
++++ b/configure.in 2011-12-04 23:21:35.000000000 +0100
+@@ -263,7 +263,7 @@
+ # as it breaks how the two halves (Basic and Advanced) of the IPv6
+ # Socket API were designed to be used but we have to live with it.
+ # Define _GNU_SOURCE to pull in the IPv6 Advanced Socket API.
+- *-linux* | *-kfreebsd*-gnu)
++ *-linux* | *-kfreebsd*-gnu | *-gnu*)
+ STD_CDEFINES="$STD_CDEFINES -D_GNU_SOURCE"
+ CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
+ ;;
+--- a/configure 2011-12-04 23:25:28.000000000 +0100
++++ b/configure 2011-12-04 23:25:32.000000000 +0100
+@@ -11807,7 +11807,7 @@
+ # as it breaks how the two halves (Basic and Advanced) of the IPv6
+ # Socket API were designed to be used but we have to live with it.
+ # Define _GNU_SOURCE to pull in the IPv6 Advanced Socket API.
+- *-linux* | *-kfreebsd*-gnu)
++ *-linux* | *-kfreebsd*-gnu | *-gnu*)
+ STD_CDEFINES="$STD_CDEFINES -D_GNU_SOURCE"
+ CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
+ ;;
+--- a/lib/isc/unix/net.c 2011-12-04 23:44:51.000000000 +0100
++++ b/lib/isc/unix/net.c 2011-12-04 23:44:59.000000000 +0100
+@@ -130,6 +130,9 @@
+ #ifdef EAFNOSUPPORT
+ case EAFNOSUPPORT:
+ #endif
++#ifdef EPFNOSUPPORT
++ case EPFNOSUPPORT:
++#endif
+ #ifdef EPROTONOSUPPORT
+ case EPROTONOSUPPORT:
+ #endif
diff -Nru isc-dhcp-4.2.4/debian/bind-patches/series isc-dhcp-4.2.4/debian/bind-patches/series
--- isc-dhcp-4.2.4/debian/bind-patches/series 2013-05-27 22:26:49.000000000 +0200
+++ isc-dhcp-4.2.4/debian/bind-patches/series 2014-05-04 17:50:34.000000000 +0200
@@ -1 +1,2 @@
cve-2013-2494.patch
+hurd
diff -Nru isc-dhcp-4.2.4/debian/changelog isc-dhcp-4.2.4/debian/changelog
--- isc-dhcp-4.2.4/debian/changelog 2013-05-27 22:53:45.000000000 +0200
+++ isc-dhcp-4.2.4/debian/changelog 2014-05-04 19:38:25.000000000 +0200
@@ -1,3 +1,13 @@
+isc-dhcp (4.2.4-8) UNRELEASED; urgency=medium
+
+ * Fix FTBFS on Hurd.
+ + Add isc-dhcp and bind patches already applied upstream.
+ + Pass --enable-use-sockets and DO_LPF variable to configure.
+ + Add dhclient-script.hurd, dhclient-script.hurd.udeb and
+ debian/rfc3442-classless-routes.hurd scripts.
+
+ -- Gabriele Giacone <1o5g4r8o at gmail.com> Sun, 04 May 2014 18:22:35 +0200
+
isc-dhcp (4.2.4-7) unstable; urgency=low
* Set --with-ldapcrypto to restore openssl support (closes: #692808).
diff -Nru isc-dhcp-4.2.4/debian/dhclient-script.hurd isc-dhcp-4.2.4/debian/dhclient-script.hurd
--- isc-dhcp-4.2.4/debian/dhclient-script.hurd 1970-01-01 01:00:00.000000000 +0100
+++ isc-dhcp-4.2.4/debian/dhclient-script.hurd 2014-05-04 17:36:33.000000000 +0200
@@ -0,0 +1,327 @@
+#!/bin/bash
+
+# dhclient-script for GNU, based on the script for Linux.
+# Dan Halbert, March, 1997.
+# Updated for Linux 2.[12] by Brian J. Murrell, January 1999.
+# Modified for Debian. Matt Zimmerman and Eloy Paris, December 2003
+# Modified to remove useless tests for antiquated kernel versions that
+# this doesn't even work with anyway, and introduces a dependency on /usr
+# being mounted, which causes cosmetic errors on hosts that NFS mount /usr
+# Andrew Pollock, February 2005
+# Modified to work on point-to-point links. Andrew Pollock, June 2005
+# Modified to support passing the parameters called with to the hooks. Andrew Pollock, November 2005
+# Modified to work under GNU/Hurd for isc-dhcp-4.1.1 based on the
+# patch by Samuel Thibault for dhcp3. Svante Signell, February 2011.
+
+# The alias handling in here probably still sucks. -mdz
+
+# update /etc/resolv.conf based on received values
+make_resolv_conf() {
+ local new_resolv_conf
+
+ # DHCPv4
+ if [ -n "$new_domain_search" ] || [ -n "$new_domain_name" ] ||
+ [ -n "$new_domain_name_servers" ]; then
+ new_resolv_conf=/etc/resolv.conf.dhclient-new
+ rm -f $new_resolv_conf
+
+ if [ -n "$new_domain_name" ]; then
+ echo domain ${new_domain_name%% *} >>$new_resolv_conf
+ fi
+
+ if [ -n "$new_domain_search" ]; then
+ if [ -n "$new_domain_name" ]; then
+ domain_in_search_list=""
+ for domain in $new_domain_search; do
+ if [ "$domain" = "${new_domain_name}" ] ||
+ [ "$domain" = "${new_domain_name}." ]; then
+ domain_in_search_list="Yes"
+ fi
+ done
+ if [ -z "$domain_in_search_list" ]; then
+ new_domain_search="$new_domain_name $new_domain_search"
+ fi
+ fi
+ echo "search ${new_domain_search}" >> $new_resolv_conf
+ elif [ -n "$new_domain_name" ]; then
+ echo "search ${new_domain_name}" >> $new_resolv_conf
+ fi
+
+ if [ -n "$new_domain_name_servers" ]; then
+ for nameserver in $new_domain_name_servers; do
+ echo nameserver $nameserver >>$new_resolv_conf
+ done
+ else # keep 'old' nameservers
+ sed -n /^\w*[Nn][Aa][Mm][Ee][Ss][Ee][Rr][Vv][Ee][Rr]/p /etc/resolv.conf >>$new_resolv_conf
+ fi
+
+ chown --reference=/etc/resolv.conf $new_resolv_conf
+ chmod --reference=/etc/resolv.conf $new_resolv_conf
+ mv -f $new_resolv_conf /etc/resolv.conf
+ # DHCPv6
+ elif [ -n "$new_dhcp6_domain_search" ] || [ -n "$new_dhcp6_name_servers" ]; then
+ new_resolv_conf=/etc/resolv.conf.dhclient-new
+ rm -f $new_resolv_conf
+
+ if [ -n "$new_dhcp6_domain_search" ]; then
+ echo "search ${new_dhcp6_domain_search}" >> $new_resolv_conf
+ fi
+
+ if [ -n "$new_dhcp6_name_servers" ]; then
+ for nameserver in $new_dhcp6_name_servers; do
+ echo nameserver $nameserver >>$new_resolv_conf
+ done
+ else # keep 'old' nameservers
+ sed -n /^\w*[Nn][Aa][Mm][Ee][Ss][Ee][Rr][Vv][Ee][Rr]/p /etc/resolv.conf >>$new_resolv_conf
+ fi
+
+ chown --reference=/etc/resolv.conf $new_resolv_conf
+ chmod --reference=/etc/resolv.conf $new_resolv_conf
+ mv -f $new_resolv_conf /etc/resolv.conf
+ fi
+}
+
+# run given script
+run_hook() {
+ local script
+ local exit_status
+ script="$1"
+ shift # discard the first argument, then the rest are the script's
+
+ if [ -f $script ]; then
+ . $script "$@"
+ fi
+
+ if [ -n "$exit_status" ] && [ "$exit_status" -ne 0 ]; then
+ logger -p daemon.err "$script returned non-zero exit status $exit_status"
+ fi
+
+ return $exit_status
+}
+
+# run scripts in given directory
+run_hookdir() {
+ local dir
+ local exit_status
+ dir="$1"
+ shift # See run_hook
+
+ if [ -d "$dir" ]; then
+ for script in $(run-parts --list $dir); do
+ run_hook $script "$@" || true
+ exit_status=$?
+ done
+ fi
+
+ return $exit_status
+}
+
+# Must be used on exit. Invokes the local dhcp client exit hooks, if any.
+exit_with_hooks() {
+ exit_status=$1
+
+ # Source the documented exit-hook script, if it exists
+ if ! run_hook /etc/dhcp/dhclient-exit-hooks "$@"; then
+ exit_status=$?
+ fi
+
+ # Now run scripts in the Debian-specific directory.
+ if ! run_hookdir /etc/dhcp/dhclient-exit-hooks.d "$@"; then
+ exit_status=$?
+ fi
+
+ exit $exit_status
+}
+
+
+# set up some variables for DHCPv4 handlers below
+if [ -n "$new_broadcast_address" ]; then
+ new_broadcast_arg="--broadcast $new_broadcast_address"
+fi
+if [ -n "$old_broadcast_address" ]; then
+ old_broadcast_arg="--broadcast $old_broadcast_address"
+fi
+if [ -n "$new_subnet_mask" ]; then
+ new_subnet_arg="--netmask $new_subnet_mask"
+fi
+if [ -n "$alias_subnet_mask" ]; then
+ alias_subnet_arg="--netmask $alias_subnet_mask"
+fi
+# The 576 MTU is only used for X.25 and dialup connections
+# where the admin wants low latency. Such a low MTU can cause
+# problems with UDP traffic, among other things. As such,
+# disallow MTUs from 576 and below by default, so that broken
+# MTUs are ignored, but higher stuff is allowed (1492, 1500, etc).
+if [ -z "$new_interface_mtu" ] || [ "$new_interface_mtu" -lt 576 ]; then
+ new_interface_mtu=''
+fi
+if [ -n "$IF_METRIC" ]; then
+ metric_arg="--metric $IF_METRIC" # interfaces(5), "metric" option
+fi
+
+
+# The action starts here
+
+# Invoke the local dhcp client enter hooks, if they exist.
+run_hook /etc/dhcp/dhclient-enter-hooks
+run_hookdir /etc/dhcp/dhclient-enter-hooks.d
+
+# Execute the operation
+case "$reason" in
+
+ ### DHCPv4 Handlers
+
+ MEDIUM|ARPCHECK|ARPSEND)
+ # Do nothing
+ ;;
+ PREINIT)
+ # The DHCP client is requesting that an interface be
+ # configured as required in order to send packets prior to
+ # receiving an actual address. - dhclient-script(8)
+
+ # ensure interface is up
+ # TODO: handle multiple interface case.
+ fsysopts /servers/socket/2 -i ${interface}
+
+ if [ -n "$alias_ip_address" ]; then
+ # flush alias IP from interface
+ # TODO
+ :
+ # ip -4 addr flush dev ${interface} label ${interface}:0
+ fi
+
+ ;;
+
+ BOUND|RENEW|REBIND|REBOOT)
+ if [ -n "$old_host_name" ] && [ -n "$new_host_name" ] &&
+ [ "$old_host_name" != "$new_host_name" ]; then
+ # hostname changed => set it
+ hostname "$new_host_name"
+ fi
+
+ if [ -n "$old_ip_address" ] && [ -n "$alias_ip_address" ] &&
+ [ "$alias_ip_address" != "$old_ip_address" ]; then
+ # alias IP may have changed => flush it
+ # TODO
+ :
+ # ip -4 addr flush dev ${interface} label ${interface}:0
+ fi
+
+ if [ -n "$old_ip_address" ] &&
+ [ "$old_ip_address" != "$new_ip_address" ]; then
+ # leased IP has changed => flush it
+ inetutils-ifconfig -i ${interface} -A 0.0.0.0
+ fi
+
+ if [ -z "$old_ip_address" ] ||
+ [ "$old_ip_address" != "$new_ip_address" ] ||
+ [ "$reason" = "BOUND" ] || [ "$reason" = "REBOOT" ]; then
+ # new IP has been leased or leased IP changed => set it
+ inetutils-ifconfig -i ${interface} -A ${new_ip_address} \
+ ${new_subnet_arg} ${new_broadcast_arg}
+
+ if [ -n "$new_interface_mtu" ]; then
+ # set MTU
+ inetutils-ifconfig -i ${interface} --mtu ${new_interface_mtu}
+ fi
+
+ for router in $new_routers; do
+ if [ "$new_subnet_mask" = "255.255.255.255" ]; then
+ # point-to-point connection => set explicit route
+ # TODO
+ :
+ #ip -4 route add ${router} dev $interface >/dev/null 2>&1
+ fi
+
+ # set default route
+ fsysopts /servers/socket/2 $(fsysopts /servers/socket/2) -g ${router}
+ done
+ fi
+
+ if [ -n "$alias_ip_address" ] &&
+ [ "$new_ip_address" != "$alias_ip_address" ]; then
+ # separate alias IP given, which may have changed
+ # => flush it, set it & add host route to it
+ # TODO
+ :
+ #ip -4 addr flush dev ${interface} label ${interface}:0
+ #ip -4 addr add ${alias_ip_address}${alias_mask} \
+ # dev ${interface} label ${interface}:0
+ #ip -4 route add ${alias_ip_address} dev ${interface} >/dev/null 2>&1
+ fi
+
+ # update /etc/resolv.conf
+ make_resolv_conf
+
+ ;;
+
+ EXPIRE|FAIL|RELEASE|STOP)
+ if [ -n "$alias_ip_address" ]; then
+ # flush alias IP
+ # TODO
+ :
+ #ip -4 addr flush dev ${interface} label ${interface}:0
+ fi
+
+ if [ -n "$old_ip_address" ]; then
+ # flush leased IP
+ inetutils-ifconfig -i ${interface} -A 0.0.0.0
+ fi
+
+ if [ -n "$alias_ip_address" ]; then
+ # alias IP given => set it & add host route to it
+ # TODO
+ :
+ #ip -4 addr add ${alias_ip_address}${alias_network_arg} \
+ # dev ${interface} label ${interface}:0
+ #ip -4 route add ${alias_ip_address} dev ${interface} >/dev/null 2>&1
+ fi
+
+ ;;
+
+ TIMEOUT)
+ if [ -n "$alias_ip_address" ]; then
+ # flush alias IP
+ # TODO
+ :
+ #ip -4 addr flush dev ${interface} label ${interface}:0
+ fi
+
+ # set IP from recorded lease
+ inetutils-ifconfig -i ${interface} -A ${new_ip_address} \
+ ${new_subnet_arg} ${new_broadcast_arg}
+
+ if [ -n "$new_interface_mtu" ]; then
+ # set MTU
+ inetutils-ifconfig -i ${interface} --mtu ${new_interface_mtu}
+ fi
+
+ # if there is no router recorded in the lease or the 1st router answers pings
+ if [ -z "$new_routers" ] || ping -q -c 1 "${new_routers%% *}"; then
+ if [ -n "$alias_ip_address" ] &&
+ [ "$new_ip_address" != "$alias_ip_address" ]; then
+ # separate alias IP given => set up the alias IP & add host route to it
+ # TODO
+ :
+ #ip -4 addr add ${alias_ip_address}${alias_mask} \
+ # dev ${interface} label ${interface}:0
+ #ip -4 route add ${alias_ip_address} dev ${interface} >/dev/null 2>&1
+ fi
+
+ # set default route
+ for router in $new_routers; do
+ fsysopts /servers/socket/2 $(fsysopts /servers/socket/2) -g ${router}
+ done
+
+ # update /etc/resolv.conf
+ make_resolv_conf
+ else
+ # flush all IPs from interface
+ inetutils-ifconfig -i ${interface} -A 0.0.0.0
+ exit_with_hooks 2 "$@"
+ fi
+
+ ;;
+esac
+
+exit_with_hooks 0
diff -Nru isc-dhcp-4.2.4/debian/dhclient-script.hurd.udeb isc-dhcp-4.2.4/debian/dhclient-script.hurd.udeb
--- isc-dhcp-4.2.4/debian/dhclient-script.hurd.udeb 1970-01-01 01:00:00.000000000 +0100
+++ isc-dhcp-4.2.4/debian/dhclient-script.hurd.udeb 2014-05-04 17:36:15.000000000 +0200
@@ -0,0 +1,116 @@
+#!/bin/sh
+
+set -e
+
+# reduced dhclient-script for the Debian installer
+# changes by Joshua Kwan <joshk at triplehelix.org>,
+# Bastian Blank <waldi at debian.org>
+
+# dhclient-script for Linux. Dan Halbert, March, 1997.
+# Updated for Linux 2.[12] by Brian J. Murrell, January 1999.
+# Modified for Debian. Matt Zimmerman and Eloy Paris, December 2003
+# Adapted the GNU/Linux script to GNU/Hurd, Svante Signell and Samuel Thibault,
+# February 2011.
+
+# update /etc/resolv.conf based on received values
+make_resolv_conf() {
+ local new_resolv_conf
+
+ if [ -n "$new_domain_name" ] || [ -n "$new_domain_name_servers" ]; then
+ new_resolv_conf=/etc/resolv.conf.dhclient-new
+ rm -f $new_resolv_conf
+
+ if [ -n "$new_domain_name" ]; then
+ echo "search $new_domain_name" >>$new_resolv_conf
+ fi
+
+ for nameserver in $new_domain_name_servers; do
+ echo "nameserver $nameserver" >>$new_resolv_conf
+ done
+
+ mv $new_resolv_conf /etc/resolv.conf
+ fi
+}
+
+set_hostname() {
+ local current_hostname
+ current_hostname=$(hostname)
+
+ if [ -z "$current_hostname" ] || [ "$current_hostname" = "(none)" ]; then
+ hostname "$new_host_name"
+ fi
+}
+
+# set up some variables for DHCP handlers below
+if [ -n "$new_subnet_mask" ]; then
+ new_subnet_arg="-m $new_subnet_mask"
+fi
+
+# Execute the operation
+case "$reason" in
+ MEDIUM|ARPCHECK|ARPSEND)
+ # Do nothing
+ ;;
+ PREINIT)
+ fsysopts /servers/socket/2 -i $interface
+
+ # We need to give the kernel some time to get the interface up.
+ sleep 1
+
+ ;;
+
+ BOUND|RENEW|REBIND|REBOOT)
+ set_hostname
+ pfinet_args="-i $interface"
+
+ if [ -n "$old_ip_address" ] &&
+ [ "$old_ip_address" != "$new_ip_address" ]; then
+ # IP address changed. Bringing down the interface will delete all routes,
+ # and clear the ARP cache.
+ fsysopts /servers/socket/2 $pfinet_args
+ fi
+
+ # TODO: add MTU option to pfinet
+ #if [ -n "$new_interface_mtu" ]; then
+ # pfinet_args="$pfinet_args --mtu $new_interface_mtu"
+ # fsysopts /servers/socket/2 $pfinet_args
+ #fi
+
+ if [ -z "$old_ip_address" ] ||
+ [ "$old_ip_address" != "$new_ip_address" ] ||
+ [ "$reason" = "BOUND" ] || [ "$reason" = "REBOOT" ]; then
+
+ pfinet_args="$pfinet_args -a $new_ip_address $new_subnet_arg"
+
+ for router in $new_routers; do
+ pfinet_args="$pfinet_args -g $router"
+ done
+ fsysopts /servers/socket/2 $pfinet_args
+ fi
+
+ make_resolv_conf
+
+ # Get the domain name into a file suitable for netcfg to read.
+ printf "$new_domain_name" > /tmp/domain_name
+
+ if [ -n "$new_ntp_servers" ]; then
+ printf "$new_ntp_servers" > /tmp/dhcp-ntp-servers
+ fi
+
+ ;;
+
+ EXPIRE|FAIL|RELEASE|STOP)
+ if [ -n "$old_ip_address" ]; then
+ # Shut down interface, which will delete routes and clear arp cache.
+ fsysopts /servers/socket/2 -i $interface
+ fi
+
+ ;;
+
+ TIMEOUT)
+ fsysopts /servers/socket/2 -i $interface
+
+ ;;
+esac
+
+exit 0
diff -Nru isc-dhcp-4.2.4/debian/patches/hurd.patch isc-dhcp-4.2.4/debian/patches/hurd.patch
--- isc-dhcp-4.2.4/debian/patches/hurd.patch 1970-01-01 01:00:00.000000000 +0100
+++ isc-dhcp-4.2.4/debian/patches/hurd.patch 2014-05-04 19:18:45.000000000 +0200
@@ -0,0 +1,129 @@
+Description: Fixes FTBFS on Hurd, see #616290
+Origin: upstream, https://bugs.debian.org/616290#241
+
+--- a/RELNOTES
++++ b/RELNOTES
+@@ -50,6 +50,14 @@ work on other platforms. Please report a
+
+ - None
+
++*** 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.
+--- a/client/dhclient.c
++++ b/client/dhclient.c
+@@ -376,21 +376,17 @@ main(int argc, char **argv) {
+ * 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));
+ }
+
+ /*
+--- a/common/bpf.c
++++ b/common/bpf.c
+@@ -550,7 +550,9 @@ void maybe_setup_fallback ()
+ 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;
+--- a/common/lpf.c
++++ b/common/lpf.c
+@@ -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 @@ void maybe_setup_fallback ()
+ 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;
+--- a/includes/osdep.h
++++ b/includes/osdep.h
+@@ -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
+
+--- a/server/dhcpd.c
++++ b/server/dhcpd.c
+@@ -464,12 +464,11 @@ main(int argc, char **argv) {
+ * 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) {
diff -Nru isc-dhcp-4.2.4/debian/patches/series isc-dhcp-4.2.4/debian/patches/series
--- isc-dhcp-4.2.4/debian/patches/series 2013-05-27 22:26:49.000000000 +0200
+++ isc-dhcp-4.2.4/debian/patches/series 2014-05-04 19:13:20.000000000 +0200
@@ -6,3 +6,4 @@
cve-2012-3954.patch
cve-2012-3955.patch
dhclient-exit-hook.patch
+hurd.patch
diff -Nru isc-dhcp-4.2.4/debian/rfc3442-classless-routes.hurd isc-dhcp-4.2.4/debian/rfc3442-classless-routes.hurd
--- isc-dhcp-4.2.4/debian/rfc3442-classless-routes.hurd 1970-01-01 01:00:00.000000000 +0100
+++ isc-dhcp-4.2.4/debian/rfc3442-classless-routes.hurd 2014-05-04 19:12:31.000000000 +0200
@@ -0,0 +1 @@
+:
diff -Nru isc-dhcp-4.2.4/debian/rules isc-dhcp-4.2.4/debian/rules
--- isc-dhcp-4.2.4/debian/rules 2013-05-27 22:54:55.000000000 +0200
+++ isc-dhcp-4.2.4/debian/rules 2014-05-04 19:30:52.000000000 +0200
@@ -35,6 +35,12 @@
CFLAGS += -D_PATH_DHCLIENT_CONF='"/etc/dhcp/dhclient.conf"'
CFLAGS += -DNOMINUM
+ifeq ($(DEB_HOST_ARCH_OS), hurd)
+CONFIG=--enable-use-sockets
+export DO_LPF=1
+else
+CONFIG=
+endif
bind-stamp:
dh_testdir
@@ -48,6 +54,7 @@
test ! -f Makefile || $(MAKE) distclean
./configure \
--prefix=/usr \
+ $(CONFIG) \
--sysconfdir=/etc/dhcp \
--with-srv-lease-file=/var/lib/dhcp/dhcpd.leases \
--with-srv6-lease-file=/var/lib/dhcp/dhcpd6.leases \
@@ -78,6 +85,7 @@
test ! -f Makefile || $(MAKE) distclean
./configure \
--prefix=/usr \
+ $(CONFIG) \
--sysconfdir=/etc/dhcp \
--with-srv-lease-file=/var/lib/dhcp/dhcpd.leases \
--with-srv6-lease-file=/var/lib/dhcp/dhcpd6.leases \
More information about the pkg-dhcp-devel
mailing list