Package: dhcp3
Severity: important
Tags: patch

Hello,

Here is a patch to port dhcp3 to GNU/Hurd, could you please apply it?

Thanks,
Samuel

-- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (500, 'stable'), (1, 
'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.31 (SMP w/2 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
--- /dev/null   2007-12-29 19:47:02.000000000 +0000
+++ dhcp3-3.1.3/debian/dhclient-script.hurd     2009-11-09 00:08:18.000000000 
+0000
@@ -0,0 +1,247 @@
+#!/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
+
+# The alias handling in here probably still sucks. -mdz
+
+make_resolv_conf() {
+    if [ "$new_domain_name" -o "$new_domain_name_servers" ]; then
+        local new_resolv_conf=/etc/resolv.conf.dhclient-new
+        rm -f $new_resolv_conf
+        if [ "$new_domain_name" ]; then
+            echo domain ${new_domain_name%% *} >>$new_resolv_conf
+        fi
+       if [ "$new_domain_search" ]; then
+           #new_domain_search="${new_domain_search% }"
+           if [ "$new_domain_name" ]; then
+               domain_in_search_list=""
+               for domain in "$new_domain_search"; do
+                       if [ "$domain" = "$new_domain_name" ]; then
+                               domain_in_search="Yes"
+                       fi
+               done
+               if [ ! "$domain_in_search" ]; then
+                       new_domain_search="$new_domain_name $new_domain_search"
+               fi
+           fi
+           echo "search ${new_domain_search}" >> $new_resolv_conf
+       elif [ "$new_domain_name" ]; then
+               echo "search ${new_domain_name}" >> $new_resolv_conf
+       fi
+        if [ "$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
+    fi
+}
+
+run_hook() {
+    local script="$1"
+    local exit_status
+    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"
+        save_exit_status=$exit_status
+    fi
+
+    return $exit_status
+}
+
+run_hookdir() {
+    local dir="$1"
+    local exit_status
+    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/dhcp3/dhclient-exit-hooks "$@"; then
+        exit_status=$?
+    fi
+
+    # Now run scripts in the Debian-specific directory.
+    if ! run_hookdir /etc/dhcp3/dhclient-exit-hooks.d "$@"; then
+        exit_status=$?
+    fi
+
+    exit $exit_status
+}
+
+set_hostname() {
+    local current_hostname=$(hostname)
+    if [ -z "$current_hostname" -o "$current_hostname" = "(none)" ]; then
+        hostname "$new_host_name"
+    fi
+}
+
+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 "$old_subnet_mask" ]; then
+    old_subnet_arg="--netmask $old_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 [ -n "$new_interface_mtu" ] && [ $new_interface_mtu -gt 576 ]; then
+    mtu_arg="--mtu $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/dhcp3/dhclient-enter-hooks
+run_hookdir /etc/dhcp3/dhclient-enter-hooks.d
+
+# Execute the operation
+case "$reason" in
+    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)
+       settrans -afg /servers/socket/2 /hurd/pfinet --dhcp -i $interface
+        ;;
+    BOUND|RENEW|REBIND|REBOOT)
+
+        set_hostname
+
+        if [ -n "$old_ip_address" -a -n "$alias_ip_address" -a \
+             "$alias_ip_address" != "$old_ip_address" ]; then
+            # Possible new alias. Remove old alias.
+            inetutils-ifconfig -i $interface:0- inet 0
+        fi
+
+        if [ -n "$old_ip_address" -a \
+             "$old_ip_address" != "$new_ip_address" ]; then
+            # IP address changed. Bringing down the interface will delete all 
routes,
+            # and clear the ARP cache.
+            inetutils-ifconfig -i $interface inet 0
+
+        fi
+
+        if [ -z "$old_ip_address" -o "$old_ip_address" != "$new_ip_address" -o 
\
+            "$reason" = "BOUND" -o "$reason" = "REBOOT" ]; then
+
+            inetutils-ifconfig -i $interface inet $new_ip_address 
$new_subnet_arg \
+                $new_broadcast_arg $mtu_arg
+
+            for router in $new_routers; do
+                #route add default dev $interface gw $router $metric_arg
+               fsysopts /servers/socket/2 -i $interface -a $new_ip_address -m 
$new_subnet_mask -g $router
+            done
+        fi
+
+        if [ "$new_ip_address" != "$alias_ip_address" -a -n 
"$alias_ip_address" ];
+            then
+            inetutils-ifconfig -i $interface:0- inet 0
+            inetutils-ifconfig -i $interface:0 inet $alias_ip_address 
$alias_subnet_arg
+            #route add -host $alias_ip_address $interface:0
+        fi
+
+        make_resolv_conf
+
+        ;;
+
+    EXPIRE|FAIL|RELEASE|STOP)
+        if [ -n "$alias_ip_address" ]; then
+            # Turn off alias interface.
+            inetutils-ifconfig -i $interface:0- inet 0
+        fi
+
+        if [ -n "$old_ip_address" ]; then
+            # Shut down interface, which will delete routes and clear arp 
cache.
+            inetutils-ifconfig -i $interface inet 0
+        fi
+
+        if [ -n "$alias_ip_address" ]; then
+            inetutils-ifconfig -i $interface:0 inet $alias_ip_address 
$alias_subnet_arg
+            #route add -host $alias_ip_address $interface:0
+        fi
+
+        ;;
+
+    TIMEOUT)
+        if [ -n "$alias_ip_address" ]; then
+            inetutils-ifconfig -i $interface:0- inet 0
+        fi
+
+        inetutils-ifconfig -i $interface inet $new_ip_address $new_subnet_arg \
+            $new_broadcast_arg $mtu_arg
+
+        set -- $new_routers
+        first_router="$1"
+
+        if [ -z "$first_router" ] || ping -q -c 1 $first_router; then
+            if [ "$new_ip_address" != "$alias_ip_address" -a \
+                -n "$alias_ip_address" ]; then
+                inetutils-ifconfig -i $interface:0 inet $alias_ip_address 
$alias_subnet_arg
+                #route add -host $alias_ip_address dev $interface:0
+            fi
+           
+            for router in $new_routers; do
+                #route add default dev $interface gw $router $metric_arg
+               fsysopts /servers/socket/2 -i $interface -a $new_ip_address -m 
$new_subnet_mask -g $router
+            done
+
+            make_resolv_conf
+        else
+            # Changed from 'inetutils-ifconfig -i $interface inet 0 down' - 
see Debian bug #144666
+            inetutils-ifconfig -i $interface inet 0
+            exit_with_hooks 2 "$@"
+        fi
+
+        ;;
+esac
+
+exit_with_hooks 0
--- /dev/null   2007-12-29 19:47:02.000000000 +0000
+++ dhcp3-3.1.3/debian/patches/hurd.dpatch      2009-11-09 00:11:00.000000000 
+0000
@@ -0,0 +1,411 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## hurd.dpatch by  <sthiba...@debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: No description.
+
+...@dpatch@
+diff -ur dhcp3-3.1.3.backup/Makefile.conf dhcp3-3.1.3.new/Makefile.conf
+--- dhcp3-3.1.3.backup/Makefile.conf   2009-11-08 22:56:19.000000000 +0000
++++ dhcp3-3.1.3.new/Makefile.conf      2009-11-08 23:48:09.000000000 +0000
+@@ -506,3 +506,21 @@
+ #SCRIPT=kfreebsd
+ ##--kfreebsd--
+ 
++## GNU
++##--gnu--
++#COPTS = $(BINDDEF) $(CC_OPTIONS) -Dgnu
++#ETC = /etc/dhcp3
++#CF = cf/gnu.h
++#ADMMANDIR = /usr/share/man/man8
++#ADMMANEXT = .8
++#FFMANDIR = /usr/share/man/man5
++#FFMANEXT = .5
++#LIBMANDIR = /usr/share/man/man3
++#LIBMANEXT = .3
++#USRMANDIR = /usr/share/man/man1
++#USRMANEXT = .1
++#MANCAT = man
++#VARRUN = /var/run
++#VARDB = /var/lib/dhcp
++#SCRIPT = gnu
++##--gnu--
+diff -ur dhcp3-3.1.3.backup/configure dhcp3-3.1.3.new/configure
+--- dhcp3-3.1.3.backup/configure       2009-11-08 22:56:19.000000000 +0000
++++ dhcp3-3.1.3.new/configure  2009-11-08 22:56:20.000000000 +0000
+@@ -185,7 +185,9 @@
+     UnixWare)
+       sysname=uw7;;
+     GNU/kFreeBSD)
+-      sysname=kfreebsd;
++      sysname=kfreebsd;;
++    GNU)
++      sysname=gnu;;
+   esac
+ fi
+ 
+@@ -216,6 +218,7 @@
+     echo "   NEXTSTEP     NeXTSTEP"
+     echo "   sco      SCO Open Server"
+     echo "   kfreebsd         GNU/kFreeBSD"
++    echo "   GNU      GNU"
+     exit 1;
+   fi
+ fi
+diff -ur dhcp3-3.1.3.backup/includes/osdep.h dhcp3-3.1.3.new/includes/osdep.h
+--- dhcp3-3.1.3.backup/includes/osdep.h        2009-11-08 22:56:20.000000000 
+0000
++++ dhcp3-3.1.3.new/includes/osdep.h   2009-11-08 22:54:20.000000000 +0000
+@@ -137,6 +137,10 @@
+ #  include "cf/kfreebsd.h"
+ #endif
+ 
++#ifdef gnu
++# include "cf/gnu.h"
++#endif
++
+ /* snprintf/vsnprintf hacks.  for systems with no libc versions only. */
+ #ifdef NO_SNPRINTF
+   extern int isc_print_snprintf(char *, size_t, const char *, ...);
+--- /dev/null  2007-12-29 19:47:02.000000000 +0000
++++ dhcp3-3.1.3.new/includes/cf/gnu.h  2009-11-08 23:05:05.000000000 +0000
+@@ -0,0 +1,135 @@
++/* gnu.h */
++/*
++ * Copyright (c) 1996 The Internet Software Consortium.  All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ *
++ * 1. Redistributions of source code must retain the above copyright
++ *    notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ *    notice, this list of conditions and the following disclaimer in the
++ *    documentation and/or other materials provided with the distribution.
++ * 3. Neither the name of The Internet Software Consortium nor the names of 
its
++ *    contributors may be used to endorse or promote products derived
++ *    from this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE INTERNET SOFTWARE CONSORTIUM AND
++ * CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
++ * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
++ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL
++ * INTERNET SOFTWARE CONSORTIUM OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
++ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
++ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
++ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
++ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
++ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
++ * OF THE POSSIBILITY OF SUCH DAMAGE.
++ *
++ */
++
++#define int8_t                char
++#define int16_t               short
++#define int32_t               int
++
++#define u_int8_t      unsigned char
++#define u_int16_t     unsigned short
++#define u_int32_t     unsigned int
++
++#include <sys/types.h>
++
++#include <syslog.h>
++
++#include <string.h>
++#include <errno.h>
++#include <unistd.h>
++#include <sys/select.h>
++#include <sys/wait.h>
++#include <signal.h>
++#include <setjmp.h>
++#include <limits.h>
++
++#include <net/if.h>
++
++#ifndef _PATH_DHCPD_PID
++#define _PATH_DHCPD_PID       "/var/run/dhcpd.pid"
++#endif
++#ifndef _PATH_DHCLIENT_PID
++#define _PATH_DHCLIENT_PID "/var/run/dhclient.pid"
++#endif
++#ifndef _PATH_DHCRELAY_PID
++#define _PATH_DHCRELAY_PID "/var/run/dhcrelay.pid"
++#endif
++
++#ifndef _PATH_DHCPD_DB
++#define _PATH_DHCPD_DB "/var/state/dhcp/dhcpd.leases"
++#endif
++#ifndef _PATH_DHCLIENT_DB
++#define _PATH_DHCLIENT_DB "/var/state/dhcp/dhclient.leases"
++#endif
++
++#include <stdarg.h>
++#define VA_DOTDOTDOT ...
++#define VA_start(list, last) va_start (list, last)
++#define va_dcl
++
++#define EOL '\n'
++#define VOIDPTR void *
++
++#include <time.h>
++
++#define TIME time_t
++#define GET_TIME(x)   time ((x))
++
++#define USE_SOCKETS   1
++#define HAVE_SA_LEN   1
++#undef FDDI
++#undef AF_LINK
++
++#ifdef NEED_PRAND_CONF
++#ifndef HAVE_DEV_RANDOM
++ # define HAVE_DEV_RANDOM 1
++ #endif /* HAVE_DEV_RANDOM */
++
++const char *cmds[] = {
++      "/bin/ps -axlw 2>&1",
++      "/sbin/arp -an 2>&1",
++      "/bin/netstat -an 2>&1",
++      "/bin/df  2>&1",
++      "/bin/df / 2>&1",
++      "/usr/bin/dig com. soa +ti=1 +retry=0 2>&1",
++      "/usr/bin/uptime  2>&1",
++      "/bin/netstat -s 2>&1",
++      "/usr/bin/dig . soa +ti=1 +retry=0 2>&1",
++      "/usr/bin/vmstat  2>&1",
++      "/usr/bin/w  2>&1",
++      NULL
++};
++
++const char *dirs[] = {
++      "/tmp",
++      "/usr/tmp",
++      ".",
++      "/",
++      "/var/spool",
++      "/dev",
++      "/var/spool/mail",
++      "/home",
++      "/usr/home",
++      NULL
++};
++
++const char *files[] = {
++      "/proc/stat",
++      "/proc/rtc",
++      "/proc/meminfo",
++      "/proc/interrupts",
++      "/proc/self/status",
++      "/var/log/messages",
++      "/var/log/wtmp",
++      "/var/log/lastlog",
++      NULL
++};
++#endif /* NEED_PRAND_CONF */
+--- /dev/null  2007-12-29 19:47:02.000000000 +0000
++++ dhcp3-3.1.3.new/client/scripts/gnu 2009-11-08 23:37:40.000000000 +0000
+@@ -0,0 +1,202 @@
++#!/bin/sh
++# 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.
++# No guarantees about this. I'm a novice at the details of Linux
++# networking.
++
++# Notes:
++
++# 0. This script is based on the netbsd script supplied with dhcp-970306.
++
++# 1. ifconfig down apparently deletes all relevant routes and flushes
++# the arp cache, so this doesn't need to be done explicitly.
++
++# 2. The alias address handling here has not been tested AT ALL.
++# I'm just going by the doc of modern Linux ip aliasing, which uses
++# notations like eth0:0, eth0:1, for each alias.
++
++# 3. I have to calculate the network address, and calculate the broadcast
++# address if it is not supplied. This might be much more easily done
++# by the dhclient C code, and passed on.
++
++# 4. TIMEOUT not tested. ping has a flag I don't know, and I'm suspicious
++# of the $1 in its args.
++
++make_resolv_conf() {
++  if [ x"$new_domain_name_servers" != x ]; then
++    cat /dev/null > /etc/resolv.conf.dhclient
++    chmod 644 /etc/resolv.conf.dhclient
++    if [ x"$new_domain_search" != x ]; then
++      echo search $new_domain_search >> /etc/resolv.conf.dhclient
++    elif [ x"$new_domain_name" != x ]; then
++      # Note that the DHCP 'Domain Name Option' is really just a domain
++      # name, and that this practice of using the domain name option as
++      # a search path is both nonstandard and deprecated.
++      echo search $new_domain_name >> /etc/resolv.conf.dhclient
++    fi
++    for nameserver in $new_domain_name_servers; do
++      echo nameserver $nameserver >>/etc/resolv.conf.dhclient
++    done
++
++    mv /etc/resolv.conf.dhclient /etc/resolv.conf
++  fi
++}
++
++# Must be used on exit.   Invokes the local dhcp client exit hooks, if any.
++exit_with_hooks() {
++  exit_status=$1
++  if [ -x /etc/dhclient-exit-hooks ]; then
++    . /etc/dhclient-exit-hooks
++  fi
++# probably should do something with exit status of the local script
++  exit $exit_status
++}
++
++# Invoke the local dhcp client enter hooks, if they exist.
++if [ -x /etc/dhclient-enter-hooks ]; then
++  exit_status=0
++  . /etc/dhclient-enter-hooks
++  # allow the local script to abort processing of this state
++  # local script must set exit_status variable to nonzero.
++  if [ $exit_status -ne 0 ]; then
++    exit $exit_status
++  fi
++fi
++
++release=`uname -r`
++release=`expr $release : '\(.*\)\..*'`
++relminor=`echo $release |sed -e 's/^.*\.\([^\.]*\)$/\1/'`
++relmajor=`echo $release |sed -e 's/^\([^\.]*\)\..*$/\1/'`
++
++if [ x$new_broadcast_address != x ]; then
++  new_broadcast_arg="--broadcast $new_broadcast_address"
++fi
++if [ x$old_broadcast_address != x ]; then
++  old_broadcast_arg="--broadcast $old_broadcast_address"
++fi
++if [ x$new_subnet_mask != x ]; then
++  new_subnet_arg="--netmask $new_subnet_mask"
++fi
++if [ x$old_subnet_mask != x ]; then
++  old_subnet_arg="--netmask $old_subnet_mask"
++fi
++if [ x$alias_subnet_mask != x ]; then
++  alias_subnet_arg="--netmask $alias_subnet_mask"
++fi
++if [ x$new_interface_mtu != x ]; then
++  mtu_arg="--mtu $new_interface_mtu"
++fi
++if [ x$IF_METRIC != x ]; then
++  metric_arg="metric $IF_METRIC"
++fi
++
++if [ x$reason = xMEDIUM ]; then
++  # Linux doesn't do mediums (ok, ok, media).
++  exit_with_hooks 0
++fi
++
++if [ x$reason = xPREINIT ]; then
++  settrans -afg /servers/socket/2 /hurd/pfinet --dhcp -i $interface
++  exit_with_hooks 0
++fi
++
++if [ x$reason = xARPCHECK ] || [ x$reason = xARPSEND ]; then
++  exit_with_hooks 0
++fi
++  
++if [ x$reason = xBOUND ] || [ x$reason = xRENEW ] || \
++   [ x$reason = xREBIND ] || [ x$reason = xREBOOT ]; then
++  current_hostname=`hostname`
++  if [ x$current_hostname = x ] || \
++     [ x$current_hostname = "x(none)" ] || \
++     [ x$current_hostname = xlocalhost ] || \
++     [ x$current_hostname = x$old_host_name ]; then
++    if [ x$new_host_name != x$old_host_name ]; then
++      hostname "$new_host_name"
++    fi
++  fi
++    
++  if [ x$old_ip_address != x ] && [ x$alias_ip_address != x ] && \
++              [ x$alias_ip_address != x$old_ip_address ]; then
++    # Possible new alias. Remove old alias.
++    inetutils-ifconfig -i $interface:0- inet 0
++  fi
++  if [ x$old_ip_address != x ] && [ x$old_ip_address != x$new_ip_address ]; 
then
++    # IP address changed. Bringing down the interface will delete all routes,
++    # and clear the ARP cache.
++    inetutils-ifconfig -i $interface inet 0 down
++
++  fi
++  if [ x$old_ip_address = x ] || [ x$old_ip_address != x$new_ip_address ] || \
++     [ x$reason = xBOUND ] || [ x$reason = xREBOOT ]; then
++
++    inetutils-ifconfig -i $interface -a $new_ip_address $new_subnet_arg \
++                                                      $new_broadcast_arg 
$mtu_arg
++    # Add a network route to the computed network address.
++    if [ $relmajor -lt 2 ] || \
++              ( [ $relmajor -eq 2 ] && [ $relminor -eq 0 ] ); then
++      #route add -net $new_network_number $new_subnet_arg dev $interface
++      /bin/true
++    fi
++    for router in $new_routers; do
++      fsysopts /servers/socket/2 -i $interface -a $new_ip_address -m 
$new_subnet_mask -g $router
++    done
++  fi
++  if [ x$new_ip_address != x$alias_ip_address ] && [ x$alias_ip_address != x 
];
++   then
++    inetutils-ifconfig -i $interface:0- inet 0
++    inetutils-ifconfig -i $interface:0 inet -a $alias_ip_address 
$alias_subnet_arg
++    #route add -host $alias_ip_address $interface:0
++  fi
++  make_resolv_conf
++  exit_with_hooks 0
++fi
++
++if [ x$reason = xEXPIRE ] || [ x$reason = xFAIL ] || [ x$reason = xRELEASE ] \
++   || [ x$reason = xSTOP ]; then
++  if [ x$alias_ip_address != x ]; then
++    # Turn off alias interface.
++    inetutils-ifconfig -i $interface:0- inet 0
++  fi
++  if [ x$old_ip_address != x ]; then
++    # Shut down interface, which will delete routes and clear arp cache.
++    inetutils-ifconfig -i $interface inet 0 down
++  fi
++  if [ x$alias_ip_address != x ]; then
++    inetutils-ifconfig -i $interface:0 inet -a $alias_ip_address 
$alias_subnet_arg
++    #route add -host $alias_ip_address $interface:0
++  fi
++  exit_with_hooks 0
++fi
++
++if [ x$reason = xTIMEOUT ]; then
++  if [ x$alias_ip_address != x ]; then
++    inetutils-ifconfig -i $interface:0- inet 0
++  fi
++  inetutils-ifconfig -i $interface inet -a $new_ip_address $new_subnet_arg \
++                                      $new_broadcast_arg $mtu_arg
++  set $new_routers
++  if ping -q -c 1 $1; then
++    if [ x$new_ip_address != x$alias_ip_address ] && \
++                      [ x$alias_ip_address != x ]; then
++      inetutils-ifconfig -i $interface:0 inet -a $alias_ip_address 
$alias_subnet_arg
++      #route add -host $alias_ip_address dev $interface:0
++    fi
++    if [ $relmajor -lt 2 ] || \
++              ( [ $relmajor -eq 2 ] && [ $relminor -eq 0 ] ); then
++        #route add -net $new_network_number
++        /bin/true
++    fi
++    for router in $new_routers; do
++      #route add default gw $router $metric_arg dev $interface
++      fsysopts /servers/socket/2 -i $interface -a $new_ip_address -m 
$new_subnet_mask -g $router
++    done
++    make_resolv_conf
++    exit_with_hooks 0
++  fi
++  inetutils-ifconfig -i $interface inet 0 down
++  exit_with_hooks 1
++fi
++
++exit_with_hooks 0
--- dhcp3-3.1.3/debian/patches/00list.orig      2009-11-09 00:10:38.000000000 
+0000
+++ dhcp3-3.1.3/debian/patches/00list   2009-11-09 00:10:53.000000000 +0000
@@ -18,6 +18,8 @@
 ignore-invalid-interfaces
 # GNU/kfreebsd system
 kfreebsd
+# GNU/Hurd system
+hurd
 # For CVE-2009-1892 / Debian bug #549584
 server-clientid-crash
 #ldap backend for dhcp3 server (docs and code)

Reply via email to