From nobody@FreeBSD.ORG Fri Jun 11 09:36:44 1999
Return-Path: <nobody@FreeBSD.ORG>
Received: by hub.freebsd.org (Postfix, from userid 32767)
	id A401E154F7; Fri, 11 Jun 1999 09:36:44 -0700 (PDT)
Message-Id: <19990611163644.A401E154F7@hub.freebsd.org>
Date: Fri, 11 Jun 1999 09:36:44 -0700 (PDT)
From: m.seaman@inpharmatica.co.uk
Sender: nobody@FreeBSD.ORG
To: freebsd-gnats-submit@freebsd.org
Subject: /sbin/dhclient-script: weird route commands
X-Send-Pr-Version: www-1.0

>Number:         12136
>Category:       bin
>Synopsis:       /sbin/dhclient-script: weird route commands
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    obrien
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jun 11 09:40:01 PDT 1999
>Closed-Date:    Fri Dec 17 18:04:49 PST 1999
>Last-Modified:  Fri Dec 17 18:05:10 PST 1999
>Originator:     Matthew Seaman
>Release:        3.2-STABLE of  Fri Jun 11 09:31:00 BST 1999
>Organization:
Inpharmatica Ltd
>Environment:
FreeBSD b0.farm.inpharmatica.co.uk 3.2-STABLE FreeBSD 3.2-STABLE #0: Fri Jun 11 09:31:00 BST 1999     matthew@b9.farm.inpharmatica.co.uk:/usr/src/sys/compile/FARM  alpha

>Description:
/sbin/dhclient-script will attempt to add a route from any new interface
IP address via 127.1 (or via 127.0.0.1 for aliases):

    route add $new_ip_address 127.1 >/dev/null 2>&1

which doesn't seem to achieve anything except causing the system log to
fill up with lines like:

Jun 11 02:23:43 b0 /kernel: arplookup 127.0.0.1 failed: could not allocate llinfo
Jun 11 02:23:43 b0 /kernel: arpresolve: can't allocate llinfo for 127.0.0.1rt

These repeat every 16 or so seconds ad-infinitum.  Since there are two
lines, syslogd's usual "last message repeated N times" mechanism
doesn't happen either.
>How-To-Repeat:
Install DHCP server on network
configure kernel on test machine with bpfilter
touch /etc/dhclient.conf

Assuming interface to be managed by dhcp is de0:

cat <<FOO > /etc/start_if.de0
#!/bin/sh

/sbin/dhclient de0
FOO
Comment out defaultrouter and ifconfig_de0 lines in /etc/rc.conf
Reboot

>Fix:
Apply this patch.  

--- /sbin/dhclient-script.orig  Fri Jun 11 16:37:20 1999
+++ /sbin/dhclient-script       Fri Jun 11 16:51:41 1999
@@ -62,7 +62,7 @@
 if [ x$reason = xPREINIT ]; then
   if [ x$alias_ip_address != x ]; then
     ifconfig $interface inet -alias $alias_ip_address > /dev/null 2>&1
-    route delete $alias_ip_address 127.0.0.1 > /dev/null 2>&1
+    #route delete $alias_ip_address 127.0.0.1 > /dev/null 2>&1
   fi
   ifconfig $interface inet 0.0.0.0 netmask 0.0.0.0 \
                broadcast 255.255.255.255 up
@@ -82,7 +82,6 @@
   fi
   if [ x$old_ip_address != x ] && [ x$old_ip_address != x$new_ip_address ]; then
     ifconfig $interface inet -alias $old_ip_address $medium
-    route delete $old_ip_address 127.1 >/dev/null 2>&1
     for router in $old_routers; do
       route delete default $router >/dev/null 2>&1
     done
@@ -99,7 +98,6 @@
      [ x$reason = xBOUND ] || [ x$reason = xREBOOT ]; then
     ifconfig $interface inet $new_ip_address $new_netmask_arg \
                                        $new_broadcast_arg $medium
-    route add $new_ip_address 127.1 >/dev/null 2>&1
     for router in $new_routers; do
       route add default $router >/dev/null 2>&1
     done
@@ -115,7 +113,6 @@
   if [ x$new_ip_address != x$alias_ip_address ] && [ x$alias_ip_address != x ];
    then
     ifconfig $interface inet alias $alias_ip_address $alias_subnet_arg
-    route add $alias_ip_address 127.0.0.1
   fi
   echo search $new_domain_name >/etc/resolv.conf
   for nameserver in $new_domain_name_servers; do
@@ -127,11 +124,9 @@
 if [ x$reason = xEXPIRE ] || [ x$reason = xFAIL ]; then
   if [ x$alias_ip_address != x ]; then
     ifconfig $interface inet -alias $alias_ip_address > /dev/null 2>&1
-    route delete $alias_ip_address 127.0.0.1 > /dev/null 2>&1
   fi
   if [ x$old_ip_address != x ]; then
     ifconfig $interface inet -alias $old_ip_address $medium
-    route delete $old_ip_address 127.1 >/dev/null 2>&1
     for router in $old_routers; do
       route delete default $router >/dev/null 2>&1
     done
@@ -147,7 +142,6 @@
   fi
   if [ x$alias_ip_address != x ]; then
     ifconfig $interface inet alias $alias_ip_address $alias_subnet_arg
-    route add $alias_ip_address 127.0.0.1
   fi
   exit_with_hooks 0
 fi
@@ -155,7 +149,6 @@
 if [ x$reason = xTIMEOUT ]; then
   if [ x$alias_ip_address != x ]; then
     ifconfig $interface inet -alias $alias_ip_address > /dev/null 2>&1
-    route delete $alias_ip_address 127.0.0.1 > /dev/null 2>&1
   fi
   ifconfig $interface inet $new_ip_address $new_netmask_arg \
                                        $new_broadcast_arg $medium
@@ -167,9 +160,7 @@
       if [ x$new_ip_address != x$alias_ip_address ] && \
                        [ x$alias_ip_address != x ]; then
        ifconfig $interface inet alias $alias_ip_address $alias_subnet_arg
-       route add $alias_ip_address 127.0.0.1
       fi
-      route add $new_ip_address 127.1 >/dev/null 2>&1
       for router in $new_routers; do
        route add default $router >/dev/null 2>&1
       done


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->obrien 
Responsible-Changed-By: msmith 
Responsible-Changed-When: Wed Jun 23 17:09:53 PDT 1999 
Responsible-Changed-Why:  
David is Mr DHCP 

From: "Patrick Bihan-Faou" <patrick@mindstep.com>
To: <freebsd-gnats-submit@freebsd.org>, <m.seaman@inpharmatica.co.uk>
Cc:  
Subject: Re: bin/12136: /sbin/dhclient-script: weird route commands
Date: Thu, 9 Dec 1999 01:41:51 -0500

 Hi,
 The replacement script for /sbin/dhclient-script submitted in PR bin/15342
 fixes that problem.
 
 Patrick.
 
 --
 www.mindstep.com
 
 
 

From: Matthew Seaman <m.seaman@inpharmatica.co.uk>
To: Patrick Bihan-Faou <patrick@mindstep.com>
Cc: freebsd-gnats-submit@freebsd.org
Subject: Re: bin/12136: /sbin/dhclient-script: weird route commands
Date: Thu, 09 Dec 1999 09:04:14 +0000

 Patrick Bihan-Faou wrote:
 > 
 > Hi,
 > The replacement script for /sbin/dhclient-script submitted in PR bin/15342
 > fixes that problem.
 
 So it does, in the same way as the patch I submitted with PR bin/12136, by
 commenting out:
 
 #               route add $ip 127.0.0.1 > /dev/null 2>&1
 
 and similar.
 
 As far as I can tell, this is unnecessary since FreeBSD already adds the route
 simply by ifconfig'ing up the interface
 
 If bin/15342 is committed as it stands, then please do close bin/12136.
 
 	Cheers
 
 	Matthew
 
 -- 
            Certe, Toto, sentio nos in Kansate non iam adesse.
 
    Dr. Matthew Seaman, Inpharmatica Ltd, 60 Charlotte St, London, W1P 2AX
             Tel: +44 171 631 4644 x229  Fax: +44 171 631 4844
 

From: Matthew Seaman <m.seaman@inpharmatica.co.uk>
To: freebsd-gnats-submit@freebsd.org
Cc:  
Subject: Re: bin/12136: /sbin/dhclient-script: weird route commands
Date: Tue, 14 Dec 1999 11:04:37 +0000

 Please close this PR, since equivalents to the suggested changes have been
 committed (and MFC'd) for version 1.8 of
 src/contrib/isc-dhcp/client/scripts/freebsd (Ref. PR's conf/14098, misc/15183)
 and the observed problem no-longer occurs.  
 
 	Cheers,
 
 	Matthew
 
 -- 
            Certe, Toto, sentio nos in Kansate non iam adesse.
 
    Dr. Matthew Seaman, Inpharmatica Ltd, 60 Charlotte St, London, W1P 2AX
             Tel: +44 171 631 4644 x229  Fax: +44 171 631 4844
 
State-Changed-From-To: open->closed 
State-Changed-By: obrien 
State-Changed-When: Fri Dec 17 18:04:49 PST 1999 
State-Changed-Why:  
problem has been fixed. 
>Unformatted:
