Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Aug 2004 08:32:00 GMT
From:      Matthew Luckie <mjl@luckie.org.nz>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   bin/70355: [patch] dhclient-script is chatty with RENEW messages
Message-ID:  <200408120832.i7C8W0Q1038941@www.freebsd.org>
Resent-Message-ID: <200408120840.i7C8eMsb078136@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         70355
>Category:       bin
>Synopsis:       [patch] dhclient-script is chatty with RENEW messages
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Aug 12 08:40:22 GMT 2004
>Closed-Date:
>Last-Modified:
>Originator:     Matthew Luckie
>Release:        FreeBSD 4.10
>Organization:
University of Waikato
>Environment:
FreeBSD latex.plunket.luckie.org.nz 4.10-RELEASE FreeBSD 4.10-RELEASE #6: Fri Jun 11 18:34:18 NZST 2004     root@latex.plunket.luckie.org.nz:/usr/src/sys/compile/latex  alpha
>Description:
      /sbin/dhclient-script logs the network number and broadcast address when RENEW is issued, even if they have not changed and the IP address RENEW'd is the same as the current lease.  this can be a log filler if the dhcp server is in a cheap ADSL modem that sets the lease time to be really small.  a patch is enclosed.  perhaps the $reason clause could be expanded or dropped entirely, but the RENEW case is painful so this patch handles that case.

Aug 12 07:00:14 latex dhclient: New Network Number: 203.118.169.0
Aug 12 07:00:14 latex dhclient: New Broadcast Address: 203.118.169.255
Aug 12 07:00:45 latex dhclient: New Network Number: 203.118.169.0
Aug 12 07:00:45 latex dhclient: New Broadcast Address: 203.118.169.255
Aug 12 07:01:13 latex dhclient: New Network Number: 203.118.169.0
Aug 12 07:01:13 latex dhclient: New Broadcast Address: 203.118.169.255
>How-To-Repeat:
      set a short TTL on leases with dhcpd if you don't own a cheap ADSL modem.
>Fix:
--- /usr/src/contrib/isc-dhcp/client/scripts/freebsd.orig    Mon Feb  2 09:56:52 2004
+++ /usr/src/contrib/isc-dhcp/client/scripts/freebsd       Thu Aug 12 19:50:04 2004
@@ -44,14 +44,31 @@
   fi
 fi
 
+# Only print out the new network number if it is new 
 if [ x$new_network_number != x ]; then
-   $LOGGER New Network Number: $new_network_number
+  if [ x$reason = xRENEW ]; then
+    if [ x$old_network_number != x ] && 
+       [ x$old_network_number != x$new_network_number ]; then
+         $LOGGER New Network Number: $new_network_number
+    fi
+  else
+    $LOGGER New Network Number: $new_network_number
+  fi
 fi
 
+# Only print out the new broadcast address if it is new 
 if [ x$new_broadcast_address != x ]; then
- $LOGGER New Broadcast Address: $new_broadcast_address
+  if [ x$reason = xRENEW ]; then
+    if [ x$old_broadcast_address != x ] && 
+       [ x$old_broadcast_address != x$new_broadcast_address ]; then
+         $LOGGER New Broadcast Address: $new_broadcast_address
+    fi
+  else
+    $LOGGER New Broadcast Address: $new_broadcast_address
+  fi
   new_broadcast_arg="broadcast $new_broadcast_address"
 fi
+
 if [ x$old_broadcast_address != x ]; then
   old_broadcast_arg="broadcast $old_broadcast_address"
 fi

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200408120832.i7C8W0Q1038941>