ports/97333: net/isc-dhcp3-server: fix size of OPTION 51 in DHCPOFFER for *64 ARCHS

Joerg Pulz Joerg.Pulz at frm2.tum.de
Tue May 16 05:40:19 UTC 2006


>Number:         97333
>Category:       ports
>Synopsis:       net/isc-dhcp3-server: fix size of OPTION 51 in DHCPOFFER for *64 ARCHS
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Tue May 16 05:40:18 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Joerg Pulz
>Release:        FreeBSD 6.1-PRERELEASE i386
>Organization:
TU-Munich / ZWE FRM-II
>Environment:
System: FreeBSD hades.admin.frm2 6.1-PRERELEASE FreeBSD 6.1-PRERELEASE #11: Wed Feb 22 19:01:44 CET 2006 root at hades.admin.frm2:/usr/obj/usr/src/sys/HADES i386


	
>Description:
	Beginning with dhcp-3.0.4 the ISC people have slightly changed the way
	the OPTION 51 (IP address lease time) is handled.
	Unfortunately, they broke it for all FreeBSD *64 ARCHS, as time_t is
	uint64_t (8 bytes) on these, instead of uint32_t (4 bytes) like it is
	for all other ARCHS.
	This results in DHCPOFFERs containing an 8 bytes OPTION 51 field which
	is silently dropped/ignored on, at least, Windows XP clients.

	This patch provides a quick fix to solve this problem by setting the
	TIME macro to uint32_t instead of time_t, which obviously results in
	some compiler warnings, because gmtime() and time() require an uint64_t
	value as argument.
	Anyway, it compiles and is working for three people + me, who have
	tested the patch.

	I contacted the ISC DHCP developers about this problem and they have now
	a ticket for this. They will hopefully provide a real patch soon.

	Special thanks to the people who reported this and have tested the
	patch.
>How-To-Repeat:
	
>Fix:

	- apply the patch

--- net_isc-dhcp3-server.diff begins here ---
Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/net/isc-dhcp3-server/Makefile,v
retrieving revision 1.113
diff -u -r1.113 Makefile
--- Makefile	7 May 2006 20:34:01 -0000	1.113
+++ Makefile	16 May 2006 05:18:23 -0000
@@ -8,7 +8,7 @@
 
 PORTNAME=	dhcp
 PORTVERSION=	3.0.4
-#PORTREVISION=	1
+PORTREVISION=	1
 CATEGORIES=	net
 MASTER_SITES=	${MASTER_SITE_ISC}
 MASTER_SITE_SUBDIR=	dhcp dhcp/dhcp-3.0-history
Index: files/patch-includes::cf::freebsd.h
===================================================================
RCS file: /home/ncvs/ports/net/isc-dhcp3-server/files/patch-includes::cf::freebsd.h,v
retrieving revision 1.2
diff -u -r1.2 patch-includes::cf::freebsd.h
--- files/patch-includes::cf::freebsd.h	22 Mar 2004 23:33:09 -0000	1.2
+++ files/patch-includes::cf::freebsd.h	16 May 2006 05:18:23 -0000
@@ -1,6 +1,6 @@
---- includes/cf/freebsd.h.orig	Wed Mar  3 02:32:39 2004
-+++ includes/cf/freebsd.h	Wed Mar  3 02:31:56 2004
-@@ -42,7 +42,7 @@
+--- includes/cf/freebsd.h.orig	Wed Sep  1 19:06:36 2004
++++ includes/cf/freebsd.h	Mon May 15 09:13:18 2006
+@@ -33,7 +33,7 @@
   */
  
  #include <syslog.h>
@@ -9,7 +9,16 @@
  #include <string.h>
  #include <paths.h>
  #include <errno.h>
-@@ -101,6 +101,10 @@
+@@ -82,7 +82,7 @@
+ 
+ /* Time stuff... */
+ #include <sys/time.h>
+-#define TIME time_t
++#define TIME u_int32_t
+ #define GET_TIME(x)	time ((x))
+ 
+ #define HAVE_SA_LEN
+@@ -97,6 +97,10 @@
  #define SOCKLEN_T int
  #endif
  
@@ -20,7 +29,7 @@
  #if defined (USE_DEFAULT_NETWORK)
  #  define USE_BPF
  #endif
-@@ -111,6 +115,9 @@
+@@ -107,6 +111,9 @@
   #endif /* HAVE_DEV_RANDOM */
  
  const char *cmds[] = {
@@ -30,7 +39,7 @@
  	"/bin/ps -axlw 2>&1",
  	"/usr/sbin/arp -an 2>&1",
  	"/usr/bin/netstat -an 2>&1",
-@@ -121,10 +128,12 @@
+@@ -117,10 +124,12 @@
  	"/usr/sbin/iostat  2>&1",
  	"/usr/bin/vmstat  2>&1",
  	"/usr/bin/w  2>&1",
@@ -43,7 +52,7 @@
  	"/tmp",
  	"/usr/tmp",
  	".",
-@@ -134,13 +143,16 @@
+@@ -130,13 +139,16 @@
  	"/var/mail",
  	"/home",
  	"/usr/home",
--- net_isc-dhcp3-server.diff ends here ---


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



More information about the freebsd-ports-bugs mailing list