--- dhcpcd-3.2.3.orig/dhcpcd.c
+++ dhcpcd-3.2.3/dhcpcd.c
@@ -82,6 +82,7 @@
 	{"msscr",       no_argument,        NULL, 'S'},
 	{"test",        no_argument,        NULL, 'T'},
 	{"nonis",       no_argument,        NULL, 'Y'},
+	{"pidfile",     required_argument,  NULL, 'P'},
 	{"help",        no_argument,        &dohelp, 1},
 	{"version",     no_argument,        &doversion, 1},
 #ifdef THERE_IS_NO_FORK
@@ -138,7 +139,7 @@
 	printf ("usage: "PACKAGE" [-adknpEGHMNRSTY] [-c script] [-h hostname] [-i classID]\n"
 		"              [-l leasetime] [-m metric] [-r ipaddress] [-s ipaddress]\n"
 		"              [-t timeout] [-u userclass] [-F none | ptr | both]\n"
-		"              [-I clientID] <interface>\n");
+		"              [-I clientID] [-P pidfile] <interface>\n");
 }
 
 int main(int argc, char **argv)
@@ -177,6 +178,7 @@
 	options->doipv4ll = true;
 	options->doduid = true;
 	options->timeout = DEFAULT_TIMEOUT;
+	snprintf(options->pidfile, sizeof (options->pidfile), "none");
 
 	gethostname (options->hostname, sizeof (options->hostname));
 	if (strcmp (options->hostname, "(none)") == 0 ||
@@ -186,7 +188,7 @@
 	/* Don't set any optional arguments here so we retain POSIX
 	 * compatibility with getopt */
 	while ((opt = getopt_long(argc, argv, EXTRA_OPTS
-				  "c:dh:i:kl:m:npr:s:t:u:xAEF:GHI:LMNRSTY",
+				  "c:dh:i:kl:m:npr:s:t:u:xAEF:GHI:LMNRSTYP:",
 				  longopts, &option_index)) != -1)
 	{
 		switch (opt) {
@@ -408,6 +410,9 @@
 			case 'Y':
 				options->donis = false;
 				break;
+			case 'P':
+				snprintf(options->pidfile, sizeof (options->pidfile), "%s", optarg);
+				break;
 			case '?':
 				usage ();
 				goto abort;
@@ -510,8 +515,9 @@
 	prefix = xmalloc (sizeof (char) * (IF_NAMESIZE + 3));
 	snprintf (prefix, IF_NAMESIZE, "%s: ", options->interface);
 	setlogprefix (prefix);
-	snprintf (options->pidfile, sizeof (options->pidfile), PIDFILE,
-		  options->interface);
+	if (strcmp(options->pidfile, "none") == 0)
+		snprintf (options->pidfile, sizeof (options->pidfile), PIDFILE,
+			  options->interface);
 	free (prefix);
 
 	chdir ("/");
--- dhcpcd-3.2.3.orig/arp.c
+++ dhcpcd-3.2.3/arp.c
@@ -236,10 +236,14 @@
 
 			memset (reply, 0, iface->buffer_length);
 			if ((bytes = get_packet (iface, (unsigned char *) reply,
-						 buffer,
+						 iface->buffer_length, buffer,
 						 &buflen, &bufpos)) == -1)
 				break;
 
+			/* check that we've got complete arp header */
+			if ((size_t) bytes < sizeof (*reply))
+				continue;
+
 			/* Only these types are recognised */
 			if (reply->ar_op != htons (ARPOP_REPLY))
 				continue;
@@ -249,7 +253,7 @@
 				continue;
 			if (reply->ar_pln != sizeof (address))
 				continue;
-			if ((unsigned) bytes < sizeof (reply) + 
+			if ((size_t) bytes < sizeof (*reply) + 
 			    2 * (4 + reply->ar_hln))
 				continue;
 
--- dhcpcd-3.2.3.orig/dhcp.c
+++ dhcpcd-3.2.3/dhcp.c
@@ -178,6 +178,13 @@
 			if (set_mtu (iface->name, MTU_MIN) == 0)
 				sz = MTU_MIN;
 		}
+		else if(sz > (sizeof(dhcpmessage_t) + DHCP_UDP_LEN)) {
+			/*
+			 * bigger dhcp messages are not supported,
+			 * so don't indicate more (full MTU) ...
+			 */
+			sz = sizeof(dhcpmessage_t) + DHCP_UDP_LEN;
+		}
 		sz = htons (sz);
 		memcpy (p, &sz, 2);
 		p += 2;
@@ -327,6 +334,34 @@
 #endif
 
 	message_length = p - m;
+	
+#if __linux__
+	/* send_packet() always sends to the hardware broadcast address, which is
+	   broken when the client and server are in different broadcast domains
+	   and using a dhcp-helper and a renewal is in progress, since the client 
+	   sends direct to the server and the intermediate router will likely drop 
+	   broadcast addresses. 
+
+	   This fix only works under Linux, where we have a UDP socket suitabley 
+	   set up which we can use to send in that case. */
+
+	if (to.s_addr != 0 && iface->listen_fd != -1)
+	  {
+	    struct sockaddr_in dest;
+	    dest.sin_family = AF_INET;
+	    dest.sin_port = htons (DHCP_SERVER_PORT);
+	    dest.sin_addr = to;
+
+	    logger (LOG_DEBUG, "sending %s with xid 0x%x over UDP socket",
+		    dhcp_message (type), xid);
+	    
+	    retval = sendto(iface->listen_fd, message, message_length, 0 , 
+			    (struct sockaddr *)&dest, sizeof(dest));
+	    free(message);
+
+	    return retval;
+	  }
+#endif
 
 	packet = xzalloc (sizeof (*packet));
 	make_dhcp_packet (packet, (unsigned char *) message, message_length,
--- dhcpcd-3.2.3.orig/version.h
+++ dhcpcd-3.2.3/version.h
@@ -0,0 +1 @@
+#define VERSION "3.2.3"
--- dhcpcd-3.2.3.orig/Makefile
+++ dhcpcd-3.2.3/Makefile
@@ -24,6 +24,7 @@
 
 LDADD+=		${LIBRESOLV} ${LIBRT}
 CFLAGS+=	-DINFODIR=\"${INFOD}\" ${FORK} ${RC}
+CFLAGS+=        ${COPTS}
 
 # As version.h is generated by us, hardcode the depend correctly.
 ${SRCS}:	version.h
--- dhcpcd-3.2.3.orig/client.c
+++ dhcpcd-3.2.3/client.c
@@ -321,7 +321,7 @@
 		if (! get_old_lease (state, options))
 #endif
 		{
-			free (dhcp);
+		  /* free (dhcp); */
 			return (false);
 		}
 		state->timeout = 0;
@@ -1007,7 +1007,7 @@
 
 	do {
 		if (get_packet (iface, (unsigned char *) &message,
-				state->buffer,
+				sizeof(message), state->buffer,
 				&state->buffer_len, &state->buffer_pos) == -1)
 			break;
 
--- dhcpcd-3.2.3.orig/dhcpcd.8.in
+++ dhcpcd-3.2.3/dhcpcd.8.in
@@ -40,6 +40,7 @@
 .Op Fl u , -userclass Ar class
 .Op Fl F , -fqdn Ar FQDN
 .Op Fl I , -clientid Ar clientid
+.Op Fl P , -pidfile Ar pidfile
 .Ar interface
 .Nm
 .Fl k , -release
@@ -274,6 +275,11 @@
 over-running its maximum size. DHCP server administrators should update their
 CSR code from the Microsoft specific one to the RFC compliant one as the
 content is fully compatible.
+.It Fl P, -pidfile Ar filename
+Write the PID to
+.Ar filename
+instead of
+.Nm /var/run/dhcpcd- Ns Ar interface Ns Nm .pid.
 .El
 .Ss Restriciting behaviour
 .Nm
--- dhcpcd-3.2.3.orig/dhcpcd.8
+++ dhcpcd-3.2.3/dhcpcd.8
@@ -0,0 +1,371 @@
+.\" Copyright 2006-2008 Roy Marples
+.\" All rights reserved
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.Dd Feb 20, 2008
+.Dt DHCPCD 8 SMM
+.Sh NAME
+.Nm dhcpcd
+.Nd an RFC 2131 compliant DHCP client
+.Sh SYNOPSIS
+.Nm
+.Op Fl dknpAEGHMLNRSTY
+.Op Fl c , -script Ar script
+.Op Fl h , -hostname Ar hostname
+.Op Fl i , -classid Ar classid
+.Op Fl l , -leasetime Ar seconds
+.Op Fl m , -metric Ar metric
+.Op Fl r , -request Ar address
+.Op Fl t , -timeout Ar seconds
+.Op Fl u , -userclass Ar class
+.Op Fl F , -fqdn Ar FQDN
+.Op Fl I , -clientid Ar clientid
+.Op Fl P , -pidfile Ar pidfile
+.Ar interface
+.Nm
+.Fl k , -release
+.Ar interface
+.Nm
+.Fl x , -exit
+.Ar interface
+.Sh DESCRIPTION
+.Nm
+is an implementation of the DHCP client specified in
+.Rs
+.%T "RFC 2131"
+.Re
+.Nm
+gets the host information
+.Po 
+IP address, routes, etc
+.Pc
+from a DHCP server and configures the network
+.Ar interface
+of the
+machine on which it is running. 
+.Nm
+will then write DNS information to
+.Xr resolvconf 8 ,
+if available, otherwise directly to
+.Pa /etc/resolv.conf .
+.Nm
+will also configure
+.Pa /etc/yp.conf
+and
+.Pa /etc/ntpd.conf
+with NIS and NTP information if the DHCP server provided them.
+If those file contents changed, then
+.Nm
+will also attempt to restart the respective services to notify them of the
+change.
+If the hostname is currenly blank, (null) or localhost then
+.Nm
+will set the hostname to the one supplied by the DHCP server, or look it up
+in DNS if none supplied.
+.Nm
+then daemonises and waits for the lease renewal time to lapse.
+Then it attempts to renew its lease and reconfigure if the new lease changes.
+.Ss Local Link configuration
+If
+.Nm
+failed to obtain a lease, it will probe for a valid IPv4LL address
+.Po
+aka Zeroconf, aka APIPA
+.Pc .
+Once obtained it will probe every 10 seconds for a DHCP server to get a
+proper address.
+.Pp
+Even when
+.Nm
+obtains a proper lease, it will still add a Local Link route
+.Po
+165.254.0.0/16
+.Pc
+so that the host can communicate with clients using these addresses.
+.Pp
+When using IPv4LL,
+.Nm
+will always succeed and return a 0 exit code. To disable this behaviour, you
+can use the
+.Fl L , -noipv4ll
+option.
+.Ss Hooking into DHCP events
+.Nm
+will run /etc/dhcpcd.sh, or the script specified by the
+.Fl c , -script
+option. It will set $1 to a shell compatible file that holds various
+configuration settings obtained from the DHCP server and $2 to either
+up, down or new depending on the state of
+.Nm .
+.Nm
+ignores the exist code of the script.
+.Ss Fine tuning
+You can fine tune the behaviour of
+.Nm
+with the following options :-
+.Bl -tag -width indent
+.It Fl d , -debug
+Echo debug and informational messages to the console.
+Subsequent debug options stop
+.Nm
+from daemonising.
+.It Fl h , -hostname Ar hostname
+By default,
+.Nm
+will send the current hostname to the DHCP server so it can register in DNS.
+You can use this option to specify the
+.Ar hostname
+sent, or an empty string to
+stop any
+.Ar hostname
+from being sent.
+.It Fl i , -classid Ar classid
+Override the DHCP vendor
+.Ar classid
+field we send. The default is
+dhcpcd-<version>.
+.It Fl k , -release
+This causes an existing
+.Nm
+process running on the
+.Ar interface
+to release it's lease, deconfigure the
+.Ar interface
+and then exit.
+.It Fl l , -leasetime Ar seconds
+Request a specific lease time in
+.Ar seconds .
+By default
+.Nm
+does not request any lease time and leaves the it in the hands of the
+DHCP server.
+.It Fl m , -metric Ar metric
+Added routes will use the
+.Ar metric
+on systems where this is supported
+.Po
+presently only Linux
+.Pc .
+Route metrics allow the addition of routes to the same destination across
+different interfaces, the lower the metric the more it is preferred.
+.It Fl n , -renew
+Notifies an existing
+.Nm
+process running on the
+.Ar interface
+to renew it's lease. If
+.Nm
+is not running, then it starts up as normal.
+.It Fl p , -persistent
+.Nm
+normally deconfigures the
+.Ar interface
+and configuration when it exits.
+Sometimes, this isn't desirable if for example you have root mounted over NFS.
+You can use this option to stop this from happening.
+.It Fl r , -request Op Ar address
+.Nm
+normally sends a DHCP Broadcast to find servers to offer an address.
+.Nm
+will then request the address used. You can use this option to skip the
+broadcast step and just request an
+.Ar address .
+The downside is if you request
+an
+.Ar address
+the DHCP server does not know about or the DHCP server is not
+authorative, it will remain silent. In this situation, we go back to the init
+state and broadcast again.
+If no
+.Ar address
+is given then we use the first address currently assigned to the
+.Ar interface .
+.It Fl s , -inform Op Ar address Op / Ar cidr
+Behaves exactly like
+.Fl r , -request
+as above, but sends a DHCP inform instead of a request. This requires the
+interface to be configured first. This does not get a lease as such, just
+notifies the DHCP server of the
+.Ar address
+we are using.
+.It Fl t , -timeout Ar seconds
+Timeout after
+.Ar seconds ,
+instead of the default 20.
+A setting of 0
+.Ar seconds
+causes
+.Nm
+to wait forever to get a lease.
+.It Fl u , -userclass Ar class
+Tags the DHCP message with the userclass
+.Ar class .
+DHCP servers use this give memebers of the class DHCP options other than the
+default, without having to know things like hardware address or hostname.
+.If Fl F , -fqdn Ar fqdn
+Requests that the DHCP server updates DNS using FQDN instead of just a
+hostname. Valid values for
+.Ar fqdn
+are none, ptr and both.
+.Nm
+dhcpcd itself never does any DNS updates.
+.It Fl H , --sethostname
+Forces
+.Nm
+to set the hostname as supplied by the DHCP server. Because some OS's and users
+prefer to have just the hostname, or the full FQDN more
+.Fl H , --sethostname
+options change the behaviour. Below is the list of possible combinations:-
+.Bl -tag -width indent
+.It Fl H
+set the hostname to the full FQDN.
+.It Fl HH
+strip the domain if it matches the dns domain.
+.It Fl HHH
+strip the domain regardless.
+.It Fl HHHH
+same as
+.Fl H
+but force hostname lookup via DNS.
+.It Fl HHHHH
+same as above, but strip the domain if it matches the dns domain.
+.It Fl HHHHHH
+same as above, but strip the domain regardless.
+.El
+.It Fl I , -clientid Ar clientid
+Send
+.Ar clientid
+as a client identifier string. If
+.Ar clientid
+matches a hardware address format, such as 01:00:01:02:03:04:05 then we encode
+it as that, otherwise as a string. You need to specify the hardware type in
+the first byte. Ethernet is 01, and the hardware address in the example is
+00:01:02:03:04:05. If the
+.Ar clientid
+is a blank string, then we disable DUID support and use a
+.Ar clientid
+as shown above.
+.It Fl S, -mscsr
+Microsoft have their own code for Classless Static Routes
+.Po
+RFC 3442
+.Pc .
+You can use this option to request this as well as the normal CSR. Another
+instace of this option only requests the Microsoft CSR to prevent DHCP message
+over-running its maximum size. DHCP server administrators should update their
+CSR code from the Microsoft specific one to the RFC compliant one as the
+content is fully compatible.
+.It Fl P, -pidfile Ar filename
+Write the PID to
+.Ar filename
+instead of
+.Nm /var/run/dhcpcd- Ns Ar interface Ns Nm .pid.
+.El
+.Ss Restriciting behaviour
+.Nm
+will try to do as much as it can by default. However, there are sometimes
+situations where you don't want the things to be configured exactly how the
+the DHCP server wants. Here are some option that deal with turning these bits
+off.
+.Bl -tag -width indent
+.It Fl A , -noarp
+Don't request or claim the address by ARP.
+.It Fl G , -nogateway
+Don't set any default routes.
+.It Fl L , -noipv4ll
+Don't use IPv4LL at all.
+.It Fl M , -nomtu
+Don't set the MTU of the
+.Ar interface .
+.It Fl N , -nontp
+Don't touch
+.Pa /etc/ntpd.conf
+or restart the ntp service.
+.It Fl R , -nodns
+Don't send DNS information to resolvconf or touch
+.Pa /etc/resolv.conf .
+.It Fl T , -test
+On receipt of discover messages, simply print the contents of the DHCP
+message to the console.
+.Nm
+will not configure the
+.Ar interface ,
+touch any files or restart any services.
+.It Fl Y , -nonis
+Don't touch
+.Pa /etc/yp.conf
+or restart the ypbind service.
+.El
+.Sh NOTES
+Because
+.Nm
+supports InfiniBand, we put a Node-specific Client Identifier in the
+ClientID field. This is required by RFC 4390. It's also required for DHCP IPv6
+which
+.Nm
+should support one day. However, some DHCP servers have no idea what this is
+and reject the message as they do not understand type 255. This is not
+conformant with RFC 2132 and the server should be fixed. Also, some DHCP
+server configurations require an ethernet hardware address of 6 hexacdecimal
+numbers in the ClientID which is the default behaviour of most other DHCP
+clients. If your DHCP server is as desribed above, you should fix the server,
+or if that is not an option you can compile DUID support out of
+.Nm
+or use the
+.Fl I , -clientid Ar clientid
+option and set
+.Ar clientid
+to ''.
+.Pp
+ISC dhcpd, dnsmasq, udhcpd and Microsoft DHCP server 2003 default configurations
+work just fine with the default
+.Nm
+configuration.
+.Pp
+.Nm
+requires a Berkley Packet Filter, or BPF device on BSD based systems and a
+Linux Socket Filter, or LPF device on Linux based systems.
+.Sh FILES
+.Bl -ohang
+.It Pa /etc/dhcpcd.sh
+Bourne shell script that is run when we configure or deconfigure an interface.
+.It Pa /var/lib/dhcpcd/dhcpcd.duid
+Text file that holds the DUID used to identify the host.
+.It Pa /var/lib/dhcpcd/dhcpcd- Ns Ar interface Ns .info
+Bourne shell file that holds the DHCP values used in configuring the interface.
+This path is passed as the first argument to
+.Pa /etc/dhcpcd.sh .
+.El
+.Sh SEE ALSO
+.Xr ntp 1 ,
+.Xr resolv.conf 5 ,
+.Xr resolvconf 8 ,
+.Xr yp.conf 5 ,
+.Xr ypbind 8
+.Sh STANDARDS
+RFC 2131, RFC 2132, RFC 2855, RFC 3004, RFC 3361, RFC 3397, RFC 3442, RFC 3927,
+RFC 4361, RFC 4390, RFC 4702.
+.Sh AUTHORS
+.An "Roy Marples" Aq roy@marples.name
+.Sh BUGS
+Please report them to http://bugs.marples.name
--- dhcpcd-3.2.3.orig/interface.c
+++ dhcpcd-3.2.3/interface.c
@@ -35,6 +35,7 @@
 
 /* Netlink suff */
 #ifdef __linux__
+/* typedef unsigned long long __u64; */ /* broken in later headers */
 #include <asm/types.h> /* Needed for 2.4 kernels */
 #include <linux/netlink.h>
 #include <linux/rtnetlink.h>
--- dhcpcd-3.2.3.orig/socket.c
+++ dhcpcd-3.2.3/socket.c
@@ -358,7 +358,7 @@
 /* BPF requires that we read the entire buffer.
  * So we pass the buffer in the API so we can loop on >1 dhcp packet. */
 ssize_t get_packet (const interface_t *iface, unsigned char *data,
-		    unsigned char *buffer,
+		    size_t data_len, unsigned char *buffer,
 		    size_t *buffer_len, size_t *buffer_pos)
 {
 	union
@@ -406,6 +406,8 @@
 		if (hdr.hw->ether_type == htons (ETHERTYPE_ARP)) {
 			len = bpf.packet->bh_caplen - 
 				sizeof (*hdr.hw);
+			if(len > data_len)
+				break;
 			memcpy (data, payload, len);
 			have_data = true;
 		} else {
@@ -419,6 +421,8 @@
 				len = ntohs (pay.packet->ip.ip_len) -
 					sizeof (pay.packet->ip) -
 					sizeof (pay.packet->udp);
+				if(len > data_len)
+					break;
 				memcpy (data, &pay.packet->dhcp, len);
 				have_data = true;
 			}
@@ -585,7 +589,7 @@
 /* Linux has no need for the buffer as we can read as much as we want.
  * We only have the buffer listed to keep the same API. */
 ssize_t get_packet (const interface_t *iface, unsigned char *data,
-		    unsigned char *buffer,
+		    size_t data_len, unsigned char *buffer,
 		    size_t *buffer_len, size_t *buffer_pos)
 {
 	ssize_t bytes;
@@ -610,9 +614,18 @@
 		return (-1);
 	}
 
+#if 0
+	logger (LOG_DEBUG, "received packet of %zd bytes", bytes);
+#endif
+
 	*buffer_len = bytes;
 	/* If it's an ARP reply, then just send it back */
 	if (iface->socket_protocol == ETHERTYPE_ARP) {
+		if((size_t)bytes > data_len) {
+			logger (LOG_DEBUG, "packet too long (%zd), ignoring",
+					   bytes);
+			return (-1);
+		}
 		memcpy (data, buffer, bytes);
 		return (bytes);
 	}
@@ -635,6 +648,18 @@
 
 	bytes = ntohs (pay.packet->ip.ip_len) -
 		(sizeof (pay.packet->ip) + sizeof (pay.packet->udp));
+
+	if((size_t)bytes > data_len) {
+		logger (LOG_DEBUG, "dhcp message too long for us (%zd bytes), ignoring",
+					bytes);
+		return (-1);
+	}
+#if 0
+      	else {
+		logger (LOG_DEBUG, "received dhcp message (%zd bytes)",
+			bytes);
+	}
+#endif
 	memcpy (data, &pay.packet->dhcp, bytes);
 	return (bytes);
 }
--- dhcpcd-3.2.3.orig/socket.h
+++ dhcpcd-3.2.3/socket.h
@@ -41,6 +41,6 @@
 int open_socket (interface_t *iface, int protocol);
 ssize_t send_packet (const interface_t *iface, int type,
 		     const unsigned char *data, size_t len);
-ssize_t get_packet (const interface_t *iface, unsigned char *data,
+ssize_t get_packet (const interface_t *iface, unsigned char *data, size_t data_len,
 		    unsigned char *buffer, size_t *buffer_len, size_t *buffer_pos);
 #endif
--- dhcpcd-3.2.3.orig/mk/os.mk
+++ dhcpcd-3.2.3/mk/os.mk
@@ -52,7 +52,7 @@
 			  echo "${INFODIR}"; \
 			  else \
 			  case `uname -s` in \
-			  Linux) echo "/var/lib/dhcpcd";; \
+			  Linux|GNU/kFreeBSD) echo "/var/lib/dhcpcd";; \
 			  *) echo "/var/db";; \
 			  esac \
 			  fi
@@ -72,6 +72,6 @@
 RC= ${_RC}$(shell ${_RC_SH})
 
 # glibc requires _BSD_SOURCE and _XOPEN_SOURCE
-_DEF_SH=	case `uname -s` in Linux) echo "-D_BSD_SOURCE -D_XOPEN_SOURCE=600";; *) echo;; esac
+_DEF_SH=	case `uname -s` in Linux|GNU/kFreeBSD) echo "-D_BSD_SOURCE -D_XOPEN_SOURCE=600";; *) echo;; esac
 _DEF!=		${_DEF_SH}
 CFLAGS+=	${_DEF}$(shell ${_DEF_SH})
--- dhcpcd-3.2.3.orig/debian/conffiles
+++ dhcpcd-3.2.3/debian/conffiles
@@ -0,0 +1,2 @@
+/etc/dhcpcd.sh
+/etc/default/dhcpcd
--- dhcpcd-3.2.3.orig/debian/dhcpcd.dirs
+++ dhcpcd-3.2.3/debian/dhcpcd.dirs
@@ -0,0 +1,4 @@
+sbin
+usr/share/man/man8
+etc/default
+etc/dhcpc
--- dhcpcd-3.2.3.orig/debian/preinst
+++ dhcpcd-3.2.3/debian/preinst
@@ -0,0 +1,25 @@
+#!/bin/sh -e
+
+# The name of the lease-change script changed.
+# Move it here, but leave a link from the old name.
+
+if [ -f /etc/dhcpc/dhcpcd.exe ] && [ ! -f /etc/dhcpcd.sh ]; then
+   mv /etc/dhcpc/dhcpcd.exe /etc/dhcpcd.sh
+   ln -s /etc/dhcpcd.sh /etc/dhcpc/dhcpcd.exe
+fi
+
+if [ -f /etc/dhcpc/config ] && [ ! -f /etc/default/dhcpcd ]; then
+   mv /etc/dhcpc/config /etc/default/dhcpcd
+   ln -s /etc/default/dhcpcd /etc/dhcpc/config
+fi
+
+# If upgrading from a version prior to 3.2.1, we create the
+# file /etc/dhcpc/inhibit-duid so that hosts don't suddenly change
+# their client-id and move IP addresses. New installations can use DUID 
+# from the start with no problems.
+
+if [ $1 = upgrade ]; then
+   if [ -n $2 ]  && dpkg --compare-versions $2 lt 3.2.1-1; then
+    echo "Remove this file to make dhcpcd use DUID-based client-ids" >/etc/dhcpc/inhibit-duid
+   fi
+fi
--- dhcpcd-3.2.3.orig/debian/compat
+++ dhcpcd-3.2.3/debian/compat
@@ -0,0 +1 @@
+4
--- dhcpcd-3.2.3.orig/debian/substvars
+++ dhcpcd-3.2.3/debian/substvars
@@ -0,0 +1 @@
+shlibs:Depends=libc6 (>= 2.3.5-1)
--- dhcpcd-3.2.3.orig/debian/README.debian
+++ dhcpcd-3.2.3/debian/README.debian
@@ -0,0 +1,51 @@
+dhcpcd for Debian
+-----------------
+
+Startup
+-------
+If you would like an interface to be configured using dhcpcd at
+boot time then add lines like
+
+auto eth1
+iface eth1 inet dhcp
+
+to /etc/network/interfaces.  This will cause ifup to bring up 
+interface eth1 at boot time.
+
+Ifup will use dhcpcd to configure a particular interface if it
+is set up to configure that interface according to an "iface"
+description in /etc/network/interfaces of type "inet dhcp".
+See the ifup(8) and interfaces(5) manual pages for more
+information on how to write the /etc/network/interfaces file.
+
+Resolv.conf
+-----------
+Dhcpcd will no longer update /etc/resolv.conf and /etc/ntp.conf
+directly unless this is enabled in /etc/dhcpc/config by setting
+the SET_DNS environment variable to "yes".  If the resolvconf
+package is installed then the resolv.conf information will be
+sent to resolvconf; otherwise the information will be written
+to /etc/dhcpc/resolv.conf .  Note that if you are using
+resolvconf then you must _not_ set SET_DNS to "yes" since this
+will interfere with resolvconf's operation.
+
+DUID-based client-ids
+---------------------
+Dhcpcd version 3 constructs client-ids using the a DUID, as specified
+by RFC 4361. previous versions used a client-id based on the interface
+MAC address, as specified in RFC 2131. If a host which already has a
+DHCP lease changes its client-id, it is probable that it will be
+allocated a new IP address by the DHCP server, which may cause
+problems. To avoid this, if the Debian package of dhcpcd is upgraded,
+the file /etc/dhcpc/inhibit-duid will be created, which forces dhcpcd
+to use the old client-id. New installations use DUID-based client-ids
+from scratch and existing ones can be upgraded in a controlled manner
+by deleting /etc/dhcpc/inhibit-duid and taking interfaces down and
+then back up.
+
+
+
+ -- Simon Kelley <simon@thekelleys.org.uk>, Tues, 12 Feb 2008 12:22:01 +0000
+
+
+
--- dhcpcd-3.2.3.orig/debian/prerm
+++ dhcpcd-3.2.3/debian/prerm
@@ -0,0 +1,15 @@
+#!/bin/sh -e
+
+rm -f /etc/dhcpc/duid-inhibit  
+
+if [ "$1" != "upgrade" ]; then
+        update-alternatives --remove dhcpcd /sbin/dhcpcd3
+fi
+
+#DEBHELPER#
+
+
+
+
+
+
--- dhcpcd-3.2.3.orig/debian/dhcpcd.sh
+++ dhcpcd-3.2.3/debian/dhcpcd.sh
@@ -0,0 +1,111 @@
+#!/bin/bash
+#
+#  This is a sample /etc/dhcpc/dhcpcd.sh script.
+#  /etc/dhcpc/dhcpcd.sh script is executed by dhcpcd daemon
+#  any time it configures or shuts down interface.
+#  The following parameters are passed to dhcpcd.sh script:
+#  $1 = HostInfoFilePath, e.g  "/var/lib/dhcpc/dhcpcd-eth0.info"
+#  $2 = "up" if interface has been configured with the same
+#       IP address as before reboot;
+#  $2 = "down" if interface has been shut down;
+#  $2 = "new" if interface has been configured with new IP address;
+#
+# This script sources /var/lib/dhcpc/dhcpcd-<interface>.info which defines 
+# a set of variables. 
+# NOTE THAT THE DATA IN SOME OF THESE VARIABLES COME FROM 
+# UNTRUSTED SOURCES AND ARE UNCHECKED.
+# The variables in question are HOSTNAME, DOMAIN, NISDOMAIN, 
+# ROOTPATH DNSSEARCH and DHCPSNAME. Enough quoting is done to ensure that
+# execution of this script is safe, but beware if you pass the value of any of
+# these variables to another shell or perl script - there is nothing to
+# stop an attacker putting dangerous characters in these variables. 
+#
+# This is important: if noglob not set a filename expansion metachar may be
+# included in one of the variables set in the info file and executed
+# if that variable is used.
+# Try this to see the effect:
+# TEST='*'; echo $TEST
+set -o noglob
+
+#  Sanity checks
+
+if [ $# -lt 2 ]; then
+  logger -s -p local0.err -t dhcpcd.sh "wrong usage"
+  exit 1
+fi
+
+hostinfo="$1"
+state="$2"
+
+# Reading HostInfo file for configuration parameters
+if ! [ -f ${hostinfo} ]; then
+   logger -s -p local0.err -t dhcpcd.sh "No hostinfo file"
+   exit 1
+fi
+
+. ${hostinfo}
+
+write_resolv_info()
+{
+    dnsservs=${DNSSERVERS}
+    r=""
+    [ "$dnsservs" != "" ] && [ "$DNSSEARCH" != "" ] && r="${r}search $DNSSEARCH
+"
+    [ "$dnsservs" != "" ] && [ "$DNSSEARCH" == "" ] && [ "$DNSDOMAIN" != "" ] && r="${r}search $DNSDOMAIN
+"
+    for serv in $dnsservs; do
+        r="${r}nameserver $serv
+"
+    done
+    if [ -x /sbin/resolvconf ] ; then
+        echo -n "$r" | /sbin/resolvconf -a "$INTERFACE"
+    else
+        # set /etc/dhcpc/resolv.conf for compatiblity with older packages
+	echo -n "$r" >| /etc/dhcpc/resolv.conf
+        chmod 644 /etc/dhcpc/resolv.conf
+    fi
+}
+
+delete_resolv_info()
+{
+    if [ -x /sbin/resolvconf ] ; then
+        /sbin/resolvconf -d "$INTERFACE"
+    fi
+}
+
+
+case ${state} in
+ up) logger -s -p local0.info -t dhcpcd.sh "interface ${INTERFACE} has been configured with old IP=${IPADDR}"
+     write_resolv_info
+
+# ====  Put your code for the case interface has been brought up with old IP address here
+
+
+
+
+# ====  End
+     ;;
+
+ new) logger -s -p local0.info -t dhcpcd.sh "interface ${INTERFACE} has been configured with new IP=${IPADDR}"
+     write_resolv_info
+
+# ====  Put your code for the case interface has been brought up with new IP address here
+
+
+
+
+# ====  End
+     ;;
+
+ down) logger -s -p local0.info -t dhcpcd.sh "interface ${INTERFACE} has been brought down"
+     delete_resolv_info
+# ====  Put your code for the case interface has been shut down here
+
+
+
+
+# ====  End
+     ;;
+esac
+
+exit 0
--- dhcpcd-3.2.3.orig/debian/copyright
+++ dhcpcd-3.2.3/debian/copyright
@@ -0,0 +1,40 @@
+
+Version 1.3.x was originally downloaded from:
+
+            ftp://phystech.com/pub/
+
+Version 2.x.x was downloaded from
+
+            http://developer.berlios.de/projects/dhcpcd/
+
+Version 3.x.x was downloaded from
+
+            http://roy.marples.name/dhcpcd
+
+Copyright:
+
+ * dhcpcd - DHCP client daemon
+ * Copyright 2006-2008 Roy Marples <roy@marples.name>
+ * All rights reserved
+
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+
--- dhcpcd-3.2.3.orig/debian/changelog
+++ dhcpcd-3.2.3/debian/changelog
@@ -0,0 +1,537 @@
+dhcpcd (1:3.2.3-11.5.201403192043) ucs4-0-0-0; urgency=low
+
+  * UCS auto build. No patches were applied to the original source package
+
+ -- Univention builddaemon <buildd@univention.de>  Wed, 19 Mar 2014 20:43:12 +0100
+
+dhcpcd (1:3.2.3-11) unstable; urgency=high
+
+    * Security fix, remote stack overflow: CVE-2012-2152. (closes: #671265)
+	
+ -- Simon Kelley <simon@thekelleys.org.uk>  Thu, 3 May 2012 14:03:12 +0000
+
+dhcpcd (1:3.2.3-10) unstable; urgency=low
+
+    * Fix inhibit-duid/duid-inhibit confusion in README.
+	
+ -- Simon Kelley <simon@thekelleys.org.uk>  Thu, 26 Jan 2012 21:04:22 +0000
+
+dhcpcd (1:3.2.3-9) unstable; urgency=low
+
+    * Fix double-free crash. (closes: #632164)
+	
+ -- Simon Kelley <simon@thekelleys.org.uk>  Thu, 30 Jun 2011 21:04:22 +0000
+
+dhcpcd (1:3.2.3-8) unstable; urgency=low
+
+    * Add --pidfile argument. (closes: #532100)
+	
+ -- Simon Kelley <simon@thekelleys.org.uk>  Mon, 14 Feb 2011 21:19:12 +0000
+
+dhcpcd (1:3.2.3-7) unstable; urgency=low
+
+    * Fix FTBFS on GNU/kFreeBSD. (closes: #594661)
+	
+ -- Simon Kelley <simon@thekelleys.org.uk>  Tue, 31 Aug 2010 21:24:13 +0000
+
+dhcpcd (1:3.2.3-6) unstable; urgency=low
+
+    * Make /sbin/dhcpcd and /usr/share/man/man8/dhcpcd.8 managed 
+    *    as alternatives, to allow co-existance with dhcpcd5.
+    * Correctly handle multiple options in wrapper script. (closes: #577846)
+    * Don't override CFLAGS in the build system. (closes: #571183)
+	
+ -- Simon Kelley <simon@thekelleys.org.uk>  Thu, 19 Aug 2010 20:41:13 +0000
+
+dhcpcd (1:3.2.3-5) unstable; urgency=low
+
+    * Remove conflict with dhcp3-client. (closes: #563627)
+    
+ -- Simon Kelley <simon@thekelleys.org.uk>  Mon, 4 Jan 2010 16:37:13 +0000
+
+dhcpcd (1:3.2.3-4) unstable; urgency=low
+
+    * Comment out dodgy declaration of __u64.  (closes: #544679)
+    * Conflict with dhcp3-client. (closes: #485484)
+    * Fix location of config file in dhcpcd man page. (closes: #485483)
+    * Allow spaces in OPTIONS. (closes: #534561)
+    * Remove obsolete pid-file management from wrapper 
+      script, since dhcpcd-3 doesn't require it. (closes: #536864)
+    
+ -- Simon Kelley <simon@thekelleys.org.uk>  Tue, 17 Nov 2009 21:00:12 +0100
+
+dhcpcd (1:3.2.3-3) unstable; urgency=low
+
+    * Fix wrong variable used for domain in dhcpcd.sh (closes: #512296)
+    
+ -- Simon Kelley <simon@thekelleys.org.uk>  Thu, 29 Jan 2009 20:49:18 +0100
+
+dhcpcd (1:3.2.3-2) unstable; urgency=low
+
+    * Patched to use correct MAC address in DHCP renewal requests.
+    *	(closes: #502191)
+    
+ -- Simon Kelley <simon@thekelleys.org.uk>  Tue, 14 Oct 2008 20:33:38 +0100
+	
+dhcpcd (1:3.2.3-1.1) unstable; urgency=medium
+
+    * Non-maintainer upload.
+    * Fix bashism in preinst maintainer script (Closes: #473515)
+    * Bump Standards-Version to 3.7.3.
+
+ -- Chris Lamb <chris@chris-lamb.co.uk>  Sat, 12 Apr 2008 03:50:59 +0100
+
+dhcpcd (1:3.2.3-1) unstable; urgency=low
+
+    * New upstream.
+    * Restore lost changelog (closes: #467083)
+    * Fix FTBFS on GNU/kFreeBSD. (closes: #467005)
+					
+ -- Simon Kelley <simon@thekelleys.org.uk>  Wed, 27 Feb 2008 12:06:38 +0100
+
+dhcpcd (1:3.2.2-1) unstable; urgency=low
+
+    * New upstream.
+    * Add /etc/dhcpc/duid-inhibit logic. 
+					
+ -- Simon Kelley <simon@thekelleys.org.uk>  Thu, 21 Feb 2008 20:14:58 +0100
+
+dhcpcd (1:3.0.17-2) unstable; urgency=low
+
+    * Remove SET_DOMAIN option: this has been non-functional for
+      serveral years, but on 3.0.x, setting causes dhcpcd to fail
+      at startup. (closes: #419868)
+					
+ -- Simon Kelley <simon@thekelleys.org.uk>  Wed, 18 Apr 2007 13:34:28 +0100
+
+dhcpcd (1:3.0.17-1) unstable; urgency=low
+
+    * New upstream.
+    * Handle change of lease-change script from /etc/dhcpc/dhcpcd.exe 
+      to /etc/dhcpcd.sh and the config file from /etc/dhcpc/config
+      to the more standards-conforming /etc/default/dhcpcd
+    * Apply patch from SVN to make .info file compatible with old scripts.
+				
+ -- Simon Kelley <simon@thekelleys.org.uk>  Sat, 14 Apr 2007 17:41:32 +0100
+
+dhcpcd (1:2.0.3-1) unstable; urgency=low
+
+    * New upstream.
+				
+ -- Simon Kelley <simon@thekelleys.org.uk>  Fri, 10 Mar 2006 21:43:11 +0100
+
+dhcpcd (1:2.0.2-1) unstable; urgency=low
+
+    * New upstream.
+				
+ -- Simon Kelley <simon@thekelleys.org.uk>  Mon, 28 Feb 2006 11:53:41 +0100
+
+dhcpcd (1:2.0.1-1) unstable; urgency=low
+
+    * New upstream.
+    * Fixed various lintian warnings.
+				
+ -- Simon Kelley <simon@thekelleys.org.uk>  Mon, 23 Jan 2006 20:55:11 +0100
+
+dhcpcd (1:2.0.0-2) unstable; urgency=low
+
+    * Clear out /etc/dhcpc/resolv.conf and /var/lib/dhcpc/* 
+      during purge. (closes: #330515)
+			
+ -- Simon Kelley <simon@thekelleys.org.uk>  Thur, 29 Sep 2005 26:21:51 +0100
+
+dhcpcd (1:2.0.0-1) unstable; urgency=low
+
+    * New upstream: the previous upstream maintainer went MIA, so the
+      2.x.x series is a fork. It merges everthing relevant from the Debian
+      and Gentoo packages. From the Debian point of view, the changes 
+      are therefore the things imported from Gentoo. These are the 
+      -F -e and -m options.
+		
+ -- Simon Kelley <simon@thekelleys.org.uk>  Sat, 23 July 2005 21:55:11 +0100
+
+dhcpcd (1:1.3.22pl4-22) unstable; urgency=low
+
+    * Gut the preinst and postinst scripts. Now that Sarge is
+      released, we no longer need to carry baggage for upgrading from
+      potato.
+    * Add a comment to /etc/dhcpc/config in attempt to avoid confusion
+      over which interface it applies to. (closes: #311495)
+    * Fix the value of the "Maximum message size" option. This value
+      includes the IP and UDP headers, and it's minium value is therefore
+      576, according to RFC2131.	
+    * Fix a security hole. A malformed DHCP packet could crash dhcpcd.
+	
+ -- Simon Kelley <simon@thekelleys.org.uk>  Mon, 27 Jun 2005 21:23:21 +0100
+
+dhcpcd (1:1.3.22pl4-21) unstable; urgency=low
+
+    * Fixed my juvenile shell scripting to cope with arguments with 
+      spaces in them. (closes: #300897)
+
+ -- Simon Kelley <simon@thekelleys.org.uk>  Wed, 23 Mar 2005 14:30:34 +0000
+
+dhcpcd (1:1.3.22pl4-20) unstable; urgency=low
+
+    * Added -p option, for use with NFS-root.
+    * Made -t 0 work to disable timeouts entirely.
+    * Fixed the wrapper script so that is doesn't send the hostname
+      if one is hardcoded in the /etc/dhcpc/config.
+
+ -- Simon Kelley <simon@thekelleys.org.uk>  Sat, 11 Dec 2004 19:13:12 +0000
+
+dhcpcd (1:1.3.22pl4-19) unstable; urgency=low
+
+    * Don't run the dhcpc.exe script when timing out or 
+      exiting before any lease info is available. (closes: #283516)
+
+ -- Simon Kelley <simon@thekelleys.org.uk>  Mon, 29 Nov 2004 21:13:12 +0000
+
+dhcpcd (1:1.3.22pl4-18) unstable; urgency=low
+
+    * Added rfc3397 support. (closes: #274309)
+
+ -- Simon Kelley <simon@thekelleys.org.uk>  Sat, 10 Oct 2004 19:13:12 +0000
+
+dhcpcd (1:1.3.22pl4-17) unstable; urgency=low
+
+    * Changed dhcpcd wrapper script to bash. (closes: #269846)
+
+    * Tweaked dhcpcd.exe. (closes: #269847)
+		
+ -- Simon Kelley <simon@thekelleys.org.uk>  Sat, 4 Sep 2004 12:11:10 +0000
+
+dhcpcd (1:1.3.22pl4-16) unstable; urgency=low
+
+    * Improved argument checking of dhcpcd wrapper script.
+
+    * Fix bug in code to determine if we send the hostname in 
+      a DHCP request in the dhcpcd wrapper script. (closes: #268181)
+
+    * Add "search" directive to /etc/dhcpc/resolv.conf when domain
+      returned in DHCP lease. (closes: #268011)
+
+    * Tweak comments in config file. (closes: #268009)
+		
+ -- Simon Kelley <simon@thekelleys.org.uk>  Thur, 2 Sep 2004 20:31:20 +0000
+
+dhcpcd (1:1.3.22pl4-15) unstable; urgency=low
+
+    * Don't exit with an error when calling dhcpcd -k and the process
+      is not running, since this is probably because dhcpcd obtained
+      an infinite lease and exited. Returning an error stops ifdown from
+      taking the interface down in that case. (closes  #258641)
+
+    * Reworded man page section on "-k" (closes #253107).
+	
+ -- Simon Kelley <simon@thekelleys.org.uk>  Wed, 4 Aug 2004 21:31:20 +0000
+
+dhcpcd (1:1.3.22pl4-14) unstable; urgency=low
+
+    * Remove prerm script entirely, since it tries to clean up
+      files which don't exist and fails to stop the daemon correctly
+      when it is running on an interface other than eth0. (closes: #253107)
+	
+ -- Simon Kelley <simon@thekelleys.org.uk>  Wed, 8 Jul 2004 21:01:20 +0000
+
+dhcpcd (1:1.3.22pl4-13) unstable; urgency=low
+
+    * Add dependency on procps. (closes: #250650)
+	
+ -- Simon Kelley <simon@thekelleys.org.uk>  Sun, 30 May 2004 18:02:10 +0000
+
+dhcpcd (1:1.3.22pl4-12) unstable; urgency=low
+
+    * Change dependency on ifupdown into a conflict with old 
+      ifupdown verions. As a consequence, now need to check if
+      ifupdown in installed in postinst before mangling 
+      /etc/network/interfaces. (closes: #249428)
+	
+ -- Simon Kelley <simon@thekelleys.org.uk>  Tue, 18  May 2004 19:19:20 +0000
+
+dhcpcd (1:1.3.22pl4-11) unstable; urgency=low
+
+    * Send the current hostname with the DHCP request, unless overridden.
+	
+ -- Simon Kelley <simon@thekelleys.org.uk>  Thur, 13  May 2004 22:29:10 +0000
+
+dhcpcd (1:1.3.22pl4-10) unstable; urgency=low
+
+    * Fixed default location of dhcpcd.exe file, which got moved 
+      to /var/lib/dhcpc by accident.
+	
+ -- Simon Kelley <simon@thekelleys.org.uk>  Tue, 6  Jan 2004 20:19:00 +0000
+
+dhcpcd (1:1.3.22pl4-9) unstable; urgency=low
+
+    * Included Thomas Hood's rewrite of the README (closes: #203165)
+    * Updated postinst to reflect changed syntax of
+      /etc/network/interfaces in later versions. (closes: #203176)
+    * Changed dependency on ifupdown from pre-depends: to 
+      depends: which is sufficient as it ensures that ifupdown
+      is functional before the dhcpcd postinst script is run.
+
+ -- Simon Kelley <simon@thekelleys.org.uk>  Mon, 8  Sep 2003 21:22:05 +0000
+	
+dhcpcd (1:1.3.22pl4-8) unstable; urgency=low
+  
+    * Tweaked Conflicts: (closes: #196485)
+    * Use safe tests in the wrapper script. (closes: #197624)
+    * Move *cache *and *info files from /etc/dhcpc to /var/lib/dhcpc
+      to facilitate machines without writable root filesystems.
+      /etc/dhcpc/resolv.conf becomes a link to /var/lib/dhcpc/resolv.conf
+      for the same reason.
+    * Tweaked pre-depends to avoid needless conflicts when installing 
+      on woody.
+    * Added version to bsdutils dependency and updated copyright, both
+      to please lintian.
+	
+ -- Simon Kelley <simon@thekelleys.org.uk>  Sat, 26 Jul 2003 15:32:59 +0000
+
+dhcpcd (1:1.3.22pl4-7) unstable; urgency=low
+  
+    * Added support for resolvconf package in dhcpcd.exe
+     
+ -- Simon Kelley <simon@thekelleys.org.uk>  Mon, 23 Jun 2003 19:54:43 +0000
+
+dhcpcd (1:1.3.22pl4-6) unstable; urgency=high
+  
+    * Check for symbolic links before using readlink
+      in postinst. (closes: #184043)
+     
+ -- Simon Kelley <simon@thekelleys.org.uk>  Sun,  9 Mar 2003 10:26:46 +0000
+
+dhcpcd (1:1.3.22pl4-5) unstable; urgency=low
+  
+    * Fix /etc/dhcpcd.exe to cope with more than two DNS servers.
+     
+ -- Simon Kelley <simon@thekelleys.org.uk>  Sat,  8 Mar 2003 12:35:16 +0000
+
+dhcpcd (1:1.3.22pl4-4) unstable; urgency=high
+  
+    * Fix typo in /etc/dhcpcd.exe (closes: #182631)
+     
+ -- Simon Kelley <simon@thekelleys.org.uk>  Thur,  27 Feb 2003 07:46:06 +0000
+
+dhcpcd (1:1.3.22pl4-3) unstable; urgency=low
+  
+    * Allow wlan interfaces in dhcpcd.exe. (closes: #182046)
+    * Provide dhcp-client virtual package. (closes: #178962)
+     
+ -- Simon Kelley <simon@thekelleys.org.uk>  Mon,  24 Feb 2003 21:14:07 +0000
+
+dhcpcd (1:1.3.22pl4-2) unstable; urgency=low
+  
+    * Fix stupid automake mess-up which stops autobuilders.
+     
+ -- Simon Kelley <simon@thekelleys.org.uk>  Tue,  28 Jan 2003 23:23:05 +0000
+
+dhcpcd (1:1.3.22pl4-1) unstable; urgency=low
+  
+    * New upstream.
+    * Check for existance of hostinfo file in dhcpcd.exe; this
+    * may be missing if the first ever invokation of DHCPCD fails.
+     
+ -- Simon Kelley <simon@thekelleys.org.uk>  Mon,  27 Jan 2003 17:23:48 +0000
+
+dhcpcd (1:1.3.22pl3-2) unstable; urgency=low
+  
+    * make /etc/dhcpcd.exe a bash script (closes: #169688).
+      
+ -- Simon Kelley <simon@thekelleys.org.uk>  Sun,  24 Nov 2002 20:52:18 +0000
+
+dhcpcd (1:1.3.22pl3-1) unstable; urgency=low
+  
+    * New upstream.
+    * Set perms on /etc/dhcpc/resolv.conf to 644 (closes: #167364).
+    * Remove gcc arch flags in configure.in so that i386 binaries
+      really run on 386-and-up.
+    
+ -- Simon Kelley <simon@thekelleys.org.uk>  Sat,  23 Nov 2002 21:03:25 +0000
+
+dhcpcd (1:1.3.22pl2-2) unstable; urgency=low
+  
+    * Updated config.guess, config.sub and missing with files
+      from automake 1.4-p6-2. (closes: #162854)
+  
+ -- Simon Kelley <simon@thekelleys.org.uk>  Mon,  30 Sept 2002 15:27:23 +0100
+
+dhcpcd (1:1.3.22pl2-1) unstable; urgency=low
+  
+    * New upstream.
+    * Do careful check for stale pid files on startup. (closes: #161997)
+  
+ -- Simon Kelley <simon@thekelleys.org.uk>  Sun,  29 Sept 2002 18:55:17 +0100
+  
+dhcpcd (1:1.3.22pl1-4) unstable; urgency=high
+
+    * Removed shopt command from preinst - not required (closes: #153452)
+    * Added code to automatically copy enough configuration
+      on upgrade to keep the machine on the net. (closes: #153293)
+      Detailed change as follows.
+      1) No longer stop existing daemon in preinst, instead copy config file
+         for use in postinst.
+      2) In postinst update /etc/network/interfaces, then stop old daemon, 
+         then run ifup on the interface.
+      3) Change depends to pre-depends on ifupdown, since it has to be
+         functional for the above to work.
+  
+ -- Simon Kelley <simon@thekelleys.org.uk>  Wed,  17 Jul 2002 23:09:14 +0100
+
+dhcpcd (1:1.3.22pl1-3) unstable; urgency=low
+
+    * Updated config.guess and config.sub (closes: #152623)
+    
+ -- Simon Kelley <simon@thekelleys.org.uk>  Sun,  15 Jul 2002 22:15:09 +0100
+
+dhcpcd (1:1.3.22pl1-2) unstable; urgency=high
+
+    * Added build-depends for debhelper (closes:#151884).
+    * Do fixups from old version in preinst, not postinst. 
+      This fixes a problem where the old init.d script mangled the
+      newly installed files and left the package unusable.
+    * Really close all the bugs meant to be closed by 1.3.22pl1-1.
+      (closes:#143657) (closes:#143660)
+      (closes:#140288) (closes:#127773) (closes:#118039) (closes:#121208)
+    * Remove bashism from postinst. (closes:#151522)
+    * Update docs to reflect newer format of
+      /etc/network/interfaces
+  
+ -- Simon Kelley <simon@thekelleys.org.uk>  Weds,  10 Jun 2002 14:05:08 +0100
+
+dhcpcd (1:1.3.22pl1-1) unstable; urgency=low
+  
+    * New maintainer.
+    * New upstream. (closes:143657) (closes:143660)
+    * Removed /etc/init.d/dhcpcd. dhcpcd is now started by ifup or the pcmcia
+      package. This is corresponds with the mechanism used by pump.
+      (closes:140288) (closes:127773) (closes:118039) (closes:121208)
+    * Removed kernel 2.0.x support since debian now longer supports this
+      kernel series. The latest upstream now allows compilation for
+      2.0.x anyway, so the ancient and unsupported 0.70 source tree has gone
+      as well. 2.0.x users can recompile the source package.
+    * Added a wrapper (/sbin/dhcpcd) around the real binary (/sbin/dhcpcd-bin)
+      which allows options to be set in /etc/dhcpc/config. ifup allows
+      most common options to be set, but not some which may be useful, 
+      and dhcpcd doesn't natively support a config file.
+    * Do not allow dhcpcd to alter /etc/resolv.conf, /etc/ntp.conf or
+      /etc/yp.conf by default: these all need settings in 
+      /etc/dhcpc/config now. /etc/dhcpc/resolv.conf is still supported
+      for dnsmasq.
+    * Removed strange diversion of /etc/resolv.conf and /etc/ntp.conf
+      via symlinks.
+    * Patched upstream to remove security hole associated with shell
+      metachars in dhcpcd-<interface>.info. Without the patch talking to
+      a DHCP server which returned a domain name of eg `rm -rf /` would
+      cause big problems!
+  
+ -- Simon Kelley <simon@thekelleys.org.uk>  Tues,  11 Jun 2002 20:08:07 +0100
+  
+dhcpcd (1:1.3.17pl2-8) frozen unstable; urgency=low
+
+  * Add to frozen to avoid release with critical bugs
+
+ -- Dennis Kelly <dpk@debian.org>  Wed,  8 Mar 2000 11:04:04 -0500
+
+dhcpcd (1:1.3.17pl2-7) unstable; urgency=low
+
+  * Fixed init script for 2.0 kernels
+
+ -- Dennis Kelly <dpk@debian.org>  Tue, 22 Feb 2000 16:52:37 -0500
+
+dhcpcd (1:1.3.17pl2-6) unstable; urgency=low
+
+  * "-02" w/gcc >= 2.8 will cause dhcpcd to fail (closes: #56860, #43238)
+  * Change /sbin/dhcpcd to be a link instead of startup script so pid file
+    is created properly (closes: #53501)
+  * exit 0 if interface is set to "none" (closes: #55836)
+  * Hint in postinst for pcmcia-cs (closes: #55776, #33623)
+
+ -- Dennis Kelly <dpk@debian.org>  Fri, 18 Feb 2000 09:43:48 -0500
+
+dhcpcd (1:1.3.17pl2-5) unstable; urgency=low
+
+  * Support for 2.3.x kernels in dhcpcd script (closes: #46761)
+  * Use $@ instead of $* in dhcpcd script (closes: #46914)
+  * Do not delete dhcpcd-$IFACE.exe (closes: #48235)
+  * Do nothing in init script if no interface is configured (closes: #49814)
+
+ -- Dennis Kelly <dpk@debian.org>  Mon,  1 Nov 1999 10:02:11 -0500
+
+dhcpcd (1:1.3.17pl2-4) unstable; urgency=low
+
+  * Start dhcpcd if upgrading from versions <= 1:1.3.17pl2-2, as they stop
+    and start the daemon during upgrades (closes: #32078, #46355)
+  * postinst: resolv.conf and ntp.conf setup did not properly check files
+    when moving or copying to directories (closes: #30657, #35346, #46449)
+  * postinst: cleaned up configure code to report and handle interfaces
+    better (closes: #25293)
+  * made /sbin/dhcpcd a wrapper that calls either dhcpcd-2.0.x or
+    dhcpcd-2.2.x, depending on current running kernel to make the
+    pcmcia-cs package happy (closes: #31701, #45536)
+  * postinst: don't fail if no network is configured
+
+ -- Dennis Kelly <dpk@debian.org>  Mon,  1 Nov 1999 10:02:01 -0500
+
+dhcpcd (1:1.3.17pl2-3) unstable; urgency=low
+
+  * Reversed order of $IFACE and $OPTIONS in init script (closes: #33204)
+  * Moved dhcpcd daemons to /sbin (closes: #45536)
+  * Remove old pid, cache, and info files which cause failure at startup 
+    (closes: #34124, #35992)
+  * Removed annoying 'your IP address:' statement from console messages 
+    and really follow policy (closes: #32373, #34601)
+  * Don't restart during upgrade (#32078)
+  * Handle upgrades from previous versions using wrong init script
+    properly (closes: #46202)
+  * Updated README to at least include correct information regarding
+    the package
+  * Update configure script to actually list available interfaces
+
+ -- Dennis Kelly <dpk@debian.org>  Wed, 29 Sep 1999 11:40:32 -0400
+
+dhcpcd (1:1.3.17pl2-2) unstable; urgency=low
+
+  * New maintainer
+  * Purge now removes init script (closes: #32371)
+  * Console messages from init script now follow policy (closes: #32373)
+  * Testing DAEMON in init script follows defining it in case (closes: #34769)
+  * Removed 'source' bashism in init script (closes: #35343)
+  * Removed '==' bashism in postinst script (closes: #35402) 
+  * Fixed dhcpcd failing to start if pid file exists (closes: #32692)
+  * Remove old init script if it exists (closes: #33523)
+
+ -- Dennis Kelly <dpk@debian.org>  Mon, 27 Sep 1999 16:21:18 -0400
+
+dhcpcd (1:1.3.17pl2-1) unstable; urgency=low
+
+  * New upstream version of dhcpcd-sv
+  * Merged dhcpcd-sv and dhcpcd into same package.
+  * Fixes for unaligned writes on RISC architectures (sparc,arm)
+
+ -- Steve Dunham <dunham@debian.org>  Thu, 21 Jan 1999 19:45:53 -0500
+
+dhcpcd-sv (1.3.16-2) unstable; urgency=low
+
+  * Sparc fixes
+
+ -- Steve Dunham <dunham@debian.org>  Wed, 20 Jan 1999 01:36:31 -0500
+
+dhcpcd-sv (1.3.16-1) unstable; urgency=low
+
+  * New upstream version
+
+ -- Steve Dunham <dunham@debian.org>  Wed, 30 Dec 1998 18:42:17 -0500
+
+dhcpcd-sv (1.3.7-1) unstable; urgency=low
+
+  * New upstream version
+
+ -- Steve Dunham <dunham@debian.org>  Sat, 29 Aug 1998 20:27:27 -0400
+
+dhcpcd-sv (1.3.6-1) unstable; urgency=low
+
+  * Initial Release.
+
+ -- Steve Dunham <dunham@debian.org>  Sat, 29 Aug 1998 20:27:27 -0400
+
--- dhcpcd-3.2.3.orig/debian/postrm
+++ dhcpcd-3.2.3/debian/postrm
@@ -0,0 +1,15 @@
+#!/bin/sh -e
+
+if [ "$1" = purge ]; then
+   rm -f /etc/dhcpc/resolv.conf
+   rm -rf /var/lib/dhcpcd
+fi
+ 
+#DEBHELPER#
+
+
+
+
+
+
+
--- dhcpcd-3.2.3.orig/debian/postinst
+++ dhcpcd-3.2.3/debian/postinst
@@ -0,0 +1,23 @@
+#!/bin/sh -e
+
+# /etc/dhcpc/resolv.conf is now a link to /var/lib/dhcpcd/resolv.conf
+rm -f /etc/dhcpc/resolv.conf  
+ln -s /var/lib/dhcpcd/resolv.conf /etc/dhcpc/resolv.conf 
+
+# remove older-version state dir.
+rm -rf /var/lib/dhcpc
+
+# share binary and man page with dhcpcd5
+update-alternatives --quiet --install  /sbin/dhcpcd dhcpcd /sbin/dhcpcd3 100 \
+          --slave /usr/share/man/man8/dhcpcd.8.gz dhcpcd.8.gz \
+                  /usr/share/man/man8/dhcpcd3.8.gz 
+
+update-alternatives --auto dhcpcd
+
+#DEBHELPER#
+
+
+
+
+
+
--- dhcpcd-3.2.3.orig/debian/config
+++ dhcpcd-3.2.3/debian/config
@@ -0,0 +1,36 @@
+# Config file for dhcpcd. Note that you have to edit the interface
+# name below, or duplicate the configuration for different interfaces.
+# If you are editing this file just to get DNS servers set by DHCP,
+# then you should consider installing the resolvconf package instead.
+
+case ${INTERFACE} in
+eth0) 
+
+# Uncomment this to allow dhcpcd to set the DNS servers in /etc/resolv.conf
+# If you are using resolvconf then you can leave this commented out.
+#SET_DNS='yes'
+
+# Uncomment this to allow dhcpcd to set hostname of the host to the
+# hostname option supplied by DHCP server.
+#SET_HOSTNAME='yes'
+
+# Uncomment this to allow dhcpcd to set the NTP servers in /etc/ntp.conf
+#SET_NTP='yes'
+
+# Uncomment this to allow dhcpcd to set the YP servers in /etc/yp.conf
+#SET_YP='yes'
+
+# Add other options here, see man 8 dhcpcd-bin for details.
+OPTIONS=()
+;;
+
+# Add other interfaces here
+*)
+;;
+
+esac
+
+
+
+
+
--- dhcpcd-3.2.3.orig/debian/control
+++ dhcpcd-3.2.3/debian/control
@@ -0,0 +1,17 @@
+Source: dhcpcd
+Section: net
+Priority: optional
+Build-Depends: debhelper (>>2.0.0)
+Maintainer: Simon Kelley <simon@thekelleys.org.uk>
+Standards-Version: 3.7.3
+
+Package: dhcpcd
+Architecture: any
+Depends: ${shlibs:Depends}, bsdutils (>=2.11n), procps
+Replaces: dhcpcd-sv
+Conflicts: dhcpcd-sv, ifupdown (<< 0.6.4-4)
+Description: DHCP client for automatically configuring IPv4 networking
+ Simple configuration: supports executions of a script when the 
+ IP address changes.
+ 
+
--- dhcpcd-3.2.3.orig/debian/dhcpcd.8
+++ dhcpcd-3.2.3/debian/dhcpcd.8
@@ -0,0 +1,30 @@
+.\" $Id$
+.\"
+.TH dhcpcd 8 "13 May 2004" "dhcpcd" "Debian GNU/Linux"
+
+.SH NAME
+dhcpcd \- a wrapper for the DHCP client daemon.
+.SH SYNOPSIS
+.B dhcpcd <option> <interface>
+
+.SH DESCRIPTION
+In Debian, the DHCP client daemon binary is called dhcpcd-bin and it is invoked via a wrapper called dhcpcd. Dhcpcd is normally invoked by 
+.BR ifup (8) 
+but ifup only allows the setting of a limited number of dhcpcd command line flags. The dhcpcd wrapper reads extra flags from /etc/default/dhcpcd and then invokes 
+.BR dhcpcd-bin (8)
+It also adds the hostname as an argument to the command line, unless
+it is already set by ifup or /etc/default/dhcpcd or SET_HOSTNAME is
+configured. In that case there is no point in sending the old
+hostname with the DHCP request when it will be overridden by a new
+name supplied by the DHCP server. 
+.PP
+Note that the interface argument must be supplied, there is no default
+to eth0 like the unadorned dhcpcd binary.
+.SH SEE ALSO
+.BR ifup (8)
+.BR dhcpcd-bin (8)
+
+.SH AUTHORS
+.LP
+Simon Kelley <srk@thekelleys.org.uk>
+
--- dhcpcd-3.2.3.orig/debian/rules
+++ dhcpcd-3.2.3/debian/rules
@@ -0,0 +1,77 @@
+#!/usr/bin/make -f
+# -*-makefile-*-
+# Made with the aid of dh_make, by Craig Small
+# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.
+# Some lines taken from debmake, by Cristoph Lameter.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+# policy manual, section 10.1
+ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
+     COPTS = -g -O0 -Wall -W -DENABLE_INFO_COMPAT
+else
+     COPTS = -g -O2 -Wall -W -DENABLE_INFO_COMPAT
+endif
+
+
+configure-stamp:
+	dh_testdir
+	touch configure-stamp
+
+build: configure-stamp
+	dh_testdir
+	$(MAKE)  COPTS="$(COPTS)"
+	touch build-stamp
+
+clean: 
+	dh_testdir
+	dh_testroot
+	rm -f build-stamp configure-stamp
+	rm -f *.o core *.core *~ dhcpcd
+	dh_clean -Pdebian/tmp
+
+# Build architecture-independent files here.
+binary-indep: build
+# We have nothing to do by default.
+
+# Build architecture-dependent files here.
+binary-arch: build
+#	dh_testversion
+	dh_testdir
+	dh_testroot
+	dh_clean -k -Pdebian/tmp
+	dh_installdirs -Pdebian/tmp
+
+	install dhcpcd debian/tmp/sbin/dhcpcd-bin
+	install debian/dhcpcd debian/tmp/sbin/dhcpcd3
+	install -m 644 debian/config debian/tmp/etc/default/dhcpcd
+	install debian/dhcpcd.sh debian/tmp/etc
+	install -d debian/tmp/var/lib/dhcpc
+
+	dh_installdocs -Pdebian/tmp README
+	dh_installchangelogs  -Pdebian/tmp 
+
+	install dhcpcd.8 debian/tmp/usr/share/man/man8/dhcpcd-bin.8
+	install debian/dhcpcd.8 debian/tmp/usr/share/man/man8/dhcpcd3.8
+	gzip -9 debian/tmp/usr/share/man/man8/dhcpcd-bin.8
+	gzip -9 debian/tmp/usr/share/man/man8/dhcpcd3.8
+
+	dh_strip -Pdebian/tmp
+	dh_compress -Pdebian/tmp 
+	dh_fixperms -Pdebian/tmp
+	dh_installdeb -Pdebian/tmp
+	dh_shlibdeps -Pdebian/tmp
+	dh_gencontrol -Pdebian/tmp
+	dh_md5sums -Pdebian/tmp
+	dh_builddeb -Pdebian/tmp
+
+source diff:                                                                  
+	@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary
+
+
+
+
--- dhcpcd-3.2.3.orig/debian/dhcpcd
+++ dhcpcd-3.2.3/debian/dhcpcd
@@ -0,0 +1,105 @@
+#!/bin/bash
+
+# dhcpcd doesn't support a config file, just command line options.
+# ifup can set some  options (-h -i -I -l) but no others.
+# This wrapper adds any other options set in /etc/default/dhcpcd
+# (and the hostname if not set by ifup or /etc/default/dhcpcd)
+# and then calls the dhcpcd binary, named dhcpcd-bin.
+#
+# Note that this wrapper _requires_ the interface name: it doesn't support
+# the eth0 default that dhcpcd proper does.
+
+if [ "$1" =  "--version" ]; then echo "3.2.3"; exit 0; fi
+
+# get interface
+eval INTERFACE=\${$#}
+if [ $# = 0 ] || 
+   [ ${INTERFACE:0:1} = '-' ]
+then
+   echo "Usage: dhcpcd [options] <interface>"
+   exit 1
+fi
+
+
+# determine if we will add the option to send the current hostname
+sendhost=yes
+sethost=no
+setclid=yes
+
+for o 
+do
+   if [ x"$o" = x"-h" ]; then
+      sendhost=no
+   fi
+   if [ x"$o" = x"-H" ]; then
+      sethost=yes
+   fi
+   if [ x"$o" = x"-I" ]; then
+      setclid=no
+   fi
+done
+
+# load configuration file
+if [ -f /etc/default/dhcpcd ] ; then
+    . /etc/default/dhcpcd
+fi
+
+for o in ${OPTIONS[@]}
+do
+  if [ "$o" = "-h" ]; then
+      sendhost=no
+   fi
+   if [ "$o" = "-H" ]; then
+      sethost=yes
+   fi 
+   if [ x"$o" = x"-I" ]; then
+      setclid=no
+   fi
+done
+
+# Note that in the absence of /etc/default/dhcpcd we play safe and disallow
+# changes to /etc/resolv.conf and friends.
+
+if [ "$SET_DNS" != "yes" ]; then
+  OPTIONS=("-R" "${OPTIONS[@]}")
+fi
+
+#if [ "$SET_DOMAIN" = "yes" ]; then
+#  OPTIONS="-D $OPTIONS"
+#fi
+
+if [ "$SET_HOSTNAME" = "yes" ]; then
+  OPTIONS=("-H" "${OPTIONS[@]}")
+  sethost=yes
+fi
+
+if [ "$SET_NTP" != "yes" ]; then
+  OPTIONS=("-N" "${OPTIONS[@]}")
+fi
+
+if [ "$SET_YP" != "yes" ]; then
+  OPTIONS=("-Y" "${OPTIONS[@]}")
+fi
+
+# We tell dhcpcd to send the hostname iff the option is not 
+# already set by our caller, and the hostname will not be changed 
+# by dhcpcd
+
+if [ $sendhost = yes ] &&
+   [ $sethost = no ] &&
+   [ -x /bin/hostname ]
+then
+   name=`/bin/hostname`
+   if [ ${#name} != 0 ]; then
+      OPTIONS=("-h" "$name" "${OPTIONS[@]}")
+   fi
+fi
+
+# if we have been upgraded, /etc/dhcpc/inhibit-duid will exist,
+# so for the client-id to be backwards compatible unless explicitly set
+if [ $setclid = yes ] &&
+   [ -f /etc/dhcpc/inhibit-duid ]; then
+      exec /sbin/dhcpcd-bin -I '' "${OPTIONS[@]}" "$@"
+else
+      exec /sbin/dhcpcd-bin "${OPTIONS[@]}" "$@"
+fi
