From nobody@FreeBSD.org  Thu Aug 12 08:32:03 2004
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 17C0F16A4CE
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 12 Aug 2004 08:32:03 +0000 (GMT)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id EAA2943D49
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 12 Aug 2004 08:32:02 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.12.11/8.12.11) with ESMTP id i7C8W0j0038942
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 12 Aug 2004 08:32:00 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.12.11/8.12.11/Submit) id i7C8W0Q1038941;
	Thu, 12 Aug 2004 08:32:00 GMT
	(envelope-from nobody)
Message-Id: <200408120832.i7C8W0Q1038941@www.freebsd.org>
Date: Thu, 12 Aug 2004 08:32:00 GMT
From: Matthew Luckie <mjl@luckie.org.nz>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [patch] dhclient-script is chatty with RENEW messages
X-Send-Pr-Version: www-2.3

>Number:         70355
>Category:       bin
>Synopsis:       [patch] dhclient-script is chatty with RENEW messages
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Aug 12 08:40:22 GMT 2004
>Closed-Date:    Thu Nov 03 00:53:40 GMT 2005
>Last-Modified:  Thu Nov 03 00:53:40 GMT 2005
>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:
State-Changed-From-To: open->closed 
State-Changed-By: brooks 
State-Changed-When: Thu Nov 3 00:50:47 GMT 2005 
State-Changed-Why:  
This isn't an issue in the script in 6.x and it appears fixed in 5.x. 
Realisticly, we're not likely to fix this in 4.x at this late date given 
that it's mostly cosmetic. 

Thanks for the submittion though. 

-- Brooks 

http://www.freebsd.org/cgi/query-pr.cgi?pr=70355 
>Unformatted:
