CVS commit: src/dist/dhcp

2013-06-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jun 20 18:39:16 UTC 2013

Removed Files:
src/dist/dhcp: ANONCVS CHANGES COPYRIGHT LICENSE Makefile Makefile.conf
Makefile.dist README RELNOTES configure site.conf
src/dist/dhcp/client: Makefile.dist clparse.c dhclient-script.8
dhclient.8 dhclient.c dhclient.conf dhclient.conf.5
dhclient.leases.5
src/dist/dhcp/client/scripts: bsdos freebsd linux netbsd nextstep
openbsd solaris
src/dist/dhcp/common: Makefile.dist alloc.c bpf.c comapi.c conflex.c
ctrace.c dhcp-eval.5 dhcp-options.5 discover.c dispatch.c dlpi.c
dns.c ethernet.c execute.c fddi.c icmp.c inet.c lpf.c memory.c
nit.c options.c packet.c parse.c print.c raw.c resolv.c socket.c
tables.c tr.c tree.c upf.c
src/dist/dhcp/contrib: 3.0b1-lease-convert dhcp.spec sethostname.sh
solaris.init
src/dist/dhcp/contrib/ms2isc: Registry.pm ms2isc.pl readme.txt
src/dist/dhcp/dhcpctl: Makefile.dist callback.c cltest.c dhcpctl.3
dhcpctl.c dhcpctl.h omshell.1 omshell.c remote.c
src/dist/dhcp/doc: IANA-arp-parameters api+protocol
draft-ietf-dhc-authentication-14.txt draft-ietf-dhc-dhcp-dns-12.txt
draft-ietf-dhc-failover-07.txt rfc1542.txt rfc2131.txt rfc2132.txt
rfc2485.txt rfc2489.txt rfc951.txt
src/dist/dhcp/doc/ja_JP.eucJP: dhclient-script.8 dhclient.8
dhclient.conf.5 dhclient.leases.5 dhcp-eval.5 dhcp-options.5
src/dist/dhcp/dst: Makefile.dist base64.c dst_api.c dst_internal.h
dst_support.c hmac_link.c md5.h md5_dgst.c md5_locl.h prandom.c
src/dist/dhcp/includes: cdefs.h ctrace.h dhcp.h dhcpd.h dhctoken.h
failover.h inet.h osdep.h site.h statement.h tree.h version.h
src/dist/dhcp/includes/arpa: nameser.h nameser_compat.h
src/dist/dhcp/includes/cf: aix.h alphaosf.h bsdos.h cygwin32.h
freebsd.h hpux.h irix.h linux.h netbsd.h nextstep.h openbsd.h qnx.h
rhapsody.h sample.h sco.h sunos4.h sunos5-5.h ultrix.h
src/dist/dhcp/includes/isc-dhcp: boolean.h dst.h int.h lang.h list.h
result.h types.h
src/dist/dhcp/includes/minires: minires.h res_update.h resolv.h
src/dist/dhcp/includes/netinet: if_ether.h ip.h ip_icmp.h udp.h
src/dist/dhcp/includes/omapip: alloc.h buffer.h convert.h hash.h
omapip.h omapip_p.h trace.h trace_mr.h
src/dist/dhcp/minires: Makefile.dist ns_date.c ns_name.c ns_parse.c
ns_samedomain.c ns_sign.c ns_verify.c res_comp.c res_findzonecut.c
res_init.c res_mkquery.c res_mkupdate.c res_query.c res_send.c
res_sendsigned.c res_update.c
src/dist/dhcp/omapip: Makefile.dist alloc.c array.c auth.c buffer.c
connection.c convert.c dispatch.c errwarn.c generic.c handle.c
hash.c inet_addr.c iscprint.c listener.c message.c mrtrace.c
omapi.3 protocol.c result.c support.c test.c toisc.c trace.c
src/dist/dhcp/relay: Makefile.dist dhcrelay.8 dhcrelay.c
src/dist/dhcp/server: Makefile.dist bootp.c class.c confpars.c db.c
ddns.c dhcp.c dhcpd.8 dhcpd.c dhcpd.conf dhcpd.conf.5
dhcpd.leases.5 failover.c mdb.c omapi.c salloc.c stables.c
src/dist/dhcp/tests/failover: dhcp-1.cf dhcp-2.cf new-failover

Log Message:
buy ancient code


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r0 src/dist/dhcp/ANONCVS src/dist/dhcp/CHANGES \
src/dist/dhcp/LICENSE src/dist/dhcp/site.conf
cvs rdiff -u -r1.2 -r0 src/dist/dhcp/COPYRIGHT
cvs rdiff -u -r1.3 -r0 src/dist/dhcp/Makefile src/dist/dhcp/Makefile.dist \
src/dist/dhcp/configure
cvs rdiff -u -r1.4 -r0 src/dist/dhcp/Makefile.conf src/dist/dhcp/README \
src/dist/dhcp/RELNOTES
cvs rdiff -u -r1.3 -r0 src/dist/dhcp/client/Makefile.dist
cvs rdiff -u -r1.10 -r0 src/dist/dhcp/client/clparse.c
cvs rdiff -u -r1.5 -r0 src/dist/dhcp/client/dhclient-script.8
cvs rdiff -u -r1.9 -r0 src/dist/dhcp/client/dhclient.8 \
src/dist/dhcp/client/dhclient.conf.5
cvs rdiff -u -r1.22 -r0 src/dist/dhcp/client/dhclient.c
cvs rdiff -u -r1.1.1.1 -r0 src/dist/dhcp/client/dhclient.conf
cvs rdiff -u -r1.6 -r0 src/dist/dhcp/client/dhclient.leases.5
cvs rdiff -u -r1.1.1.1 -r0 src/dist/dhcp/client/scripts/bsdos \
src/dist/dhcp/client/scripts/netbsd src/dist/dhcp/client/scripts/nextstep \
src/dist/dhcp/client/scripts/openbsd src/dist/dhcp/client/scripts/solaris
cvs rdiff -u -r1.4 -r0 src/dist/dhcp/client/scripts/freebsd
cvs rdiff -u -r1.3 -r0 src/dist/dhcp/client/scripts/linux
cvs rdiff -u -r1.3 -r0 src/dist/dhcp/common/Makefile.dist \
src/dist/dhcp/common/ctrace.c src/dist/dhcp/common/dispatch.c \
src/dist/dhcp/common/dlpi.c src/dist/dhcp/common/ethernet.c \
src/dist/dhcp/common/lpf.c src/dist/dhcp/common/nit.c \
src/dist/dhcp/common/tr.c src/dist/dhcp/common/upf.c

CVS commit: src/dist/dhcp/dst

2011-09-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Sep 22 12:38:34 UTC 2011

Modified Files:
src/dist/dhcp/dst: prandom.c

Log Message:
check the result of malloc (Maksymilian Arciemowicz)


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/dist/dhcp/dst/prandom.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/dist/dhcp/dst/prandom.c
diff -u src/dist/dhcp/dst/prandom.c:1.6 src/dist/dhcp/dst/prandom.c:1.7
--- src/dist/dhcp/dst/prandom.c:1.6	Tue Jan 26 14:11:00 2010
+++ src/dist/dhcp/dst/prandom.c	Thu Sep 22 08:38:33 2011
@@ -1,5 +1,5 @@
 #ifndef LINT
-static const char rcsid[] = $Header: /cvsroot/src/dist/dhcp/dst/prandom.c,v 1.6 2010/01/26 19:11:00 drochner Exp $;
+static const char rcsid[] = $Header: /cvsroot/src/dist/dhcp/dst/prandom.c,v 1.7 2011/09/22 12:38:33 christos Exp $;
 #endif
 /*
  * Portions Copyright (c) 1995-1998 by Trusted Information Systems, Inc.
@@ -26,6 +26,7 @@
 #include fcntl.h
 #include time.h
 #include dirent.h
+#include err.h
 #include sys/param.h
 #include sys/stat.h
 #include sys/time.h
@@ -454,6 +455,8 @@
 	if (hash-step  1) {	/* if using subset of input data */
 		tmp_size = size / hash-step + 2;
 		abuf = tp = malloc(tmp_size);
+		if (tp == NULL)
+			err(1, malloc);
 		tmp = tp;
 		for (cnt = 0, i = hash-curr; i  size; i += hash-step, cnt++)
 			*(tp++) = input[i];



CVS commit: src/dist/dhcp/client

2011-08-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Aug 17 08:06:38 UTC 2011

Modified Files:
src/dist/dhcp/client: dhclient.c

Log Message:
Instead of printing the raw suspect value instead of the name (!?!?), print the
name and the suspect value vis encoded.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/dist/dhcp/client/dhclient.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/dist/dhcp/client/dhclient.c
diff -u src/dist/dhcp/client/dhclient.c:1.21 src/dist/dhcp/client/dhclient.c:1.22
--- src/dist/dhcp/client/dhclient.c:1.21	Wed Apr  6 16:24:16 2011
+++ src/dist/dhcp/client/dhclient.c	Wed Aug 17 04:06:38 2011
@@ -32,11 +32,12 @@
 
 #ifndef lint
 static char ocopyright[] =
-$Id: dhclient.c,v 1.21 2011/04/06 20:24:16 christos Exp $ Copyright (c) 2004-2005 Internet Systems Consortium.  All rights reserved.\n;
+$Id: dhclient.c,v 1.22 2011/08/17 08:06:38 christos Exp $ Copyright (c) 2004-2005 Internet Systems Consortium.  All rights reserved.\n;
 #endif /* not lint */
 
 #include dhcpd.h
 #include version.h
+#include vis.h
 
 TIME default_lease_time = 43200; /* 12 hours... */
 TIME max_lease_time = 86400; /* 24 hours... */
@@ -86,6 +87,14 @@
 
 void do_release(struct client_state *);
 
+static void
+suspect(const char *name, const char *value)
+{
+	char buf[1024];
+	(void)strnvis(buf, sizeof(buf), value, VIS_WHITE);
+	log_error(suspect value in %s option (%s) - discarded, name, buf);
+}
+
 #if !defined (SMALL)
 static isc_result_t
 verify_addr (omapi_object_t *l, omapi_addr_t *addr)
@@ -2492,11 +2501,8 @@
 	client_envadd(es-client, es-prefix,
 		  name, %s, value);
 } else {
-	log_error(suspect value in %s 
-		  option - discarded,
-		  name);
+	suspect(name, value);
 }
-
 data_string_forget (data, MDL);
 			}
 		}
@@ -2576,9 +2582,7 @@
 			client_envadd(client, prefix, filename,
   %s, lease-filename);
 		} else {
-			log_error(suspect value in %s 
-  option - discarded,
-  lease-filename);
+			suspect(filename, lease-filename);
 		}
 	}
 
@@ -2589,9 +2593,7 @@
 			client_envadd (client, prefix, server_name,
    %s, lease-server_name);
 		} else {
-			log_error(suspect value in %s 
-  option - discarded,
-  lease-server_name);
+			suspect(server_mame, lease-server_name);
 		}
 	}
 	for (i = 0; i  lease - options - universe_count; i++) {



CVS commit: src/dist/dhcp

2011-08-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Aug 16 16:36:38 UTC 2011

Modified Files:
src/dist/dhcp/common: dns.c
src/dist/dhcp/dhcpctl: omshell.c
src/dist/dhcp/server: ddns.c

Log Message:
gcc-4.5 fixes


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/dist/dhcp/common/dns.c
cvs rdiff -u -r1.5 -r1.6 src/dist/dhcp/dhcpctl/omshell.c
cvs rdiff -u -r1.7 -r1.8 src/dist/dhcp/server/ddns.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/dist/dhcp/common/dns.c
diff -u src/dist/dhcp/common/dns.c:1.6 src/dist/dhcp/common/dns.c:1.7
--- src/dist/dhcp/common/dns.c:1.6	Thu Aug 11 13:13:21 2005
+++ src/dist/dhcp/common/dns.c	Tue Aug 16 12:36:38 2011
@@ -33,7 +33,7 @@
 
 #ifndef lint
 static char copyright[] =
-$Id: dns.c,v 1.6 2005/08/11 17:13:21 drochner Exp $ Copyright (c) 2004 Internet Systems Consortium.  All rights reserved.\n;
+$Id: dns.c,v 1.7 2011/08/16 16:36:38 christos Exp $ Copyright (c) 2004 Internet Systems Consortium.  All rights reserved.\n;
 #endif /* not lint */
 
 #include dhcpd.h
@@ -713,18 +713,23 @@
 	result = minires_nupdate (resolver_state, ISC_LIST_HEAD (updqueue));
 
 	if (result != ISC_R_SUCCESS) {
-		if (result == YXRRSET || result == YXDOMAIN ||
-		result == NXRRSET || result == NXDOMAIN)
+		switch ((ns_rcode)result) {
+		case YXRRSET:
+		case YXDOMAIN:
+		case NXRRSET:
+		case NXDOMAIN:
 			log_error (Forward map from %.*s to %s already in use,
    (int)ddns_fwd_name - len,
    (const char *)ddns_fwd_name - data,
    ddns_address);
-		else
+			break;
+		default:
 			log_error (Can't update forward map %.*s to %s: %s,
    (int)ddns_fwd_name - len,
    (const char *)ddns_fwd_name - data,
    ddns_address, isc_result_totext (result));
-
+			break;
+		}
 	} else {
 		log_info (Added new forward map from %.*s to %s,
 			  (int)ddns_fwd_name - len,

Index: src/dist/dhcp/dhcpctl/omshell.c
diff -u src/dist/dhcp/dhcpctl/omshell.c:1.5 src/dist/dhcp/dhcpctl/omshell.c:1.6
--- src/dist/dhcp/dhcpctl/omshell.c:1.5	Thu Aug 11 13:13:21 2005
+++ src/dist/dhcp/dhcpctl/omshell.c	Tue Aug 16 12:36:38 2011
@@ -34,7 +34,7 @@
 
 #ifndef lint
 static char copyright[] =
-$Id: omshell.c,v 1.5 2005/08/11 17:13:21 drochner Exp $ Copyright (c) 2004 Internet Systems Consortium.  All rights reserved.\n;
+$Id: omshell.c,v 1.6 2011/08/16 16:36:38 christos Exp $ Copyright (c) 2004 Internet Systems Consortium.  All rights reserved.\n;
 #endif /* not lint */
 
 #include time.h
@@ -182,7 +182,7 @@
 	check(status, new_parse());
 	
 	token = next_token (val, (unsigned *)0, cfile);
-	switch (token) {
+	switch ((int)token) {
 		  default:
 		parse_warn (cfile, unknown token: %s, val);
 		skip_to_semi (cfile);

Index: src/dist/dhcp/server/ddns.c
diff -u src/dist/dhcp/server/ddns.c:1.7 src/dist/dhcp/server/ddns.c:1.8
--- src/dist/dhcp/server/ddns.c:1.7	Thu Aug 11 13:13:30 2005
+++ src/dist/dhcp/server/ddns.c	Tue Aug 16 12:36:38 2011
@@ -34,7 +34,7 @@
 
 #ifndef lint
 static char copyright[] =
-$Id: ddns.c,v 1.7 2005/08/11 17:13:30 drochner Exp $ Copyright (c) 2004-2005 Internet Systems Consortium.  All rights reserved.\n;
+$Id: ddns.c,v 1.8 2011/08/16 16:36:38 christos Exp $ Copyright (c) 2004-2005 Internet Systems Consortium.  All rights reserved.\n;
 #endif /* not lint */
 
 #include dhcpd.h
@@ -724,7 +724,7 @@
 	  try_rev:
 		if (find_bound_string (ddns_rev_name,
    lease - scope, ddns-rev-name)) {
-			if (ddns_remove_ptr(ddns_rev_name) == NOERROR) {
+			if ((ns_rcode)ddns_remove_ptr(ddns_rev_name) == NOERROR) {
 unset (lease - scope, ddns-rev-name);
 if (client_updated)
 	unset (lease - scope,



CVS commit: src/dist/dhcp

2011-08-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Aug 15 21:12:44 UTC 2011

Modified Files:
src/dist/dhcp/common: discover.c options.c
src/dist/dhcp/server: dhcp.c

Log Message:
Fix CVS-2011-2748, malformed packets can cause server to crash causing a DoS.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/dist/dhcp/common/discover.c
cvs rdiff -u -r1.6 -r1.7 src/dist/dhcp/common/options.c
cvs rdiff -u -r1.11 -r1.12 src/dist/dhcp/server/dhcp.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/dist/dhcp/common/discover.c
diff -u src/dist/dhcp/common/discover.c:1.11 src/dist/dhcp/common/discover.c:1.12
--- src/dist/dhcp/common/discover.c:1.11	Wed Oct 31 11:26:51 2007
+++ src/dist/dhcp/common/discover.c	Mon Aug 15 17:12:43 2011
@@ -34,7 +34,7 @@
 
 #ifndef lint
 static char copyright[] =
-$Id: discover.c,v 1.11 2007/10/31 15:26:51 gdt Exp $ Copyright (c) 2004-2005 Internet Systems Consortium.  All rights reserved.\n;
+$Id: discover.c,v 1.12 2011/08/15 21:12:43 christos Exp $ Copyright (c) 2004-2005 Internet Systems Consortium.  All rights reserved.\n;
 #endif /* not lint */
 
 #include dhcpd.h
@@ -830,6 +830,17 @@
 	}
 	if (result == 0)
 		return ISC_R_UNEXPECTED;
+	/*
+	 * If we didn't at least get the fixed portion of the BOOTP
+	 * packet, drop the packet.
+	 * Previously we allowed packets with no sname or filename
+	 * as we were aware of at least one client that did.  But
+	 * a bug caused short packets to not work and nobody has
+	 * complained, it seems rational to tighten up that
+	 * restriction.
+	 */
+	if (result  DHCP_FIXED_NON_UDP)
+ 		return ISC_R_UNEXPECTED;
 
 	if (bootp_packet_handler) {
 		ifrom.len = 4;

Index: src/dist/dhcp/common/options.c
diff -u src/dist/dhcp/common/options.c:1.6 src/dist/dhcp/common/options.c:1.7
--- src/dist/dhcp/common/options.c:1.6	Thu May 11 05:29:39 2006
+++ src/dist/dhcp/common/options.c	Mon Aug 15 17:12:43 2011
@@ -34,7 +34,7 @@
 
 #ifndef lint
 static char copyright[] =
-$Id: options.c,v 1.6 2006/05/11 09:29:39 mrg Exp $ Copyright (c) 2004 Internet Systems Consortium.  All rights reserved.\n;
+$Id: options.c,v 1.7 2011/08/15 21:12:43 christos Exp $ Copyright (c) 2004 Internet Systems Consortium.  All rights reserved.\n;
 #endif /* not lint */
 
 #define DHCP_OPTION_DATA
@@ -499,19 +499,26 @@
 	   honor it. */
 
 	if (mms) {
-		main_buffer_size = mms - DHCP_FIXED_LEN;
+		if (mms  576)
+			/* Enforce a minimum packet size... */
+			main_buffer_size = mms - DHCP_FIXED_LEN;
+		else if (mms  1500)
+			/*
+			 * TODO: Packets longer than 1500 bytes really
+			 * should be allowed, but it requires upstream
+			 * changes to the way the packet is allocated.  For
+			 * now, we forbid them.  They won't be needed very
+			 * often anyway.
+			 */
+			main_buffer_size = 1500 - DHCP_FIXED_LEN;
+		else
+			main_buffer_size = mms - DHCP_FIXED_LEN;
 
-		/* Enforce a minimum packet size... */
-		if (main_buffer_size  (576 - DHCP_FIXED_LEN))
-			main_buffer_size = 576 - DHCP_FIXED_LEN;
 	} else if (bootpp) {
-		if (inpacket) {
-			main_buffer_size =
-inpacket - packet_length - DHCP_FIXED_LEN;
-			if (main_buffer_size  64)
-main_buffer_size = 64;
-		} else
-			main_buffer_size = 64;
+		main_buffer_size = 64;
+		if (inpacket != NULL 
+		(inpacket-packet_length = 64 + DHCP_FIXED_NON_UDP))
+			main_buffer_size = inpacket-packet_length - DHCP_FIXED_NON_UDP;
 	} else
 		main_buffer_size = 576 - DHCP_FIXED_LEN;
 

Index: src/dist/dhcp/server/dhcp.c
diff -u src/dist/dhcp/server/dhcp.c:1.11 src/dist/dhcp/server/dhcp.c:1.12
--- src/dist/dhcp/server/dhcp.c:1.11	Thu Jul 16 18:44:27 2009
+++ src/dist/dhcp/server/dhcp.c	Mon Aug 15 17:12:43 2011
@@ -34,7 +34,7 @@
 
 #ifndef lint
 static char copyright[] =
-$Id: dhcp.c,v 1.11 2009/07/16 22:44:27 tonnerre Exp $ Copyright (c) 2004-2005 Internet Systems Consortium.  All rights reserved.\n;
+$Id: dhcp.c,v 1.12 2011/08/15 21:12:43 christos Exp $ Copyright (c) 2004-2005 Internet Systems Consortium.  All rights reserved.\n;
 #endif /* not lint */
 
 #include dhcpd.h
@@ -128,6 +128,7 @@
 	if (packet - packet_type == DHCPREQUEST 
 	packet - raw - ciaddr.s_addr 
 	!packet - raw - giaddr.s_addr 
+	packet - options != NULL 
 	(packet - options - universe_count  agent_universe.index ||
 	 !packet - options - universes [agent_universe.index]))
 	{
@@ -1379,6 +1380,7 @@
 	/* If there were agent options in the incoming packet, return
 	   them. */
 	if (packet - raw - giaddr.s_addr 
+	packet - options != NULL 
 	packet - options - universe_count  agent_universe.index 
 	packet - options - universes [agent_universe.index]) {
 		option_chain_head_reference
@@ -1536,6 +1538,7 @@
 	   them.  Do not return the agent options if they were stashed
 	   on the lease. */
 	if (packet - raw - giaddr.s_addr 
+	packet - options != NULL 
 	packet - options - universe_count  

CVS commit: src/dist/dhcp/client

2010-02-16 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Feb 17 01:17:37 UTC 2010

Modified Files:
src/dist/dhcp/client: dhclient.conf.5

Log Message:
Fix a thinko: the DHCP _client_ is doing the requesting.
Reported by Anonymous in PR misc/39162.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/dist/dhcp/client/dhclient.conf.5

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/dist/dhcp/client/dhclient.conf.5
diff -u src/dist/dhcp/client/dhclient.conf.5:1.8 src/dist/dhcp/client/dhclient.conf.5:1.9
--- src/dist/dhcp/client/dhclient.conf.5:1.8	Thu Aug 11 17:13:21 2005
+++ src/dist/dhcp/client/dhclient.conf.5	Wed Feb 17 01:17:36 2010
@@ -1,4 +1,4 @@
-.\	$Id: dhclient.conf.5,v 1.8 2005/08/11 17:13:21 drochner Exp $
+.\	$Id: dhclient.conf.5,v 1.9 2010/02/17 01:17:36 snj Exp $
 .\
 .\ Copyright (c) 2004 by Internet Systems Consortium, Inc. (ISC)
 .\ Copyright (c) 1996-2003 by Internet Software Consortium
@@ -183,7 +183,7 @@
 The request statement causes the client to request that any server
 responding to the client send the client its values for the specified
 options.   Only the option names should be specified in the request
-statement - not option parameters.   By default, the DHCP server
+statement - not option parameters.   By default, the DHCP client
 requests the subnet-mask, broadcast-address, time-offset, routers,
 domain-name, domain-name-servers and host-name options. 
 .PP



CVS commit: src/dist/dhcp/dst

2010-01-26 Thread Matthias Drochner
Module Name:src
Committed By:   drochner
Date:   Tue Jan 26 19:11:01 UTC 2010

Modified Files:
src/dist/dhcp/dst: dst_api.c dst_internal.h prandom.c

Log Message:
rather than adding braces in the code, define the offending macro
to (void)0. This is what similar code in bind9 (up to 9.5) does.
(native NetBSD code usually does do { } while (/* CONSTCOND */ 0)
in this case)
Anyway, I've checked the code, didn't find ambiguities due to
the empty statements, so the whole thing is harmless.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/dist/dhcp/dst/dst_api.c
cvs rdiff -u -r1.1 -r1.2 src/dist/dhcp/dst/dst_internal.h
cvs rdiff -u -r1.5 -r1.6 src/dist/dhcp/dst/prandom.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/dist/dhcp/dst/dst_api.c
diff -u src/dist/dhcp/dst/dst_api.c:1.6 src/dist/dhcp/dst/dst_api.c:1.7
--- src/dist/dhcp/dst/dst_api.c:1.6	Mon Jan 25 20:33:57 2010
+++ src/dist/dhcp/dst/dst_api.c	Tue Jan 26 19:11:00 2010
@@ -1,5 +1,5 @@
 #ifndef LINT
-static const char rcsid[] = $Header: /cvsroot/src/dist/dhcp/dst/dst_api.c,v 1.6 2010/01/25 20:33:57 drochner Exp $;
+static const char rcsid[] = $Header: /cvsroot/src/dist/dhcp/dst/dst_api.c,v 1.7 2010/01/26 19:11:00 drochner Exp $;
 #endif
 
 /*
@@ -684,10 +684,9 @@
 		if (key_st-dk_func-from_dns_key(key_st, rdata[start],
 		  len - start)  0)
 			return (key_st);
-	} else {
+	} else
 		EREPORT((dst_dnskey_to_public_key(): unsuppored alg %d\n,
 			 alg));
-	}
 
 	SAFE_FREE(key_st);
 	return (key_st);
@@ -746,10 +745,9 @@
 			return (enc_len + loc);
 		else
 			return (-1);
-	} else {
+	} else
 		EREPORT((dst_key_to_dnskey(): Unsupported ALG %d\n,
 			 key-dk_alg));
-	}
 	return (-1);
 }
 
@@ -879,11 +877,10 @@
 		EREPORT((dst_s_read_private_key_file(): Unknown keyfile %d.%d version for %s\n,
 			 file_major, file_minor, name));
 		goto fail;
-	} else if (file_major  major || file_minor  minor) {
+	} else if (file_major  major || file_minor  minor)
 		EREPORT((
 dst_s_read_private_key_file(): Keyfile %s version higher than mine %d.%d MAY FAIL\n,
 name, file_major, file_minor));
-	}
 
 	while (*p++ != '\n') ;	/* skip to end of line */
 

Index: src/dist/dhcp/dst/dst_internal.h
diff -u src/dist/dhcp/dst/dst_internal.h:1.1 src/dist/dhcp/dst/dst_internal.h:1.2
--- src/dist/dhcp/dst/dst_internal.h:1.1	Fri Aug  3 11:35:34 2001
+++ src/dist/dhcp/dst/dst_internal.h	Tue Jan 26 19:11:00 2010
@@ -60,7 +60,7 @@
 #ifdef REPORT_ERRORS
 #define EREPORT(str)		printf str
 #else
-#define EREPORT(str)
+#define EREPORT(str)		(void)0
 #endif
 
 /* use our own special macro to FRRE memory */

Index: src/dist/dhcp/dst/prandom.c
diff -u src/dist/dhcp/dst/prandom.c:1.5 src/dist/dhcp/dst/prandom.c:1.6
--- src/dist/dhcp/dst/prandom.c:1.5	Mon Jan 25 20:33:57 2010
+++ src/dist/dhcp/dst/prandom.c	Tue Jan 26 19:11:00 2010
@@ -1,5 +1,5 @@
 #ifndef LINT
-static const char rcsid[] = $Header: /cvsroot/src/dist/dhcp/dst/prandom.c,v 1.5 2010/01/25 20:33:57 drochner Exp $;
+static const char rcsid[] = $Header: /cvsroot/src/dist/dhcp/dst/prandom.c,v 1.6 2010/01/26 19:11:00 drochner Exp $;
 #endif
 /*
  * Portions Copyright (c) 1995-1998 by Trusted Information Systems, Inc.
@@ -850,9 +850,8 @@
 		i = dst_sign_data(SIG_MODE_ALL, my_key, NULL, 
   (u_char *) counter, hb_size,
   semi_old, sizeof(semi_old));
-		if (i != hb_size) {
+		if (i != hb_size)
 			EREPORT((HMAC SIGNATURE FAILURE %d\n, i));
-		}
 		cnt++;
 		if (size - out  i)	/* Not all data is needed */
 			semi_loc = i = size - out;



CVS commit: src/dist/dhcp/dst

2010-01-25 Thread Matthias Drochner
Module Name:src
Committed By:   drochner
Date:   Mon Jan 25 20:33:57 UTC 2010

Modified Files:
src/dist/dhcp/dst: dst_api.c prandom.c

Log Message:
fix some cases where the EREPORT macro defined to null (as in the NetBSD
build) could change the behaviour of the code in unexpected ways


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/dist/dhcp/dst/dst_api.c
cvs rdiff -u -r1.4 -r1.5 src/dist/dhcp/dst/prandom.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/dist/dhcp/dst/dst_api.c
diff -u src/dist/dhcp/dst/dst_api.c:1.5 src/dist/dhcp/dst/dst_api.c:1.6
--- src/dist/dhcp/dst/dst_api.c:1.5	Thu Aug 11 17:13:21 2005
+++ src/dist/dhcp/dst/dst_api.c	Mon Jan 25 20:33:57 2010
@@ -1,5 +1,5 @@
 #ifndef LINT
-static const char rcsid[] = $Header: /cvsroot/src/dist/dhcp/dst/dst_api.c,v 1.5 2005/08/11 17:13:21 drochner Exp $;
+static const char rcsid[] = $Header: /cvsroot/src/dist/dhcp/dst/dst_api.c,v 1.6 2010/01/25 20:33:57 drochner Exp $;
 #endif
 
 /*
@@ -684,9 +684,10 @@
 		if (key_st-dk_func-from_dns_key(key_st, rdata[start],
 		  len - start)  0)
 			return (key_st);
-	} else
+	} else {
 		EREPORT((dst_dnskey_to_public_key(): unsuppored alg %d\n,
 			 alg));
+	}
 
 	SAFE_FREE(key_st);
 	return (key_st);
@@ -745,9 +746,10 @@
 			return (enc_len + loc);
 		else
 			return (-1);
-	} else
+	} else {
 		EREPORT((dst_key_to_dnskey(): Unsupported ALG %d\n,
 			 key-dk_alg));
+	}
 	return (-1);
 }
 
@@ -877,10 +879,11 @@
 		EREPORT((dst_s_read_private_key_file(): Unknown keyfile %d.%d version for %s\n,
 			 file_major, file_minor, name));
 		goto fail;
-	} else if (file_major  major || file_minor  minor)
+	} else if (file_major  major || file_minor  minor) {
 		EREPORT((
 dst_s_read_private_key_file(): Keyfile %s version higher than mine %d.%d MAY FAIL\n,
 name, file_major, file_minor));
+	}
 
 	while (*p++ != '\n') ;	/* skip to end of line */
 

Index: src/dist/dhcp/dst/prandom.c
diff -u src/dist/dhcp/dst/prandom.c:1.4 src/dist/dhcp/dst/prandom.c:1.5
--- src/dist/dhcp/dst/prandom.c:1.4	Thu Aug 11 17:13:21 2005
+++ src/dist/dhcp/dst/prandom.c	Mon Jan 25 20:33:57 2010
@@ -1,5 +1,5 @@
 #ifndef LINT
-static const char rcsid[] = $Header: /cvsroot/src/dist/dhcp/dst/prandom.c,v 1.4 2005/08/11 17:13:21 drochner Exp $;
+static const char rcsid[] = $Header: /cvsroot/src/dist/dhcp/dst/prandom.c,v 1.5 2010/01/25 20:33:57 drochner Exp $;
 #endif
 /*
  * Portions Copyright (c) 1995-1998 by Trusted Information Systems, Inc.
@@ -850,8 +850,9 @@
 		i = dst_sign_data(SIG_MODE_ALL, my_key, NULL, 
   (u_char *) counter, hb_size,
   semi_old, sizeof(semi_old));
-		if (i != hb_size)
+		if (i != hb_size) {
 			EREPORT((HMAC SIGNATURE FAILURE %d\n, i));
+		}
 		cnt++;
 		if (size - out  i)	/* Not all data is needed */
 			semi_loc = i = size - out;



CVS commit: src/dist/dhcp/common

2010-01-17 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Jan 17 22:42:36 UTC 2010

Modified Files:
src/dist/dhcp/common: conflex.c

Log Message:
Add missing parentheses in ifdef(OLD_LEXER). Found by cppcheck.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/dist/dhcp/common/conflex.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/dist/dhcp/common/conflex.c
diff -u src/dist/dhcp/common/conflex.c:1.5 src/dist/dhcp/common/conflex.c:1.6
--- src/dist/dhcp/common/conflex.c:1.5	Thu Aug 11 17:13:21 2005
+++ src/dist/dhcp/common/conflex.c	Sun Jan 17 22:42:36 2010
@@ -34,7 +34,7 @@
 
 #ifndef lint
 static char copyright[] =
-$Id: conflex.c,v 1.5 2005/08/11 17:13:21 drochner Exp $ Copyright (c) 2004-2005 Internet Systems Consortium.  All rights reserved.\n;
+$Id: conflex.c,v 1.6 2010/01/17 22:42:36 wiz Exp $ Copyright (c) 2004-2005 Internet Systems Consortium.  All rights reserved.\n;
 #endif /* not lint */
 
 #include dhcpd.h
@@ -467,7 +467,7 @@
 			log_fatal(read_number():%s:%d: impossible case, MDL);
 		}
 #else /* OLD_LEXER */
-		if (!seenx  (c == 'x') {
+		if (!seenx  (c == 'x')) {
 			seenx = 1;
 		} else if (!isascii (c) || !isxdigit (c)) {
 			if (c != EOF) {



CVS commit: src/dist/dhcp/common

2009-10-14 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Thu Oct 15 02:18:22 UTC 2009

Modified Files:
src/dist/dhcp/common: dhcp-options.5

Log Message:
Kill bad tab in markup.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/dist/dhcp/common/dhcp-options.5

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/dist/dhcp/common/dhcp-options.5
diff -u src/dist/dhcp/common/dhcp-options.5:1.6 src/dist/dhcp/common/dhcp-options.5:1.7
--- src/dist/dhcp/common/dhcp-options.5:1.6	Thu Aug 11 17:13:21 2005
+++ src/dist/dhcp/common/dhcp-options.5	Thu Oct 15 02:18:22 2009
@@ -1,4 +1,4 @@
-.\	$Id: dhcp-options.5,v 1.6 2005/08/11 17:13:21 drochner Exp $
+.\	$Id: dhcp-options.5,v 1.7 2009/10/15 02:18:22 joerg Exp $
 .\
 .\ Copyright (c) 2004 by Internet Systems Consortium, Inc. (ISC)
 .\ Copyright (c) 1996-2003 by Internet Software Consortium
@@ -1421,7 +1421,7 @@
 	10.0.1.0 255.255.255.0 net-1-rtr.example.com 1,
 	10.2.0.0 255.255.224.0 net-2-0-rtr.example.com 3;
 
-.fi	
+.fi
 .SH VENDOR ENCAPSULATED OPTIONS
 The DHCP protocol defines the \fB vendor-encapsulated-options\fR
 option, which allows vendors to define their own options that will be



CVS commit: src/dist/dhcp/server

2009-07-16 Thread Tonnerre Lombard
Module Name:src
Committed By:   tonnerre
Date:   Thu Jul 16 22:44:27 UTC 2009

Modified Files:
src/dist/dhcp/server: dhcp.c

Log Message:
Fix behavior of dhcpd in the case where clientid and hardware ethernet
definitions are mixed. Fixes a refcount assertion.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/dist/dhcp/server/dhcp.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/dist/dhcp/server/dhcp.c
diff -u src/dist/dhcp/server/dhcp.c:1.10 src/dist/dhcp/server/dhcp.c:1.11
--- src/dist/dhcp/server/dhcp.c:1.10	Fri Mar 31 17:28:50 2006
+++ src/dist/dhcp/server/dhcp.c	Thu Jul 16 22:44:27 2009
@@ -34,7 +34,7 @@
 
 #ifndef lint
 static char copyright[] =
-$Id: dhcp.c,v 1.10 2006/03/31 17:28:50 christos Exp $ Copyright (c) 2004-2005 Internet Systems Consortium.  All rights reserved.\n;
+$Id: dhcp.c,v 1.11 2009/07/16 22:44:27 tonnerre Exp $ Copyright (c) 2004-2005 Internet Systems Consortium.  All rights reserved.\n;
 #endif /* not lint */
 
 #include dhcpd.h
@@ -1763,6 +1763,8 @@
 host_reference (host, h, MDL);
 		}
 		if (!host) {
+			if (hp)
+host_dereference (hp, MDL);
 			find_hosts_by_haddr (hp,
 	 packet - raw - htype,
 	 packet - raw - chaddr,