Fixes configuration files, defined in the systemd unit files.
###############################################################################
name = dhcp
-version = 4.2.2
-release = 5
+version = 4.2.4
+release = 1
groups = Networking/Daemons
url = http://isc.org/products/DHCP/
easier to administer a large network.
end
-source_dl = ftp://ftp.isc.org/isc/dhcp/
+source_dl = ftp://ftp.isc.org/isc/dhcp/%{version}/
# Apply patches in a special order.
patches = \
dhcp-4.2.2-remove-bind.patch \
+ dhcp-4.2.4-P1-remove-dst.patch \
dhcp-4.2.0-errwarn-message.patch \
- dhcp-4.2.2-options.patch \
+ dhcp-4.2.4-options.patch \
dhcp-4.2.0-release-by-ifup.patch \
dhcp-4.2.0-dhclient-decline-backoff.patch \
- dhcp-4.2.0-unicast-bootp.patch \
+ dhcp-4.2.4-unicast-bootp.patch \
dhcp-4.2.2-dhclient-usage.patch \
dhcp-4.2.0-default-requested-options.patch \
dhcp-4.2.2-xen-checksum.patch \
dhcp-4.2.1-manpages.patch \
- dhcp-4.2.0-paths.patch \
+ dhcp-4.2.4-paths.patch \
dhcp-4.2.2-CLOEXEC.patch \
- dhcp-4.2.0-inherit-leases.patch \
dhcp-4.2.0-garbage-chars.patch \
dhcp-4.2.0-missing-ipv6-not-fatal.patch \
dhcp-4.2.0-add_timeout_when_NULL.patch \
- dhcp-4.2.1-64_bit_lease_parse.patch \
+ dhcp-4.2.4-64_bit_lease_parse.patch \
dhcp-4.2.2-capability.patch \
dhcp-4.2.0-logpid.patch \
- dhcp-4.2.0-UseMulticast.patch \
+ dhcp-4.2.4-UseMulticast.patch \
dhcp-4.2.1-sendDecline.patch \
dhcp-4.2.1-retransmission.patch \
- dhcp-4.2.2-rfc3442-classless-static-routes.patch \
+ dhcp-4.2.4-rfc3442-classless-static-routes.patch \
dhcp-4.2.0-honor-expired.patch \
- dhcp-4.2.0-noprefixavail.patch \
dhcp-4.2.2-sharedlib.patch \
- dhcp-4.2.0-PPP.patch \
- dhcp-4.2.2-lpf-ib.patch \
- dhcp-4.2.2-improved-xid.patch \
+ dhcp-4.2.4-PPP.patch \
+ dhcp-4.2.3-paranoia.patch \
+ dhcp-4.2.4-lpf-ib.patch \
+ dhcp-4.2.4-improved-xid.patch \
dhcp-4.2.2-gpxe-cid.patch \
- dhcp-4.2.2-systemtap.patch
+ dhcp-4.2.4-systemtap.patch \
+ dhcp-4.2.3-dhclient-decline-onetry.patch \
+ dhcp-4.2.3-P2-log_perror.patch \
+ dhcp-4.2.4-getifaddrs.patch \
+ dhcp-4.2.4-send_release.patch \
+ dhcp-4.2.3-P2-rfc5970-dhcpv6-options-for-network-boot.patch \
+ dhcp-4.2.4-failOverPeer.patch \
+ dhcp-4.2.4-P1-dhclient6-leases_semicolon_expected.patch \
+ dhcp-4.2.4-P1-interval.patch
build
requires
systemd-units
end
- CFLAGS += \
- -fno-strict-aliasing \
- -D_GNU_SOURCE \
- -Wl,--as-needed
+ CFLAGS += -fno-strict-aliasing
configure_options += \
--sysconfdir=%{sysconfdir}/dhcp \
# Remove bundled BIND source
rm -rvf %{DIR_APP}/bind/bind.tar.gz
+ # Remove dst.
+ rm -rvf dst includes/isc-dhcp
+
# Regenerate build environment
- libtoolize --copy --force
+ #libtoolize --copy --force
autoreconf --verbose --force --install
end
+++ /dev/null
-diff -up dhcp-4.2.0/client/clparse.c.cloexec dhcp-4.2.0/client/clparse.c
---- dhcp-4.2.0/client/clparse.c.cloexec 2010-07-21 13:55:42.000000000 +0200
-+++ dhcp-4.2.0/client/clparse.c 2010-07-21 14:31:13.000000000 +0200
-@@ -211,7 +211,7 @@ int read_client_conf_file (const char *n
- int token;
- isc_result_t status;
-
-- if ((file = open (name, O_RDONLY)) < 0)
-+ if ((file = open (name, O_RDONLY | O_CLOEXEC)) < 0)
- return uerr2isc (errno);
-
- cfile = NULL;
-@@ -248,7 +248,7 @@ void read_client_leases ()
-
- /* Open the lease file. If we can't open it, just return -
- we can safely trust the server to remember our state. */
-- if ((file = open (path_dhclient_db, O_RDONLY)) < 0)
-+ if ((file = open (path_dhclient_db, O_RDONLY | O_CLOEXEC)) < 0)
- return;
-
- cfile = NULL;
-diff -up dhcp-4.2.0/client/dhclient.c.cloexec dhcp-4.2.0/client/dhclient.c
---- dhcp-4.2.0/client/dhclient.c.cloexec 2010-07-21 13:55:42.000000000 +0200
-+++ dhcp-4.2.0/client/dhclient.c 2010-07-21 14:33:44.000000000 +0200
-@@ -137,11 +137,11 @@ main(int argc, char **argv) {
- /* Make sure that file descriptors 0 (stdin), 1, (stdout), and
- 2 (stderr) are open. To do this, we assume that when we
- open a file the lowest available file descriptor is used. */
-- fd = open("/dev/null", O_RDWR);
-+ fd = open("/dev/null", O_RDWR | O_CLOEXEC);
- if (fd == 0)
-- fd = open("/dev/null", O_RDWR);
-+ fd = open("/dev/null", O_RDWR | O_CLOEXEC);
- if (fd == 1)
-- fd = open("/dev/null", O_RDWR);
-+ fd = open("/dev/null", O_RDWR | O_CLOEXEC);
- if (fd == 2)
- log_perror = 0; /* No sense logging to /dev/null. */
- else if (fd != -1)
-@@ -488,7 +488,7 @@ main(int argc, char **argv) {
- int e;
-
- oldpid = 0;
-- if ((pidfd = fopen(path_dhclient_pid, "r")) != NULL) {
-+ if ((pidfd = fopen(path_dhclient_pid, "re")) != NULL) {
- e = fscanf(pidfd, "%ld\n", &temp);
- oldpid = (pid_t)temp;
-
-@@ -530,7 +530,7 @@ main(int argc, char **argv) {
- strncpy(new_path_dhclient_pid, path_dhclient_pid, pfx);
- sprintf(new_path_dhclient_pid + pfx, "-%s.pid", ip->name);
-
-- if ((pidfd = fopen(new_path_dhclient_pid, "r")) != NULL) {
-+ if ((pidfd = fopen(new_path_dhclient_pid, "re")) != NULL) {
- e = fscanf(pidfd, "%ld\n", &temp);
- oldpid = (pid_t)temp;
-
-@@ -555,7 +555,7 @@ main(int argc, char **argv) {
- int dhc_running = 0;
- char procfn[256] = "";
-
-- if ((pidfp = fopen(path_dhclient_pid, "r")) != NULL) {
-+ if ((pidfp = fopen(path_dhclient_pid, "re")) != NULL) {
- if ((fscanf(pidfp, "%ld", &temp)==1) && ((dhcpid=(pid_t)temp) > 0)) {
- snprintf(procfn,256,"/proc/%u",dhcpid);
- dhc_running = (access(procfn, F_OK) == 0);
-@@ -2931,7 +2931,7 @@ void rewrite_client_leases ()
-
- if (leaseFile != NULL)
- fclose (leaseFile);
-- leaseFile = fopen (path_dhclient_db, "w");
-+ leaseFile = fopen (path_dhclient_db, "we");
- if (leaseFile == NULL) {
- log_error ("can't create %s: %m", path_dhclient_db);
- return;
-@@ -3035,7 +3035,7 @@ write_duid(struct data_string *duid)
- return DHCP_R_INVALIDARG;
-
- if (leaseFile == NULL) { /* XXX? */
-- leaseFile = fopen(path_dhclient_db, "w");
-+ leaseFile = fopen(path_dhclient_db, "we");
- if (leaseFile == NULL) {
- log_error("can't create %s: %m", path_dhclient_db);
- return ISC_R_IOERROR;
-@@ -3215,7 +3215,7 @@ int write_client_lease (client, lease, r
- return 1;
-
- if (leaseFile == NULL) { /* XXX */
-- leaseFile = fopen (path_dhclient_db, "w");
-+ leaseFile = fopen (path_dhclient_db, "we");
- if (leaseFile == NULL) {
- log_error ("can't create %s: %m", path_dhclient_db);
- return 0;
-@@ -3668,9 +3668,9 @@ void go_daemon ()
- close(2);
-
- /* Reopen them on /dev/null. */
-- open("/dev/null", O_RDWR);
-- open("/dev/null", O_RDWR);
-- open("/dev/null", O_RDWR);
-+ open("/dev/null", O_RDWR | O_CLOEXEC);
-+ open("/dev/null", O_RDWR | O_CLOEXEC);
-+ open("/dev/null", O_RDWR | O_CLOEXEC);
-
- write_client_pid_file ();
-
-@@ -3682,14 +3682,14 @@ void write_client_pid_file ()
- FILE *pf;
- int pfdesc;
-
-- pfdesc = open (path_dhclient_pid, O_CREAT | O_TRUNC | O_WRONLY, 0644);
-+ pfdesc = open (path_dhclient_pid, O_CREAT | O_TRUNC | O_WRONLY | O_CLOEXEC, 0644);
-
- if (pfdesc < 0) {
- log_error ("Can't create %s: %m", path_dhclient_pid);
- return;
- }
-
-- pf = fdopen (pfdesc, "w");
-+ pf = fdopen (pfdesc, "we");
- if (!pf)
- log_error ("Can't fdopen %s: %m", path_dhclient_pid);
- else {
-diff -up dhcp-4.2.0/common/bpf.c.cloexec dhcp-4.2.0/common/bpf.c
---- dhcp-4.2.0/common/bpf.c.cloexec 2009-11-20 02:48:59.000000000 +0100
-+++ dhcp-4.2.0/common/bpf.c 2010-07-21 14:31:13.000000000 +0200
-@@ -94,7 +94,7 @@ int if_register_bpf (info)
- for (b = 0; 1; b++) {
- /* %Audit% 31 bytes max. %2004.06.17,Safe% */
- sprintf(filename, BPF_FORMAT, b);
-- sock = open (filename, O_RDWR, 0);
-+ sock = open (filename, O_RDWR | O_CLOEXEC, 0);
- if (sock < 0) {
- if (errno == EBUSY) {
- continue;
-diff -up dhcp-4.2.0/common/discover.c.cloexec dhcp-4.2.0/common/discover.c
---- dhcp-4.2.0/common/discover.c.cloexec 2009-10-28 05:12:29.000000000 +0100
-+++ dhcp-4.2.0/common/discover.c 2010-07-21 14:31:13.000000000 +0200
-@@ -409,7 +409,7 @@ begin_iface_scan(struct iface_conf_list
- int len;
- int i;
-
-- ifaces->fp = fopen("/proc/net/dev", "r");
-+ ifaces->fp = fopen("/proc/net/dev", "re");
- if (ifaces->fp == NULL) {
- log_error("Error opening '/proc/net/dev' to list interfaces");
- return 0;
-@@ -444,7 +444,7 @@ begin_iface_scan(struct iface_conf_list
-
- #ifdef DHCPv6
- if (local_family == AF_INET6) {
-- ifaces->fp6 = fopen("/proc/net/if_inet6", "r");
-+ ifaces->fp6 = fopen("/proc/net/if_inet6", "re");
- if (ifaces->fp6 == NULL) {
- log_error("Error opening '/proc/net/if_inet6' to "
- "list IPv6 interfaces; %m");
-diff -up dhcp-4.2.0/common/dlpi.c.cloexec dhcp-4.2.0/common/dlpi.c
---- dhcp-4.2.0/common/dlpi.c.cloexec 2009-11-20 02:49:00.000000000 +0100
-+++ dhcp-4.2.0/common/dlpi.c 2010-07-21 14:31:13.000000000 +0200
-@@ -807,7 +807,7 @@ dlpiopen(const char *ifname) {
- }
- *dp = '\0';
-
-- return open (devname, O_RDWR, 0);
-+ return open (devname, O_RDWR | O_CLOEXEC, 0);
- }
-
- /*
-diff -up dhcp-4.2.0/common/nit.c.cloexec dhcp-4.2.0/common/nit.c
---- dhcp-4.2.0/common/nit.c.cloexec 2009-11-20 02:49:01.000000000 +0100
-+++ dhcp-4.2.0/common/nit.c 2010-07-21 14:31:13.000000000 +0200
-@@ -81,7 +81,7 @@ int if_register_nit (info)
- struct strioctl sio;
-
- /* Open a NIT device */
-- sock = open ("/dev/nit", O_RDWR);
-+ sock = open ("/dev/nit", O_RDWR | O_CLOEXEC);
- if (sock < 0)
- log_fatal ("Can't open NIT device for %s: %m", info -> name);
-
-diff -up dhcp-4.2.0/common/resolv.c.cloexec dhcp-4.2.0/common/resolv.c
---- dhcp-4.2.0/common/resolv.c.cloexec 2009-11-20 02:49:01.000000000 +0100
-+++ dhcp-4.2.0/common/resolv.c 2010-07-21 14:31:13.000000000 +0200
-@@ -49,7 +49,7 @@ void read_resolv_conf (parse_time)
- struct domain_search_list *dp, *dl, *nd;
- isc_result_t status;
-
-- if ((file = open (path_resolv_conf, O_RDONLY)) < 0) {
-+ if ((file = open (path_resolv_conf, O_RDONLY | O_CLOEXEC)) < 0) {
- log_error ("Can't open %s: %m", path_resolv_conf);
- return;
- }
-diff -up dhcp-4.2.0/common/upf.c.cloexec dhcp-4.2.0/common/upf.c
---- dhcp-4.2.0/common/upf.c.cloexec 2009-11-20 02:49:01.000000000 +0100
-+++ dhcp-4.2.0/common/upf.c 2010-07-21 14:31:13.000000000 +0200
-@@ -77,7 +77,7 @@ int if_register_upf (info)
- /* %Audit% Cannot exceed 36 bytes. %2004.06.17,Safe% */
- sprintf(filename, "/dev/pf/pfilt%d", b);
-
-- sock = open (filename, O_RDWR, 0);
-+ sock = open (filename, O_RDWR | O_CLOEXEC, 0);
- if (sock < 0) {
- if (errno == EBUSY) {
- continue;
-diff -up dhcp-4.2.0/dst/dst_api.c.cloexec dhcp-4.2.0/dst/dst_api.c
---- dhcp-4.2.0/dst/dst_api.c.cloexec 2009-10-29 01:46:48.000000000 +0100
-+++ dhcp-4.2.0/dst/dst_api.c 2010-07-21 14:31:13.000000000 +0200
-@@ -437,7 +437,7 @@ dst_s_write_private_key(const DST_KEY *k
- PRIVATE_KEY, PATH_MAX);
-
- /* Do not overwrite an existing file */
-- if ((fp = dst_s_fopen(file, "w", 0600)) != NULL) {
-+ if ((fp = dst_s_fopen(file, "we", 0600)) != NULL) {
- int nn;
- if ((nn = fwrite(encoded_block, 1, len, fp)) != len) {
- EREPORT(("dst_write_private_key(): Write failure on %s %d != %d errno=%d\n",
-@@ -494,7 +494,7 @@ dst_s_read_public_key(const char *in_nam
- * flags, proto, alg stored as decimal (or hex numbers FIXME).
- * (FIXME: handle parentheses for line continuation.)
- */
-- if ((fp = dst_s_fopen(name, "r", 0)) == NULL) {
-+ if ((fp = dst_s_fopen(name, "re", 0)) == NULL) {
- EREPORT(("dst_read_public_key(): Public Key not found %s\n",
- name));
- return (NULL);
-@@ -620,7 +620,7 @@ dst_s_write_public_key(const DST_KEY *ke
- return (0);
- }
- /* create public key file */
-- if ((fp = dst_s_fopen(filename, "w+", 0644)) == NULL) {
-+ if ((fp = dst_s_fopen(filename, "w+e", 0644)) == NULL) {
- EREPORT(("DST_write_public_key: open of file:%s failed (errno=%d)\n",
- filename, errno));
- return (0);
-@@ -854,7 +854,7 @@ dst_s_read_private_key_file(char *name,
- return (0);
- }
- /* first check if we can find the key file */
-- if ((fp = dst_s_fopen(filename, "r", 0)) == NULL) {
-+ if ((fp = dst_s_fopen(filename, "re", 0)) == NULL) {
- EREPORT(("dst_s_read_private_key_file: Could not open file %s in directory %s\n",
- filename, dst_path[0] ? dst_path :
- (char *) getcwd(NULL, PATH_MAX - 1)));
-diff -up dhcp-4.2.0/dst/prandom.c.cloexec dhcp-4.2.0/dst/prandom.c
---- dhcp-4.2.0/dst/prandom.c.cloexec 2009-11-20 02:49:01.000000000 +0100
-+++ dhcp-4.2.0/dst/prandom.c 2010-07-21 14:31:13.000000000 +0200
-@@ -269,7 +269,7 @@ get_dev_random(u_char *output, unsigned
-
- s = stat("/dev/random", &st);
- if (s == 0 && S_ISCHR(st.st_mode)) {
-- if ((fd = open("/dev/random", O_RDONLY | O_NONBLOCK)) != -1) {
-+ if ((fd = open("/dev/random", O_RDONLY | O_NONBLOCK | O_CLOEXEC)) != -1) {
- if ((n = read(fd, output, size)) < 0)
- n = 0;
- close(fd);
-@@ -480,7 +480,7 @@ digest_file(dst_work *work)
- work->file_digest = dst_free_key(work->file_digest);
- return (0);
- }
-- if ((fp = fopen(name, "r")) == NULL)
-+ if ((fp = fopen(name, "re")) == NULL)
- return (0);
- for (no = 0; (i = fread(buf, sizeof(*buf), sizeof(buf), fp)) > 0;
- no += i)
-diff -up dhcp-4.2.0/omapip/trace.c.cloexec dhcp-4.2.0/omapip/trace.c
---- dhcp-4.2.0/omapip/trace.c.cloexec 2010-06-01 19:29:59.000000000 +0200
-+++ dhcp-4.2.0/omapip/trace.c 2010-07-21 14:36:48.000000000 +0200
-@@ -141,10 +141,10 @@ isc_result_t trace_begin (const char *fi
- return DHCP_R_INVALIDARG;
- }
-
-- traceoutfile = open (filename, O_CREAT | O_WRONLY | O_EXCL, 0600);
-+ traceoutfile = open (filename, O_CREAT | O_WRONLY | O_EXCL | O_CLOEXEC, 0600);
- if (traceoutfile < 0 && errno == EEXIST) {
- log_error ("WARNING: Overwriting trace file \"%s\"", filename);
-- traceoutfile = open (filename, O_WRONLY | O_EXCL | O_TRUNC,
-+ traceoutfile = open (filename, O_WRONLY | O_EXCL | O_TRUNC | O_CLOEXEC,
- 0600);
- }
-
-@@ -431,7 +431,7 @@ void trace_file_replay (const char *file
- isc_result_t result;
- int len;
-
-- traceinfile = fopen (filename, "r");
-+ traceinfile = fopen (filename, "re");
- if (!traceinfile) {
- log_error("Can't open tracefile %s: %m", filename);
- return;
-diff -up dhcp-4.2.0/relay/dhcrelay.c.cloexec dhcp-4.2.0/relay/dhcrelay.c
---- dhcp-4.2.0/relay/dhcrelay.c.cloexec 2010-02-17 21:33:55.000000000 +0100
-+++ dhcp-4.2.0/relay/dhcrelay.c 2010-07-21 14:31:39.000000000 +0200
-@@ -177,11 +177,11 @@ main(int argc, char **argv) {
- /* Make sure that file descriptors 0(stdin), 1,(stdout), and
- 2(stderr) are open. To do this, we assume that when we
- open a file the lowest available file descriptor is used. */
-- fd = open("/dev/null", O_RDWR);
-+ fd = open("/dev/null", O_RDWR | O_CLOEXEC);
- if (fd == 0)
-- fd = open("/dev/null", O_RDWR);
-+ fd = open("/dev/null", O_RDWR | O_CLOEXEC);
- if (fd == 1)
-- fd = open("/dev/null", O_RDWR);
-+ fd = open("/dev/null", O_RDWR | O_CLOEXEC);
- if (fd == 2)
- log_perror = 0; /* No sense logging to /dev/null. */
- else if (fd != -1)
-@@ -520,12 +520,12 @@ main(int argc, char **argv) {
- exit(0);
-
- pfdesc = open(path_dhcrelay_pid,
-- O_CREAT | O_TRUNC | O_WRONLY, 0644);
-+ O_CREAT | O_TRUNC | O_WRONLY | O_CLOEXEC, 0644);
-
- if (pfdesc < 0) {
- log_error("Can't create %s: %m", path_dhcrelay_pid);
- } else {
-- pf = fdopen(pfdesc, "w");
-+ pf = fdopen(pfdesc, "we");
- if (!pf)
- log_error("Can't fdopen %s: %m",
- path_dhcrelay_pid);
-diff -up dhcp-4.2.0/server/confpars.c.cloexec dhcp-4.2.0/server/confpars.c
---- dhcp-4.2.0/server/confpars.c.cloexec 2010-03-24 22:49:47.000000000 +0100
-+++ dhcp-4.2.0/server/confpars.c 2010-07-21 14:31:39.000000000 +0200
-@@ -116,7 +116,7 @@ isc_result_t read_conf_file (const char
- }
- #endif
-
-- if ((file = open (filename, O_RDONLY)) < 0) {
-+ if ((file = open (filename, O_RDONLY | O_CLOEXEC)) < 0) {
- if (leasep) {
- log_error ("Can't open lease database %s: %m --",
- path_dhcpd_db);
-diff -up dhcp-4.2.0/server/db.c.cloexec dhcp-4.2.0/server/db.c
---- dhcp-4.2.0/server/db.c.cloexec 2010-02-17 21:33:55.000000000 +0100
-+++ dhcp-4.2.0/server/db.c 2010-07-21 14:31:39.000000000 +0200
-@@ -1035,7 +1035,7 @@ void db_startup (testp)
- }
- #endif
- if (!testp) {
-- db_file = fopen (path_dhcpd_db, "a");
-+ db_file = fopen (path_dhcpd_db, "ae");
- if (!db_file)
- log_fatal ("Can't open %s for append.", path_dhcpd_db);
- expire_all_pools ();
-@@ -1083,12 +1083,12 @@ int new_lease_file ()
- path_dhcpd_db, (int)t) >= sizeof newfname)
- log_fatal("new_lease_file: lease file path too long");
-
-- db_fd = open (newfname, O_WRONLY | O_TRUNC | O_CREAT, 0664);
-+ db_fd = open (newfname, O_WRONLY | O_TRUNC | O_CREAT | O_CLOEXEC, 0664);
- if (db_fd < 0) {
- log_error ("Can't create new lease file: %m");
- return 0;
- }
-- if ((new_db_file = fdopen(db_fd, "w")) == NULL) {
-+ if ((new_db_file = fdopen(db_fd, "we")) == NULL) {
- log_error("Can't fdopen new lease file: %m");
- close(db_fd);
- goto fdfail;
-diff -up dhcp-4.2.0/server/dhcpd.c.cloexec dhcp-4.2.0/server/dhcpd.c
---- dhcp-4.2.0/server/dhcpd.c.cloexec 2010-06-01 19:29:59.000000000 +0200
-+++ dhcp-4.2.0/server/dhcpd.c 2010-07-21 14:31:39.000000000 +0200
-@@ -268,11 +268,11 @@ main(int argc, char **argv) {
- /* Make sure that file descriptors 0 (stdin), 1, (stdout), and
- 2 (stderr) are open. To do this, we assume that when we
- open a file the lowest available file descriptor is used. */
-- fd = open("/dev/null", O_RDWR);
-+ fd = open("/dev/null", O_RDWR | O_CLOEXEC);
- if (fd == 0)
-- fd = open("/dev/null", O_RDWR);
-+ fd = open("/dev/null", O_RDWR | O_CLOEXEC);
- if (fd == 1)
-- fd = open("/dev/null", O_RDWR);
-+ fd = open("/dev/null", O_RDWR | O_CLOEXEC);
- if (fd == 2)
- log_perror = 0; /* No sense logging to /dev/null. */
- else if (fd != -1)
-@@ -780,7 +780,7 @@ main(int argc, char **argv) {
- #endif /* PARANOIA */
-
- /* Read previous pid file. */
-- if ((i = open (path_dhcpd_pid, O_RDONLY)) >= 0) {
-+ if ((i = open (path_dhcpd_pid, O_RDONLY | O_CLOEXEC)) >= 0) {
- status = read(i, pbuf, (sizeof pbuf) - 1);
- close (i);
- if (status > 0) {
-@@ -798,7 +798,7 @@ main(int argc, char **argv) {
- }
-
- /* Write new pid file. */
-- if ((i = open(path_dhcpd_pid, O_WRONLY|O_CREAT|O_TRUNC, 0644)) >= 0) {
-+ if ((i = open(path_dhcpd_pid, O_WRONLY|O_CREAT|O_TRUNC|O_CLOEXEC, 0644)) >= 0) {
- sprintf(pbuf, "%d\n", (int) getpid());
- IGNORE_RET (write(i, pbuf, strlen(pbuf)));
- close(i);
-@@ -824,9 +824,9 @@ main(int argc, char **argv) {
- close(2);
-
- /* Reopen them on /dev/null. */
-- open("/dev/null", O_RDWR);
-- open("/dev/null", O_RDWR);
-- open("/dev/null", O_RDWR);
-+ open("/dev/null", O_RDWR | O_CLOEXEC);
-+ open("/dev/null", O_RDWR | O_CLOEXEC);
-+ open("/dev/null", O_RDWR | O_CLOEXEC);
- log_perror = 0; /* No sense logging to /dev/null. */
-
- IGNORE_RET (chdir("/"));
-diff -up dhcp-4.2.0/server/ldap.c.cloexec dhcp-4.2.0/server/ldap.c
---- dhcp-4.2.0/server/ldap.c.cloexec 2010-03-25 16:26:58.000000000 +0100
-+++ dhcp-4.2.0/server/ldap.c 2010-07-21 14:31:39.000000000 +0200
-@@ -685,7 +685,7 @@ ldap_start (void)
-
- if (ldap_debug_file != NULL && ldap_debug_fd == -1)
- {
-- if ((ldap_debug_fd = open (ldap_debug_file, O_CREAT | O_TRUNC | O_WRONLY,
-+ if ((ldap_debug_fd = open (ldap_debug_file, O_CREAT | O_TRUNC | O_WRONLY | O_CLOEXEC,
- S_IRUSR | S_IWUSR)) < 0)
- log_error ("Error opening debug LDAP log file %s: %s", ldap_debug_file,
- strerror (errno));
+++ /dev/null
-diff -up dhcp-4.2.0/client/dhclient.c.inherit dhcp-4.2.0/client/dhclient.c
---- dhcp-4.2.0/client/dhclient.c.inherit 2010-07-21 14:33:44.000000000 +0200
-+++ dhcp-4.2.0/client/dhclient.c 2010-07-21 14:40:05.000000000 +0200
-@@ -2322,6 +2322,7 @@ void send_request (cpp)
- {
- struct client_state *client = cpp;
-
-+ int i;
- int result;
- int interval;
- struct sockaddr_in destination;
-@@ -2381,6 +2382,22 @@ void send_request (cpp)
- /* Now do a preinit on the interface so that we can
- discover a new address. */
- script_init (client, "PREINIT", (struct string_list *)0);
-+
-+ /* Has an active lease */
-+ if (client -> interface -> addresses != NULL) {
-+ for (i = 0; i < client -> interface -> address_count; i++) {
-+ if (client -> active &&
-+ client -> active -> is_bootp &&
-+ client -> active -> expiry > cur_time &&
-+ client -> interface -> addresses[i].s_addr != 0 &&
-+ client -> active -> address.len == 4 &&
-+ memcpy (client -> active -> address.iabuf, &(client -> interface -> addresses[i]), 4) == 0) {
-+ client_envadd (client, "", "keep_old_ip", "%s", "yes");
-+ break;
-+ }
-+ }
-+ }
-+
- if (client -> alias)
- script_write_params (client, "alias_",
- client -> alias);
+++ /dev/null
-diff -up dhcp-4.2.0/server/dhcpv6.c.noprefixavail dhcp-4.2.0/server/dhcpv6.c
---- dhcp-4.2.0/server/dhcpv6.c.noprefixavail 2010-10-07 13:48:45.000000000 +0200
-+++ dhcp-4.2.0/server/dhcpv6.c 2010-10-13 11:00:25.000000000 +0200
-@@ -1134,7 +1134,7 @@ try_client_v6_prefix(struct iasubopt **p
- return DHCP_R_INVALIDARG;
- }
- tmp_plen = (int) requested_pref->data[0];
-- if ((tmp_plen < 3) || (tmp_plen > 128)) {
-+ if ((tmp_plen < 3) || (tmp_plen > 128) ||((int)tmp_plen != pool->units)) {
- return ISC_R_FAILURE;
- }
- memcpy(&tmp_pref, requested_pref->data + 1, sizeof(tmp_pref));
-@@ -1147,9 +1147,8 @@ try_client_v6_prefix(struct iasubopt **p
- return ISC_R_FAILURE;
- }
-
-- if (((int)tmp_plen != pool->units) ||
-- !ipv6_in_pool(&tmp_pref, pool)) {
-- return ISC_R_FAILURE;
-+ if (!ipv6_in_pool(&tmp_pref, pool)) {
-+ return ISC_R_ADDRNOTAVAIL;
- }
-
- if (prefix6_exists(pool, &tmp_pref, tmp_plen)) {
-@@ -1409,13 +1408,6 @@ lease_to_client(struct data_string *repl
- if ((status != ISC_R_SUCCESS) &&
- (status != ISC_R_NORESOURCES))
- goto exit;
--
-- /*
-- * If any prefix cannot be given to any IA_PD, then
-- * set the NoPrefixAvail status code.
-- */
-- if (reply.client_resources == 0)
-- no_resources_avail = ISC_TRUE;
- }
-
- /*
-@@ -1549,36 +1541,6 @@ lease_to_client(struct data_string *repl
- reply.opt_state, reply.packet,
- required_opts_NAA,
- NULL);
-- } else if (no_resources_avail && (reply.ia_count == 0) &&
-- (reply.packet->dhcpv6_msg_type == DHCPV6_SOLICIT))
-- {
-- /* Set the NoPrefixAvail status code. */
-- if (!set_status_code(STATUS_NoPrefixAvail,
-- "No prefixes available for this "
-- "interface.", reply.opt_state)) {
-- log_error("lease_to_client: Unable to set "
-- "NoPrefixAvail status code.");
-- goto exit;
-- }
--
-- /* Rewind the cursor to the start. */
-- reply.cursor = REPLY_OPTIONS_INDEX;
--
-- /*
-- * Produce an advertise that includes only:
-- *
-- * Status code.
-- * Server DUID.
-- * Client DUID.
-- */
-- reply.buf.reply.msg_type = DHCPV6_ADVERTISE;
-- reply.cursor += store_options6((char *)reply.buf.data +
-- reply.cursor,
-- sizeof(reply.buf) -
-- reply.cursor,
-- reply.opt_state, reply.packet,
-- required_opts_NAA,
-- NULL);
- } else {
- /*
- * Having stored the client's IA's, store any options that
-@@ -2793,16 +2755,18 @@ find_client_temporaries(struct reply_sta
- */
- static isc_result_t
- reply_process_try_addr(struct reply_state *reply, struct iaddr *addr) {
-- isc_result_t status = ISC_R_NORESOURCES;
-+ isc_result_t status = ISC_R_ADDRNOTAVAIL;
- struct ipv6_pool *pool;
- int i;
- struct data_string data_addr;
-
- if ((reply == NULL) || (reply->shared == NULL) ||
-- (reply->shared->ipv6_pools == NULL) || (addr == NULL) ||
-- (reply->lease != NULL))
-+ (addr == NULL) || (reply->lease != NULL))
- return DHCP_R_INVALIDARG;
-
-+ if (reply->shared->ipv6_pools == NULL)
-+ return ISC_R_ADDRNOTAVAIL;
-+
- memset(&data_addr, 0, sizeof(data_addr));
- data_addr.len = addr->len;
- data_addr.data = addr->iabuf;
-@@ -3314,7 +3278,9 @@ reply_process_ia_pd(struct reply_state *
- if (status == ISC_R_CANCELED)
- break;
-
-- if ((status != ISC_R_SUCCESS) && (status != ISC_R_ADDRINUSE))
-+ if ((status != ISC_R_SUCCESS) &&
-+ (status != ISC_R_ADDRINUSE) &&
-+ (status != ISC_R_ADDRNOTAVAIL))
- goto cleanup;
- }
-
-@@ -3594,7 +3560,8 @@ reply_process_prefix(struct reply_state
-
- /* Either error out or skip this prefix. */
- if ((status != ISC_R_SUCCESS) &&
-- (status != ISC_R_ADDRINUSE))
-+ (status != ISC_R_ADDRINUSE) &&
-+ (status != ISC_R_ADDRNOTAVAIL))
- goto cleanup;
-
- if (reply->lease == NULL) {
-@@ -3773,16 +3740,18 @@ prefix_is_owned(struct reply_state *repl
- static isc_result_t
- reply_process_try_prefix(struct reply_state *reply,
- struct iaddrcidrnet *pref) {
-- isc_result_t status = ISC_R_NORESOURCES;
-+ isc_result_t status = ISC_R_ADDRNOTAVAIL;
- struct ipv6_pool *pool;
- int i;
- struct data_string data_pref;
-
- if ((reply == NULL) || (reply->shared == NULL) ||
-- (reply->shared->ipv6_pools == NULL) || (pref == NULL) ||
-- (reply->lease != NULL))
-+ (pref == NULL) || (reply->lease != NULL))
- return DHCP_R_INVALIDARG;
-
-+ if (reply->shared->ipv6_pools == NULL)
-+ return ISC_R_ADDRNOTAVAIL;
-+
- memset(&data_pref, 0, sizeof(data_pref));
- data_pref.len = 17;
- if (!buffer_allocate(&data_pref.buffer, data_pref.len, MDL)) {
+++ /dev/null
-diff -up dhcp-4.2.0/includes/dhcpd.h.paths dhcp-4.2.0/includes/dhcpd.h
---- dhcp-4.2.0/includes/dhcpd.h.paths 2010-07-21 13:55:42.000000000 +0200
-+++ dhcp-4.2.0/includes/dhcpd.h 2010-07-21 14:29:57.000000000 +0200
-@@ -1390,15 +1390,15 @@ typedef unsigned char option_mask [16];
- #else /* !DEBUG */
-
- #ifndef _PATH_DHCPD_CONF
--#define _PATH_DHCPD_CONF "/etc/dhcpd.conf"
-+#define _PATH_DHCPD_CONF "/etc/dhcp/dhcpd.conf"
- #endif /* DEBUG */
-
- #ifndef _PATH_DHCPD_DB
--#define _PATH_DHCPD_DB LOCALSTATEDIR"/db/dhcpd.leases"
-+#define _PATH_DHCPD_DB LOCALSTATEDIR"/dhcpd/dhcpd.leases"
- #endif
-
- #ifndef _PATH_DHCPD6_DB
--#define _PATH_DHCPD6_DB LOCALSTATEDIR"/db/dhcpd6.leases"
-+#define _PATH_DHCPD6_DB LOCALSTATEDIR"/dhcpd/dhcpd6.leases"
- #endif
-
- #ifndef _PATH_DHCPD_PID
-@@ -1412,7 +1412,7 @@ typedef unsigned char option_mask [16];
- #endif /* DEBUG */
-
- #ifndef _PATH_DHCLIENT_CONF
--#define _PATH_DHCLIENT_CONF "/etc/dhclient.conf"
-+#define _PATH_DHCLIENT_CONF "/etc/dhcp/dhclient.conf"
- #endif
-
- #ifndef _PATH_DHCLIENT_SCRIPT
-@@ -1428,11 +1428,11 @@ typedef unsigned char option_mask [16];
- #endif
-
- #ifndef _PATH_DHCLIENT_DB
--#define _PATH_DHCLIENT_DB LOCALSTATEDIR"/db/dhclient.leases"
-+#define _PATH_DHCLIENT_DB LOCALSTATEDIR"/dhclient/dhclient.leases"
- #endif
-
- #ifndef _PATH_DHCLIENT6_DB
--#define _PATH_DHCLIENT6_DB LOCALSTATEDIR"/db/dhclient6.leases"
-+#define _PATH_DHCLIENT6_DB LOCALSTATEDIR"/dhclient/dhclient6.leases"
- #endif
-
- #ifndef _PATH_RESOLV_CONF
+++ /dev/null
-diff -up dhcp-4.2.1-P1/client/dhclient.c.CVE-2011-0997 dhcp-4.2.1-P1/client/dhclient.c
---- dhcp-4.2.1-P1/client/dhclient.c.CVE-2011-0997 2011-04-06 20:21:43.000000000 +0200
-+++ dhcp-4.2.1-P1/client/dhclient.c 2011-04-06 20:22:31.000000000 +0200
-@@ -4545,11 +4545,11 @@ static int check_option_values(struct un
- if ((universe == NULL) || (universe == &dhcp_universe)) {
- switch(opt) {
- case DHO_HOST_NAME:
-- case DHO_DOMAIN_NAME:
- case DHO_NIS_DOMAIN:
- case DHO_NETBIOS_SCOPE:
- return check_domain_name(ptr, len, 0);
- break;
-+ case DHO_DOMAIN_NAME: /* accept a list for compatibiliy */
- case DHO_DOMAIN_SEARCH:
- return check_domain_name_list(ptr, len, 0);
- break;
+++ /dev/null
-diff -up dhcp-4.2.1b1/client/dhclient.conf.supersede dhcp-4.2.1b1/client/dhclient.conf
---- dhcp-4.2.1b1/client/dhclient.conf.supersede 2010-09-15 01:03:56.000000000 +0200
-+++ dhcp-4.2.1b1/client/dhclient.conf 2011-01-27 18:38:28.000000000 +0100
-@@ -4,7 +4,7 @@ send dhcp-lease-time 3600;
- supersede domain-search "fugue.com", "home.vix.com";
- prepend domain-name-servers 127.0.0.1;
- request subnet-mask, broadcast-address, time-offset, routers,
-- domain-name, domain-name-servers, host-name;
-+ domain-search, domain-name-servers, host-name;
- require subnet-mask, domain-name-servers;
- timeout 60;
- retry 60;
if (sock < 0) {
if (errno == EBUSY) {
continue;
-diff -up dhcp-4.2.2b1/dst/dst_api.c.cloexec dhcp-4.2.2b1/dst/dst_api.c
---- dhcp-4.2.2b1/dst/dst_api.c.cloexec 2009-10-29 01:46:48.000000000 +0100
-+++ dhcp-4.2.2b1/dst/dst_api.c 2011-07-01 14:13:31.035887670 +0200
-@@ -437,7 +437,7 @@ dst_s_write_private_key(const DST_KEY *k
- PRIVATE_KEY, PATH_MAX);
-
- /* Do not overwrite an existing file */
-- if ((fp = dst_s_fopen(file, "w", 0600)) != NULL) {
-+ if ((fp = dst_s_fopen(file, "we", 0600)) != NULL) {
- int nn;
- if ((nn = fwrite(encoded_block, 1, len, fp)) != len) {
- EREPORT(("dst_write_private_key(): Write failure on %s %d != %d errno=%d\n",
-@@ -494,7 +494,7 @@ dst_s_read_public_key(const char *in_nam
- * flags, proto, alg stored as decimal (or hex numbers FIXME).
- * (FIXME: handle parentheses for line continuation.)
- */
-- if ((fp = dst_s_fopen(name, "r", 0)) == NULL) {
-+ if ((fp = dst_s_fopen(name, "re", 0)) == NULL) {
- EREPORT(("dst_read_public_key(): Public Key not found %s\n",
- name));
- return (NULL);
-@@ -620,7 +620,7 @@ dst_s_write_public_key(const DST_KEY *ke
- return (0);
- }
- /* create public key file */
-- if ((fp = dst_s_fopen(filename, "w+", 0644)) == NULL) {
-+ if ((fp = dst_s_fopen(filename, "w+e", 0644)) == NULL) {
- EREPORT(("DST_write_public_key: open of file:%s failed (errno=%d)\n",
- filename, errno));
- return (0);
-@@ -854,7 +854,7 @@ dst_s_read_private_key_file(char *name,
- return (0);
- }
- /* first check if we can find the key file */
-- if ((fp = dst_s_fopen(filename, "r", 0)) == NULL) {
-+ if ((fp = dst_s_fopen(filename, "re", 0)) == NULL) {
- EREPORT(("dst_s_read_private_key_file: Could not open file %s in directory %s\n",
- filename, dst_path[0] ? dst_path :
- (char *) getcwd(NULL, PATH_MAX - 1)));
-diff -up dhcp-4.2.2b1/dst/prandom.c.cloexec dhcp-4.2.2b1/dst/prandom.c
---- dhcp-4.2.2b1/dst/prandom.c.cloexec 2009-11-20 02:49:01.000000000 +0100
-+++ dhcp-4.2.2b1/dst/prandom.c 2011-07-01 14:13:31.035887670 +0200
-@@ -269,7 +269,7 @@ get_dev_random(u_char *output, unsigned
-
- s = stat("/dev/random", &st);
- if (s == 0 && S_ISCHR(st.st_mode)) {
-- if ((fd = open("/dev/random", O_RDONLY | O_NONBLOCK)) != -1) {
-+ if ((fd = open("/dev/random", O_RDONLY | O_NONBLOCK | O_CLOEXEC)) != -1) {
- if ((n = read(fd, output, size)) < 0)
- n = 0;
- close(fd);
-@@ -480,7 +480,7 @@ digest_file(dst_work *work)
- work->file_digest = dst_free_key(work->file_digest);
- return (0);
- }
-- if ((fp = fopen(name, "r")) == NULL)
-+ if ((fp = fopen(name, "re")) == NULL)
- return (0);
- for (no = 0; (i = fread(buf, sizeof(*buf), sizeof(buf), fp)) > 0;
- no += i)
diff -up dhcp-4.2.2b1/omapip/trace.c.cloexec dhcp-4.2.2b1/omapip/trace.c
--- dhcp-4.2.2b1/omapip/trace.c.cloexec 2010-05-27 02:34:57.000000000 +0200
+++ dhcp-4.2.2b1/omapip/trace.c 2011-07-01 14:13:31.036887669 +0200
man_MANS = dhcrelay.8
EXTRA_DIST = $(man_MANS)
-diff -up dhcp-4.2.2b1/server/dhcpd.c.capability dhcp-4.2.2b1/server/dhcpd.c
---- dhcp-4.2.2b1/server/dhcpd.c.capability 2011-07-01 15:09:06.636784192 +0200
-+++ dhcp-4.2.2b1/server/dhcpd.c 2011-07-01 15:09:06.670783841 +0200
-@@ -58,6 +58,11 @@ static const char url [] =
- # undef group
- #endif /* PARANOIA */
-
-+#ifdef HAVE_LIBCAP_NG
-+# include <cap-ng.h>
-+ int keep_capabilities = 0;
-+#endif
-+
- static void usage(void);
-
- struct iaddr server_identifier;
-@@ -403,6 +408,10 @@ main(int argc, char **argv) {
- traceinfile = argv [i];
- trace_replay_init ();
- #endif /* TRACING */
-+ } else if (!strcmp(argv[i], "-nc")) {
-+#ifdef HAVE_LIBCAP_NG
-+ keep_capabilities = 1;
-+#endif
- } else if (argv [i][0] == '-') {
- usage ();
- } else {
-@@ -459,6 +468,17 @@ main(int argc, char **argv) {
- }
- #endif /* DHCPv6 */
-
-+#ifdef HAVE_LIBCAP_NG
-+ /* Drop capabilities */
-+ if (!keep_capabilities) {
-+ capng_clear(CAPNG_SELECT_BOTH);
-+ capng_updatev(CAPNG_ADD, CAPNG_EFFECTIVE|CAPNG_PERMITTED,
-+ CAP_NET_RAW, CAP_NET_BIND_SERVICE, CAP_SYS_CHROOT, CAP_SETUID, CAP_SETGID, -1);
-+ capng_apply(CAPNG_SELECT_BOTH);
-+ log_info ("Dropped all unnecessary capabilities.");
-+ }
-+#endif
-+
- /*
- * convert relative path names to absolute, for files that need
- * to be reopened after chdir() has been called
-@@ -859,6 +879,15 @@ main(int argc, char **argv) {
- omapi_set_int_value ((omapi_object_t *)dhcp_control_object,
- (omapi_object_t *)0, "state", server_running);
-
-+#ifdef HAVE_LIBCAP_NG
-+ /* Drop all capabilities */
-+ if (!keep_capabilities) {
-+ capng_clear(CAPNG_SELECT_BOTH);
-+ capng_apply(CAPNG_SELECT_BOTH);
-+ log_info ("Dropped all capabilities.");
-+ }
-+#endif
-+
- /* Receive packets and dispatch them... */
- dispatch ();
-
-diff -up dhcp-4.2.2b1/server/Makefile.am.capability dhcp-4.2.2b1/server/Makefile.am
---- dhcp-4.2.2b1/server/Makefile.am.capability 2011-07-01 15:09:06.546785121 +0200
-+++ dhcp-4.2.2b1/server/Makefile.am 2011-07-01 15:09:06.671783830 +0200
-@@ -8,7 +8,8 @@ dhcpd_SOURCES = dhcpd.c dhcp.c bootp.c c
-
- dhcpd_CFLAGS = $(LDAP_CFLAGS)
- dhcpd_LDADD = ../common/libdhcp.a ../omapip/libomapi.a \
-- ../dhcpctl/libdhcpctl.a $(BIND9_LIBDIR) -ldns-export -lisc-export
-+ ../dhcpctl/libdhcpctl.a $(BIND9_LIBDIR) -ldns-export -lisc-export \
-+ $(CAPNG_LDADD)
-
- man_MANS = dhcpd.8 dhcpd.conf.5 dhcpd.leases.5
- EXTRA_DIST = $(man_MANS)
diff -up dhcp-4.2.2/common/lpf.c.gpxe-cid dhcp-4.2.2/common/lpf.c
--- dhcp-4.2.2/common/lpf.c.gpxe-cid 2011-09-16 18:23:20.183453996 +0200
+++ dhcp-4.2.2/common/lpf.c 2011-09-16 18:25:28.235804421 +0200
-@@ -591,6 +591,37 @@ void maybe_setup_fallback ()
- }
- }
-
-+static unsigned char * get_ib_hw_addr(char * name)
-+{
-+ struct ifaddrs *ifaddrs;
-+ struct ifaddrs *ifa;
-+ struct sockaddr_ll *sll = NULL;
-+ static unsigned char hw_addr[8];
-+
-+ if (getifaddrs(&ifaddrs) == -1)
-+ return NULL;
-+
-+ for (ifa = ifaddrs; ifa != NULL; ifa = ifa->ifa_next) {
-+ if (ifa->ifa_addr == NULL)
-+ continue;
-+ if (ifa->ifa_addr->sa_family != AF_PACKET)
-+ continue;
-+ if (ifa->ifa_flags & IFF_LOOPBACK)
-+ continue;
-+ if (strcmp(ifa->ifa_name, name) == 0) {
-+ sll = (struct sockaddr_ll *)(void *)ifa->ifa_addr;
-+ break;
-+ }
-+ }
-+ if (sll == NULL) {
-+ freeifaddrs(ifaddrs);
-+ return NULL;
-+ }
-+ memcpy(hw_addr, &sll->sll_addr[sll->sll_halen - 8], 8);
-+ freeifaddrs(ifaddrs);
-+ return (unsigned char *)&hw_addr;
-+}
-+
- void
- get_hw_addr(struct interface_info *info)
- {
-@@ -599,6 +630,7 @@ get_hw_addr(struct interface_info *info)
- struct ifaddrs *ifaddrs;
- struct ifaddrs *ifa;
- struct sockaddr_ll *sll = NULL;
-+ unsigned char *hw_addr;
-
- if (getifaddrs(&ifaddrs) == -1)
- log_fatal("Failed to get interfaces");
-@@ -660,6 +692,10 @@ get_hw_addr(struct interface_info *info)
+@@ -698,6 +698,7 @@ get_hw_addr(struct interface_info *info)
hw->hlen = 1;
hw->hbuf[0] = HTYPE_INFINIBAND;
-+ hw_addr = get_ib_hw_addr(name);
-+ if (!hw_addr)
-+ log_fatal("Failed getting %s hw addr", name);
-+ memcpy (&hw->hbuf [1], hw_addr, 8);
++ memcpy(&hw->hbuf[1], &sll->sll_addr[sll->sll_halen - 8], 8);
break;
#if defined(ARPHRD_PPP)
case ARPHRD_PPP:
diff -up dhcp-4.2.2/client/Makefile.am.sharedlib dhcp-4.2.2/client/Makefile.am
---- dhcp-4.2.2/client/Makefile.am.sharedlib 2011-09-09 16:35:56.000000000 +0200
-+++ dhcp-4.2.2/client/Makefile.am 2011-09-09 16:36:29.849007951 +0200
-@@ -4,7 +4,7 @@ dhclient_SOURCES = clparse.c dhclient.c
+--- dhcp-4.2.2/client/Makefile.am.sharedlib 2011-10-09 20:07:40.000000000 +0200
++++ dhcp-4.2.2/client/Makefile.am 2011-10-09 20:07:40.000000000 +0200
+@@ -4,7 +4,7 @@ dhclient_SOURCES = clparse.c dhclient.c
scripts/bsdos scripts/freebsd scripts/linux scripts/macos \
scripts/netbsd scripts/nextstep scripts/openbsd \
scripts/solaris scripts/openwrt
man_MANS = dhclient.8 dhclient-script.8 dhclient.conf.5 dhclient.leases.5
EXTRA_DIST = $(man_MANS)
diff -up dhcp-4.2.2/configure.ac.sharedlib dhcp-4.2.2/configure.ac
---- dhcp-4.2.2/configure.ac.sharedlib 2011-09-09 16:35:56.097000001 +0200
-+++ dhcp-4.2.2/configure.ac 2011-09-09 16:35:56.383000000 +0200
+--- dhcp-4.2.2/configure.ac.sharedlib 2011-10-09 20:07:40.000000000 +0200
++++ dhcp-4.2.2/configure.ac 2011-10-09 20:07:40.000000000 +0200
@@ -30,7 +30,8 @@ fi
# Use this to define _GNU_SOURCE to pull in the IPv6 Advanced Socket API.
AC_USE_SYSTEM_EXTENSIONS
# we sometimes need to know byte order for building packets
diff -up dhcp-4.2.2/dhcpctl/Makefile.am.sharedlib dhcp-4.2.2/dhcpctl/Makefile.am
---- dhcp-4.2.2/dhcpctl/Makefile.am.sharedlib 2011-09-09 16:35:55.459000001 +0200
-+++ dhcp-4.2.2/dhcpctl/Makefile.am 2011-09-09 16:35:56.384000000 +0200
+--- dhcp-4.2.2/dhcpctl/Makefile.am.sharedlib 2011-10-09 20:07:39.000000000 +0200
++++ dhcp-4.2.2/dhcpctl/Makefile.am 2011-10-09 20:07:40.000000000 +0200
@@ -1,15 +1,15 @@
bin_PROGRAMS = omshell
-lib_LIBRARIES = libdhcpctl.a
-cltest_LDADD = libdhcpctl.a ../common/libdhcp.a ../omapip/libomapi.a \
+cltest_LDADD = libdhcpctl.la ../common/libdhcp.a ../omapip/libomapi.la \
$(BIND9_LIBDIR) -ldns-export -lisc-export
-diff -up dhcp-4.2.2/dst/base64.c.sharedlib dhcp-4.2.2/dst/base64.c
---- dhcp-4.2.2/dst/base64.c.sharedlib 2009-11-20 02:49:01.000000000 +0100
-+++ dhcp-4.2.2/dst/base64.c 2011-09-09 16:35:56.385000000 +0200
-@@ -64,6 +64,7 @@ static const char rcsid[] = "$Id: base64
-
- #include <sys/socket.h>
-
-+#include "dst_internal.h"
- #include "cdefs.h"
- #include "osdep.h"
- #include "arpa/nameser.h"
-diff -up dhcp-4.2.2/dst/Makefile.am.sharedlib dhcp-4.2.2/dst/Makefile.am
---- dhcp-4.2.2/dst/Makefile.am.sharedlib 2007-05-29 18:32:10.000000000 +0200
-+++ dhcp-4.2.2/dst/Makefile.am 2011-09-09 16:35:56.386000000 +0200
-@@ -1,8 +1,8 @@
- AM_CPPFLAGS = -DMINIRES_LIB -DHMAC_MD5
-
--lib_LIBRARIES = libdst.a
-+lib_LTLIBRARIES = libdst.la
-
--libdst_a_SOURCES = dst_support.c dst_api.c hmac_link.c md5_dgst.c \
-+libdst_la_SOURCES = dst_support.c dst_api.c hmac_link.c md5_dgst.c \
- base64.c prandom.c
-
- EXTRA_DIST = dst_internal.h md5.h md5_locl.h
diff -up dhcp-4.2.2/omapip/Makefile.am.sharedlib dhcp-4.2.2/omapip/Makefile.am
---- dhcp-4.2.2/omapip/Makefile.am.sharedlib 2011-09-09 16:35:55.000000000 +0200
-+++ dhcp-4.2.2/omapip/Makefile.am 2011-09-09 16:37:36.734000324 +0200
+--- dhcp-4.2.2/omapip/Makefile.am.sharedlib 2011-10-09 20:07:39.000000000 +0200
++++ dhcp-4.2.2/omapip/Makefile.am 2011-10-09 20:07:40.000000000 +0200
@@ -1,7 +1,7 @@
-lib_LIBRARIES = libomapi.a
+lib_LTLIBRARIES = libomapi.la
+svtest_LDADD = libomapi.la $(BIND9_LIBDIR) -ldns-export -lisc-export
diff -up dhcp-4.2.2/relay/Makefile.am.sharedlib dhcp-4.2.2/relay/Makefile.am
---- dhcp-4.2.2/relay/Makefile.am.sharedlib 2011-09-09 16:35:56.000000000 +0200
-+++ dhcp-4.2.2/relay/Makefile.am 2011-09-09 16:37:57.058019749 +0200
+--- dhcp-4.2.2/relay/Makefile.am.sharedlib 2011-10-09 20:07:40.000000000 +0200
++++ dhcp-4.2.2/relay/Makefile.am 2011-10-09 20:07:40.000000000 +0200
@@ -2,7 +2,7 @@ AM_CPPFLAGS = -DLOCALSTATEDIR='"@localst
sbin_PROGRAMS = dhcrelay
man_MANS = dhcrelay.8
EXTRA_DIST = $(man_MANS)
diff -up dhcp-4.2.2/server/Makefile.am.sharedlib dhcp-4.2.2/server/Makefile.am
---- dhcp-4.2.2/server/Makefile.am.sharedlib 2011-09-09 16:35:56.000000000 +0200
-+++ dhcp-4.2.2/server/Makefile.am 2011-09-09 16:38:56.291004599 +0200
+--- dhcp-4.2.2/server/Makefile.am.sharedlib 2011-10-09 20:07:39.000000000 +0200
++++ dhcp-4.2.2/server/Makefile.am 2011-10-09 20:08:26.000000000 +0200
@@ -7,8 +7,8 @@ dhcpd_SOURCES = dhcpd.c dhcp.c bootp.c c
dhcpv6.c mdb6.c ldap.c ldap_casa.c
dhcpd_CFLAGS = $(LDAP_CFLAGS)
-dhcpd_LDADD = ../common/libdhcp.a ../omapip/libomapi.a \
-- ../dhcpctl/libdhcpctl.a $(BIND9_LIBDIR) -ldns-export -lisc-export \
+- ../dhcpctl/libdhcpctl.a $(BIND9_LIBDIR) -ldns-export -lisc-export
+dhcpd_LDADD = ../common/libdhcp.a ../omapip/libomapi.la \
-+ ../dhcpctl/libdhcpctl.la $(BIND9_LIBDIR) -ldns-export -lisc-export \
- $(CAPNG_LDADD)
++ ../dhcpctl/libdhcpctl.la $(BIND9_LIBDIR) -ldns-export -lisc-export
man_MANS = dhcpd.8 dhcpd.conf.5 dhcpd.leases.5
+ EXTRA_DIST = $(man_MANS)
--- /dev/null
+diff -up dhcp-4.2.3-P2/server/dhcpd.c.log_perror dhcp-4.2.3-P2/server/dhcpd.c
+--- dhcp-4.2.3-P2/server/dhcpd.c.log_perror 2012-02-22 14:24:57.000000000 +0100
++++ dhcp-4.2.3-P2/server/dhcpd.c 2012-02-22 14:29:09.964576687 +0100
+@@ -315,6 +315,7 @@ main(int argc, char **argv) {
+ #ifndef DEBUG
+ daemon = 0;
+ #endif
++ log_perror = 0;
+ } else if (!strcmp (argv [i], "-d")) {
+ #ifndef DEBUG
+ daemon = 0;
--- /dev/null
+diff -up dhcp-4.2.3-P2/common/dhcp-options.5.rfc5970 dhcp-4.2.3-P2/common/dhcp-options.5
+--- dhcp-4.2.3-P2/common/dhcp-options.5.rfc5970 2012-03-21 19:39:47.572002389 +0100
++++ dhcp-4.2.3-P2/common/dhcp-options.5 2012-03-21 19:39:47.670001164 +0100
+@@ -1770,7 +1770,48 @@ The \fBlq-relay-data\fR option is used i
+ The \fBlq-client-link\fR option is used internally by for lease query.
+ .RE
+ .PP
++
++.B option
++.B dhcp6.bootfile-url
++.I string
++.B ;
++.RS 0.25i
++.PP
++The server sends this option to inform the client about a URL to a
++boot file. Used primarily for UEFI network booting, it contains an RFC3986
++compliant URI which the client may use to boot an operating system. This option
++is defined in RFC5970
++.RE
++.PP
++
++.B option
++.B dhcp6.arch-type
++.I arch-id \fR[\fB,\fR arch-id\fR...]
++.B ;
++.RS 0.25i
++.PP
++A client will send this option to a server so that the server may make decisions
++on what options and addresses to offer the requesting client. The option
++consists of a list of 16 bit unsigned values that represent the architecture of
++the requesting client. These values corespond to the values available to the
++dhcpv4 option architecture-type, as defined in RFC4578, section 2.1.
++This option is defined in RFC5970
+ .RE
++.PP
++
++.B option
++.B dhcp6.net-id
++.I uint8 uint8 uint8
++.B ;
++.RS 0.25i
++.PP
++A client will send this option to a server to inform it about the clients level
++of UNDI support. The option consists of 3 octets (a type, major and minor
++value). Specific meanings of these values are doumented in section 2.2 of
++RFC4578.
++This option is defined in RFC5970
++.RE
++.PP
+ .SH DEFINING NEW OPTIONS
+ The Internet Systems Consortium DHCP client and server provide the
+ capability to define new options. Each DHCP option has a name, a
+diff -up dhcp-4.2.3-P2/common/tables.c.rfc5970 dhcp-4.2.3-P2/common/tables.c
+--- dhcp-4.2.3-P2/common/tables.c.rfc5970 2012-03-21 19:39:47.577002328 +0100
++++ dhcp-4.2.3-P2/common/tables.c 2012-03-21 19:39:47.670001164 +0100
+@@ -461,6 +461,18 @@ static struct option dhcpv6_options[] =
+ { "lq-relay-data", "6X", &dhcpv6_universe, 47, 1 },
+ { "lq-client-link", "6A", &dhcpv6_universe, 48, 1 },
+
++ /* RFC5970 OPTIONS */
++
++ { "bootfile-url", "t", &dhcpv6_universe, 59, 1},
++#if 0
++ /* Can't implement this until arrays of strings with length "StA"
++ * are implemented
++ */
++ { "bootfile-param", "StA", &dhcpv6_universe, 60, 1},
++#endif
++ { "arch-type", "Sa", &dhcpv6_universe, 61, 1},
++ { "net-id", "BBB", &dhcpv6_universe, 62, 1},
++
+ { NULL, NULL, NULL, 0, 0 }
+ };
+
+diff -up dhcp-4.2.3-P2/includes/dhcp6.h.rfc5970 dhcp-4.2.3-P2/includes/dhcp6.h
+--- dhcp-4.2.3-P2/includes/dhcp6.h.rfc5970 2010-02-17 21:33:55.000000000 +0100
++++ dhcp-4.2.3-P2/includes/dhcp6.h 2012-03-21 19:39:47.671001151 +0100
+@@ -75,6 +75,11 @@
+ #define D6O_CLT_TIME 46 /* RFC5007 */
+ #define D6O_LQ_RELAY_DATA 47 /* RFC5007 */
+ #define D6O_LQ_CLIENT_LINK 48 /* RFC5007 */
++/* 49-58 Not yet assigned */
++#define D60_BOOT_URL 59 /* RFC5970 */
++#define D60_BOOT_PARAMS 60 /* RFC5970 */
++#define D60_CLIENT_ARCH 61 /* RFC5970 */
++#define D60_CLIENT_NII 62 /* RFC5970 */
+
+ /*
+ * Status Codes, from RFC 3315 section 24.4, and RFC 3633, 5007.
--- /dev/null
+diff -up dhcp-4.2.3/client/dhclient.c.decline-onetry dhcp-4.2.3/client/dhclient.c
+--- dhcp-4.2.3/client/dhclient.c.decline-onetry 2011-11-24 14:21:50.000000000 +0100
++++ dhcp-4.2.3/client/dhclient.c 2011-11-24 14:23:44.472893215 +0100
+@@ -1704,11 +1704,18 @@ void bind_lease (client)
+ if (script_go (client)) {
+ make_decline (client, client -> new);
+ send_decline (client);
+- destroy_client_lease (client -> new);
+- client -> new = (struct client_lease *)0;
+- client -> state = S_DECLINED;
+- state_init (client);
+- return;
++ if (onetry) {
++ if (!quiet)
++ log_info ("Unable to obtain a lease on first try.%s",
++ " Exiting.");
++ exit (2);
++ } else {
++ destroy_client_lease (client -> new);
++ client -> new = (struct client_lease *)0;
++ client -> state = S_DECLINED;
++ state_init (client);
++ return;
++ }
+ }
+
+ /* Write out the new lease if it has been long enough. */
--- /dev/null
+diff -up dhcp-4.2.3-P1/server/dhcpd.c.paranoia dhcp-4.2.3-P1/server/dhcpd.c
+--- dhcp-4.2.3-P1/server/dhcpd.c.paranoia 2011-12-20 18:02:26.000000000 +0100
++++ dhcp-4.2.3-P1/server/dhcpd.c 2011-12-20 18:03:43.840037108 +0100
+@@ -771,22 +771,6 @@ main(int argc, char **argv) {
+ exit (0);
+ }
+
+-#if defined (PARANOIA)
+- /* change uid to the specified one */
+-
+- if (set_gid) {
+- if (setgroups (0, (void *)0))
+- log_fatal ("setgroups: %m");
+- if (setgid (set_gid))
+- log_fatal ("setgid(%d): %m", (int) set_gid);
+- }
+-
+- if (set_uid) {
+- if (setuid (set_uid))
+- log_fatal ("setuid(%d): %m", (int) set_uid);
+- }
+-#endif /* PARANOIA */
+-
+ /*
+ * Deal with pid files. If the user told us
+ * not to write a file we don't read one either
+@@ -823,6 +807,22 @@ main(int argc, char **argv) {
+ }
+ }
+
++#if defined (PARANOIA)
++ /* change uid to the specified one */
++
++ if (set_gid) {
++ if (setgroups (0, (void *)0))
++ log_fatal ("setgroups: %m");
++ if (setgid (set_gid))
++ log_fatal ("setgid(%d): %m", (int) set_gid);
++ }
++
++ if (set_uid) {
++ if (setuid (set_uid))
++ log_fatal ("setuid(%d): %m", (int) set_uid);
++ }
++#endif /* PARANOIA */
++
+ /* If we were requested to log to stdout on the command line,
+ keep doing so; otherwise, stop. */
+ if (log_perror == -1)
-diff -up dhcp-4.2.1b1/common/dispatch.c.64-bit_lease_parse dhcp-4.2.1b1/common/dispatch.c
-diff -up dhcp-4.2.1b1/common/parse.c.64-bit_lease_parse dhcp-4.2.1b1/common/parse.c
---- dhcp-4.2.1b1/common/parse.c.64-bit_lease_parse 2010-12-30 00:01:42.000000000 +0100
-+++ dhcp-4.2.1b1/common/parse.c 2011-01-28 08:01:10.000000000 +0100
-@@ -909,8 +909,8 @@ TIME
+diff -up dhcp-4.2.4b1/common/parse.c.64-bit_lease_parse dhcp-4.2.4b1/common/parse.c
+--- dhcp-4.2.4b1/common/parse.c.64-bit_lease_parse 2012-03-09 12:28:10.000000000 +0100
++++ dhcp-4.2.4b1/common/parse.c 2012-04-16 17:30:55.867045149 +0200
+@@ -906,8 +906,8 @@ TIME
parse_date_core(cfile)
struct parse *cfile;
{
- int guess;
-- int tzoff, wday, year, mon, mday, hour, min, sec;
+- int tzoff, year, mon, mday, hour, min, sec;
+ TIME guess;
-+ long int tzoff, wday, year, mon, mday, hour, min, sec;
++ long int tzoff, year, mon, mday, hour, min, sec;
const char *val;
enum dhcp_token token;
static int months[11] = { 31, 59, 90, 120, 151, 181,
-@@ -936,7 +936,7 @@ parse_date_core(cfile)
+@@ -933,7 +933,7 @@ parse_date_core(cfile)
}
token = next_token(&val, NULL, cfile); /* consume number */
return((TIME)guess);
}
-@@ -948,7 +948,7 @@ parse_date_core(cfile)
- return((TIME)0);
- }
- token = next_token(&val, NULL, cfile); /* consume day of week */
-- wday = atoi(val);
-+ wday = atol(val);
-
- /* Year... */
- token = peek_token(&val, NULL, cfile);
-@@ -964,7 +964,7 @@ parse_date_core(cfile)
+@@ -961,7 +961,7 @@ parse_date_core(cfile)
somebody invents a time machine, I think we can safely disregard
it. This actually works around a stupid Y2K bug that was present
in a very early beta release of dhcpd. */
if (year > 1900)
year -= 1900;
-@@ -988,7 +988,7 @@ parse_date_core(cfile)
+@@ -985,7 +985,7 @@ parse_date_core(cfile)
return((TIME)0);
}
token = next_token(&val, NULL, cfile); /* consume month */
/* Slash separating month from day... */
token = peek_token(&val, NULL, cfile);
-@@ -1010,7 +1010,7 @@ parse_date_core(cfile)
+@@ -1007,7 +1007,7 @@ parse_date_core(cfile)
return((TIME)0);
}
token = next_token(&val, NULL, cfile); /* consume day of month */
/* Hour... */
token = peek_token(&val, NULL, cfile);
-@@ -1021,7 +1021,7 @@ parse_date_core(cfile)
+@@ -1018,7 +1018,7 @@ parse_date_core(cfile)
return((TIME)0);
}
token = next_token(&val, NULL, cfile); /* consume hour */
/* Colon separating hour from minute... */
token = peek_token(&val, NULL, cfile);
-@@ -1043,7 +1043,7 @@ parse_date_core(cfile)
+@@ -1040,7 +1040,7 @@ parse_date_core(cfile)
return((TIME)0);
}
token = next_token(&val, NULL, cfile); /* consume minute */
/* Colon separating minute from second... */
token = peek_token(&val, NULL, cfile);
-@@ -1065,13 +1065,13 @@ parse_date_core(cfile)
+@@ -1062,13 +1062,13 @@ parse_date_core(cfile)
return((TIME)0);
}
token = next_token(&val, NULL, cfile); /* consume second */
--- /dev/null
+diff -up dhcp-4.2.4-P1/client/dhclient.c.dhclient6-leases_semicolon dhcp-4.2.4-P1/client/dhclient.c
+--- dhcp-4.2.4-P1/client/dhclient.c.dhclient6-leases_semicolon 2012-07-25 15:20:22.187164614 +0200
++++ dhcp-4.2.4-P1/client/dhclient.c 2012-07-25 15:20:26.648152028 +0200
+@@ -3236,10 +3236,21 @@ void write_lease_option (struct option_c
+ }
+ if (evaluate_option_cache (&ds, packet, lease, client_state,
+ in_options, cfg_options, scope, oc, MDL)) {
+- fprintf(leaseFile, "%soption %s%s%s %s;\n", preamble,
+- name, dot, oc->option->name,
+- pretty_print_option(oc->option, ds.data, ds.len,
+- 1, 1));
++ /* The option name */
++ fprintf(leaseFile, "%soption %s%s%s", preamble,
++ name, dot, oc->option->name);
++
++ /* The option value if there is one */
++ if ((oc->option->format == NULL) ||
++ (oc->option->format[0] != 'Z')) {
++ fprintf(leaseFile, " %s",
++ pretty_print_option(oc->option, ds.data,
++ ds.len, 1, 1));
++ }
++
++ /* The closing semi-colon and newline */
++ fprintf(leaseFile, ";\n");
++
+ data_string_forget (&ds, MDL);
+ }
+ }
+diff -up dhcp-4.2.4-P1/common/parse.c.dhclient6-leases_semicolon dhcp-4.2.4-P1/common/parse.c
+--- dhcp-4.2.4-P1/common/parse.c.dhclient6-leases_semicolon 2012-07-25 15:10:39.683557386 +0200
++++ dhcp-4.2.4-P1/common/parse.c 2012-07-25 15:16:50.826762985 +0200
+@@ -5772,7 +5772,7 @@ int parse_option_decl (oc, cfile)
+ goto alloc;
+
+ case 'Z': /* Zero-length option */
+- token = next_token(&val, (unsigned *)0, cfile);
++ token = peek_token(&val, (unsigned *)0, cfile);
+ if (token != SEMI) {
+ parse_warn(cfile,
+ "semicolon expected.");
--- /dev/null
+diff -up dhcp-4.2.4/common/dispatch.c.foo dhcp-4.2.4/common/dispatch.c
+--- dhcp-4.2.4/common/dispatch.c.foo 2012-07-26 21:31:43.875349675 -0500
++++ dhcp-4.2.4/common/dispatch.c 2012-07-26 21:39:14.961710319 -0500
+@@ -324,7 +324,20 @@ void add_timeout (when, where, what, ref
+ q->next = timeouts;
+ timeouts = q;
+
+- isc_interval_set(&interval, sec & DHCP_SEC_MAX, usec * 1000);
++ /* isc_time_nowplusinterval() is not safe with 64-bit time_t and will
++ * return an error for sufficiently large intervals. We have to limit
++ * the interval to INT_MAX or less to ensure the interval doesn't
++ * overflow 32 bits, since the returned isc_time_t fields are
++ * 32-bit unsigned ints.
++ *
++ * HACK: The 9 is a magic number of seconds, since some time may have
++ * gone by since the last call to gettimeofday() and the one in
++ * isc_time_nowplusinterval().
++ */
++ if (sec > TIME_MAX)
++ sec = TIME_MAX - 9;
++
++ isc_interval_set(&interval, sec, usec * 1000);
+ status = isc_time_nowplusinterval(&expires, &interval);
+ if (status != ISC_R_SUCCESS) {
+ /*
--- /dev/null
+diff -up dhcp-4.2.4-P1/configure.ac.remove-dst dhcp-4.2.4-P1/configure.ac
+--- dhcp-4.2.4-P1/configure.ac.remove-dst 2012-08-17 15:24:29.066454140 +0200
++++ dhcp-4.2.4-P1/configure.ac 2012-08-17 15:24:29.071454073 +0200
+@@ -608,7 +608,6 @@ AC_OUTPUT([
+ common/Makefile
+ common/tests/Makefile
+ dhcpctl/Makefile
+- dst/Makefile
+ includes/Makefile
+ omapip/Makefile
+ relay/Makefile
+diff -up dhcp-4.2.4-P1/includes/Makefile.am.remove-dst dhcp-4.2.4-P1/includes/Makefile.am
+--- dhcp-4.2.4-P1/includes/Makefile.am.remove-dst 2012-07-13 08:17:54.000000000 +0200
++++ dhcp-4.2.4-P1/includes/Makefile.am 2012-08-17 15:25:08.253922458 +0200
+@@ -1,7 +1,6 @@
+ nobase_include_HEADERS = omapip/alloc.h omapip/buffer.h omapip/convert.h \
+ omapip/hash.h omapip/isclib.h omapip/omapip.h \
+- omapip/omapip_p.h omapip/result.h omapip/trace.h \
+- isc-dhcp/dst.h
++ omapip/omapip_p.h omapip/result.h omapip/trace.h
+
+ EXTRA_DIST = cdefs.h ctrace.h dhcp.h dhcp6.h dhcpd.h dhctoken.h failover.h \
+ heap.h inet.h minires.h osdep.h site.h statement.h tree.h \
+diff -up dhcp-4.2.4-P1/Makefile.am.remove-dst dhcp-4.2.4-P1/Makefile.am
+--- dhcp-4.2.4-P1/Makefile.am.remove-dst 2012-08-17 15:24:29.067454126 +0200
++++ dhcp-4.2.4-P1/Makefile.am 2012-08-17 15:24:29.071454073 +0200
+@@ -27,7 +27,7 @@ else
+ SUBDIRS =
+ endif
+
+-SUBDIRS += includes tests common dst omapip client dhcpctl relay server
++SUBDIRS += includes tests common omapip client dhcpctl relay server
+
+ nobase_include_HEADERS = dhcpctl/dhcpctl.h
+
+diff -up dhcp-4.2.4-P1/server/ddns.c.remove-dst dhcp-4.2.4-P1/server/ddns.c
+--- dhcp-4.2.4-P1/server/ddns.c.remove-dst 2012-07-13 08:18:05.000000000 +0200
++++ dhcp-4.2.4-P1/server/ddns.c 2012-08-17 15:24:29.072454060 +0200
+@@ -34,7 +34,6 @@
+ */
+
+ #include "dhcpd.h"
+-#include "dst/md5.h"
+ #include <dns/result.h>
+
+ #ifdef NSUPDATE
-diff -up dhcp-4.2.0-P1/client/dhc6.c.PPP dhcp-4.2.0-P1/client/dhc6.c
---- dhcp-4.2.0-P1/client/dhc6.c.PPP 2010-11-05 10:47:37.000000000 +0100
-+++ dhcp-4.2.0-P1/client/dhc6.c 2010-11-09 15:54:12.000000000 +0100
-@@ -129,7 +129,7 @@ extern int stateless;
+diff -up dhcp-4.2.4b1/client/dhc6.c.PPP dhcp-4.2.4b1/client/dhc6.c
+--- dhcp-4.2.4b1/client/dhc6.c.PPP 2012-04-16 17:37:23.243618764 +0200
++++ dhcp-4.2.4b1/client/dhc6.c 2012-04-16 17:37:23.252618638 +0200
+@@ -133,7 +133,7 @@ extern int stateless;
* is not how it is intended. Upcoming rearchitecting the client should
* address this "one daemon model."
*/
form_duid(struct data_string *duid, const char *file, int line)
{
struct interface_info *ip;
-@@ -141,6 +141,15 @@ form_duid(struct data_string *duid, cons
+@@ -145,6 +145,15 @@ form_duid(struct data_string *duid, cons
if (ip == NULL)
log_fatal("Impossible condition at %s:%d.", MDL);
if ((ip->hw_address.hlen == 0) ||
(ip->hw_address.hlen > sizeof(ip->hw_address.hbuf)))
log_fatal("Impossible hardware address length at %s:%d.", MDL);
-@@ -176,6 +185,8 @@ form_duid(struct data_string *duid, cons
+@@ -180,6 +189,8 @@ form_duid(struct data_string *duid, cons
memcpy(duid->buffer->data + 4, ip->hw_address.hbuf + 1,
ip->hw_address.hlen - 1);
}
}
/*
-@@ -5289,7 +5300,8 @@ make_client6_options(struct client_state
+@@ -5130,7 +5141,8 @@ make_client6_options(struct client_state
*/
if ((oc = lookup_option(&dhcpv6_universe, *op,
D6O_CLIENTID)) == NULL) {
MDL))
log_fatal("Failure assembling a DUID.");
-diff -up dhcp-4.2.0-P1/client/dhclient.c.PPP dhcp-4.2.0-P1/client/dhclient.c
---- dhcp-4.2.0-P1/client/dhclient.c.PPP 2010-11-05 10:47:37.000000000 +0100
-+++ dhcp-4.2.0-P1/client/dhclient.c 2010-11-09 15:37:26.000000000 +0100
-@@ -911,8 +911,8 @@ main(int argc, char **argv) {
+diff -up dhcp-4.2.4b1/client/dhclient.c.PPP dhcp-4.2.4b1/client/dhclient.c
+--- dhcp-4.2.4b1/client/dhclient.c.PPP 2012-04-16 17:37:23.214619170 +0200
++++ dhcp-4.2.4b1/client/dhclient.c 2012-04-16 17:37:23.254618610 +0200
+@@ -919,8 +919,8 @@ main(int argc, char **argv) {
if (default_duid.buffer != NULL)
data_string_forget(&default_duid, MDL);
}
for (ip = interfaces ; ip != NULL ; ip = ip->next) {
-diff -up dhcp-4.2.0-P1/common/bpf.c.PPP dhcp-4.2.0-P1/common/bpf.c
---- dhcp-4.2.0-P1/common/bpf.c.PPP 2010-11-05 10:47:37.000000000 +0100
-+++ dhcp-4.2.0-P1/common/bpf.c 2010-11-09 15:42:42.000000000 +0100
+diff -up dhcp-4.2.4b1/common/bpf.c.PPP dhcp-4.2.4b1/common/bpf.c
+--- dhcp-4.2.4b1/common/bpf.c.PPP 2012-04-16 17:37:23.175619716 +0200
++++ dhcp-4.2.4b1/common/bpf.c 2012-04-16 17:37:23.255618596 +0200
@@ -599,6 +599,22 @@ get_hw_addr(const char *name, struct har
memcpy(&hw->hbuf[1], LLADDR(sa), sa->sdl_alen);
break;
default:
log_fatal("Unsupported device type %d for \"%s\"",
sa->sdl_type, name);
-diff -up dhcp-4.2.0-P1/common/lpf.c.PPP dhcp-4.2.0-P1/common/lpf.c
---- dhcp-4.2.0-P1/common/lpf.c.PPP 2010-11-05 10:47:37.000000000 +0100
-+++ dhcp-4.2.0-P1/common/lpf.c 2010-11-09 15:45:40.000000000 +0100
-@@ -502,6 +502,22 @@ get_hw_addr(const char *name, struct har
+diff -up dhcp-4.2.4b1/common/lpf.c.PPP dhcp-4.2.4b1/common/lpf.c
+--- dhcp-4.2.4b1/common/lpf.c.PPP 2012-04-16 17:37:23.155619996 +0200
++++ dhcp-4.2.4b1/common/lpf.c 2012-04-16 17:37:23.256618582 +0200
+@@ -503,6 +503,22 @@ get_hw_addr(const char *name, struct har
hw->hbuf[0] = HTYPE_FDDI;
memcpy(&hw->hbuf[1], sa->sa_data, 16);
break;
default:
log_fatal("Unsupported device type %ld for \"%s\"",
(long int)sa->sa_family, name);
-diff -up dhcp-4.2.0-P1/includes/dhcpd.h.PPP dhcp-4.2.0-P1/includes/dhcpd.h
---- dhcp-4.2.0-P1/includes/dhcpd.h.PPP 2010-11-05 10:47:37.000000000 +0100
-+++ dhcp-4.2.0-P1/includes/dhcpd.h 2010-11-09 15:46:58.000000000 +0100
-@@ -2733,7 +2733,7 @@ void dhcpv4_client_assignments(void);
+diff -up dhcp-4.2.4b1/includes/dhcpd.h.PPP dhcp-4.2.4b1/includes/dhcpd.h
+--- dhcp-4.2.4b1/includes/dhcpd.h.PPP 2012-04-16 17:37:23.239618820 +0200
++++ dhcp-4.2.4b1/includes/dhcpd.h 2012-04-16 17:37:23.257618568 +0200
+@@ -2760,7 +2760,7 @@ void dhcpv4_client_assignments(void);
void dhcpv6_client_assignments(void);
/* dhc6.c */
void dhc6_lease_destroy(struct dhc6_lease **src, const char *file, int line);
void start_init6(struct client_state *client);
void start_info_request6(struct client_state *client);
-diff -up dhcp-4.2.0-P1/includes/dhcp.h.PPP dhcp-4.2.0-P1/includes/dhcp.h
---- dhcp-4.2.0-P1/includes/dhcp.h.PPP 2010-11-05 10:47:37.000000000 +0100
-+++ dhcp-4.2.0-P1/includes/dhcp.h 2010-11-09 15:48:53.000000000 +0100
-@@ -80,6 +80,8 @@ struct dhcp_packet {
- #define HTYPE_IEEE802 6 /* IEEE 802.2 Token Ring... */
- #define HTYPE_FDDI 8 /* FDDI... */
+diff -up dhcp-4.2.4b1/includes/dhcp.h.PPP dhcp-4.2.4b1/includes/dhcp.h
+--- dhcp-4.2.4b1/includes/dhcp.h.PPP 2012-04-16 17:37:23.000000000 +0200
++++ dhcp-4.2.4b1/includes/dhcp.h 2012-04-16 17:38:34.675618138 +0200
+@@ -85,6 +85,8 @@ struct dhcp_packet {
+ * is no standard for this so we
+ * just steal a type */
-+#define HTYPE_RESERVED 0 /* RFC 5494 */
++#define HTYPE_RESERVED 0 /* RFC 5494 */
+
/* Magic cookie validating dhcp options field (and bootp vendor
extensions field). */
#define DHCP_OPTIONS_COOKIE "\143\202\123\143"
-diff -up dhcp-4.2.0-P1/server/dhcpv6.c.PPP dhcp-4.2.0-P1/server/dhcpv6.c
---- dhcp-4.2.0-P1/server/dhcpv6.c.PPP 2010-11-05 10:47:37.000000000 +0100
-+++ dhcp-4.2.0-P1/server/dhcpv6.c 2010-11-09 15:50:17.000000000 +0100
+diff -up dhcp-4.2.4b1/server/dhcpv6.c.PPP dhcp-4.2.4b1/server/dhcpv6.c
+--- dhcp-4.2.4b1/server/dhcpv6.c.PPP 2012-04-16 17:37:23.218619114 +0200
++++ dhcp-4.2.4b1/server/dhcpv6.c 2012-04-16 17:37:23.260618526 +0200
@@ -300,6 +300,9 @@ generate_new_server_duid(void) {
if (p->hw_address.hlen > 0) {
break;
-diff -up dhcp-4.2.0/server/dhcpv6.c.UseMulticast dhcp-4.2.0/server/dhcpv6.c
---- dhcp-4.2.0/server/dhcpv6.c.UseMulticast 2010-06-01 19:30:00.000000000 +0200
-+++ dhcp-4.2.0/server/dhcpv6.c 2010-07-21 16:17:30.000000000 +0200
+diff -up dhcp-4.2.4b1/server/dhcpv6.c.UseMulticast dhcp-4.2.4b1/server/dhcpv6.c
+--- dhcp-4.2.4b1/server/dhcpv6.c.UseMulticast 2012-04-11 00:14:04.000000000 +0200
++++ dhcp-4.2.4b1/server/dhcpv6.c 2012-04-16 19:21:43.575923732 +0200
@@ -346,6 +346,48 @@ generate_new_server_duid(void) {
}
* Get the client identifier from the packet.
*/
isc_result_t
-@@ -1405,6 +1447,56 @@ lease_to_client(struct data_string *repl
+@@ -1404,6 +1446,56 @@ lease_to_client(struct data_string *repl
reply.shared->group);
}
+ reply.opt_state, reply.packet,
+ required_opts_NAA,
+ NULL);
-+ } else if (no_resources_avail && (reply.ia_count != 0) &&
-+ (reply.packet->dhcpv6_msg_type == DHCPV6_SOLICIT))
++ }
++
/*
* RFC3315 section 17.2.2 (Solicit):
*
-@@ -1429,8 +1521,6 @@ lease_to_client(struct data_string *repl
- * the server.
+@@ -1429,8 +1521,8 @@ lease_to_client(struct data_string *repl
* Sends a Renew/Rebind if the IA is not in the Reply message.
*/
+ #if defined (RFC3315_PRE_ERRATA_2010_08)
- if (no_resources_avail && (reply.ia_count != 0) &&
- (reply.packet->dhcpv6_msg_type == DHCPV6_SOLICIT))
++ else if (no_resources_avail && (reply.ia_count != 0) &&
++ (reply.packet->dhcpv6_msg_type == DHCPV6_SOLICIT))
{
/* Set the NoAddrsAvail status code. */
if (!set_status_code(STATUS_NoAddrsAvail,
-@@ -4128,7 +4218,6 @@ dhcpv6_solicit(struct data_string *reply
+@@ -1477,6 +1569,7 @@ lease_to_client(struct data_string *repl
+ * Having stored the client's IA's, store any options that
+ * will fit in the remaining space.
+ */
++ else
+ reply.cursor += store_options6((char *)reply.buf.data + reply.cursor,
+ sizeof(reply.buf) - reply.cursor,
+ reply.opt_state, reply.packet,
+@@ -4126,7 +4219,6 @@ dhcpv6_solicit(struct data_string *reply
* Very similar to Solicit handling, except the server DUID is required.
*/
static void
dhcpv6_request(struct data_string *reply_ret, struct packet *packet) {
struct data_string client_id;
-@@ -4443,7 +4532,6 @@ exit:
+@@ -4456,7 +4548,6 @@ exit:
* except for the error code of when addresses don't match.
*/
static void
dhcpv6_renew(struct data_string *reply, struct packet *packet) {
struct data_string client_id;
-@@ -4688,18 +4776,60 @@ iterate_over_ia_na(struct data_string *r
+@@ -4700,18 +4791,60 @@ iterate_over_ia_na(struct data_string *r
goto exit;
}
/*
* Loop through the IA_NA reported by the client, and deal with
-@@ -4838,6 +4968,7 @@ iterate_over_ia_na(struct data_string *r
+@@ -4849,6 +4982,7 @@ iterate_over_ia_na(struct data_string *r
/*
* Return our reply to the caller.
*/
reply_ret->len = reply_ofs;
reply_ret->buffer = NULL;
if (!buffer_allocate(&reply_ret->buffer, reply_ofs, MDL)) {
-@@ -4883,7 +5014,6 @@ exit:
+@@ -4894,7 +5028,6 @@ exit:
* we still need to be aware of this possibility.
*/
/* TODO: IA_TA */
static void
dhcpv6_decline(struct data_string *reply, struct packet *packet) {
-@@ -5355,7 +5485,6 @@ exit:
+@@ -5364,7 +5497,6 @@ exit:
* Release means a client is done with the leases.
*/
--- /dev/null
+diff -up dhcp-4.2.4/server/ldap.c.failOverPeer dhcp-4.2.4/server/ldap.c
+--- dhcp-4.2.4/server/ldap.c.failOverPeer 2012-07-23 12:53:26.815262322 +0200
++++ dhcp-4.2.4/server/ldap.c 2012-07-23 12:54:31.002119299 +0200
+@@ -893,7 +893,7 @@ ldap_start (void)
+ static void
+ parse_external_dns (LDAPMessage * ent)
+ {
+- char *search[] = {"dhcpOptionsDN", "dhcpSharedNetworkDN", "dhcpSubnetDN",
++ char *search[] = {"dhcpFailOverPeerDN", "dhcpOptionsDN", "dhcpSharedNetworkDN", "dhcpSubnetDN",
+ "dhcpGroupDN", "dhcpHostDN", "dhcpClassesDN",
+ "dhcpPoolDN", NULL};
+ LDAPMessage * newres, * newent;
--- /dev/null
+diff -up dhcp-4.2.4rc2/common/discover.c.getifaddrs dhcp-4.2.4rc2/common/discover.c
+--- dhcp-4.2.4rc2/common/discover.c.getifaddrs 2012-05-25 18:05:29.592024035 +0200
++++ dhcp-4.2.4rc2/common/discover.c 2012-05-25 18:12:05.254266023 +0200
+@@ -379,394 +379,13 @@ end_iface_scan(struct iface_conf_list *i
+ ifaces->sock = -1;
+ }
+
+-#elif __linux /* !HAVE_SIOCGLIFCONF */
+-/*
+- * Linux support
+- * -------------
+- *
+- * In Linux, we use the /proc pseudo-filesystem to get information
+- * about interfaces, along with selected ioctl() calls.
+- *
+- * Linux low level access is documented in the netdevice man page.
+- */
+-
+-/*
+- * Structure holding state about the scan.
+- */
+-struct iface_conf_list {
+- int sock; /* file descriptor used to get information */
+- FILE *fp; /* input from /proc/net/dev */
+-#ifdef DHCPv6
+- FILE *fp6; /* input from /proc/net/if_inet6 */
+-#endif
+-};
+-
+-/*
+- * Structure used to return information about a specific interface.
+- */
+-struct iface_info {
+- char name[IFNAMSIZ]; /* name of the interface, e.g. "eth0" */
+- struct sockaddr_storage addr; /* address information */
+- isc_uint64_t flags; /* interface flags, e.g. IFF_LOOPBACK */
+-};
+-
+-/*
+- * Start a scan of interfaces.
+- *
+- * The iface_conf_list structure maintains state for this process.
+- */
+-int
+-begin_iface_scan(struct iface_conf_list *ifaces) {
+- char buf[256];
+- int len;
+- int i;
+-
+- ifaces->fp = fopen("/proc/net/dev", "re");
+- if (ifaces->fp == NULL) {
+- log_error("Error opening '/proc/net/dev' to list interfaces");
+- return 0;
+- }
+-
+- /*
+- * The first 2 lines are header information, so read and ignore them.
+- */
+- for (i=0; i<2; i++) {
+- if (fgets(buf, sizeof(buf), ifaces->fp) == NULL) {
+- log_error("Error reading headers from '/proc/net/dev'");
+- fclose(ifaces->fp);
+- ifaces->fp = NULL;
+- return 0;
+- }
+- len = strlen(buf);
+- if ((len <= 0) || (buf[len-1] != '\n')) {
+- log_error("Bad header line in '/proc/net/dev'");
+- fclose(ifaces->fp);
+- ifaces->fp = NULL;
+- return 0;
+- }
+- }
+-
+- ifaces->sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
+- if (ifaces->sock < 0) {
+- log_error("Error creating socket to list interfaces; %m");
+- fclose(ifaces->fp);
+- ifaces->fp = NULL;
+- return 0;
+- }
+-
+-#ifdef DHCPv6
+- if ((local_family == AF_INET6) && !access("/proc/net/if_inet6", R_OK)) {
+- ifaces->fp6 = fopen("/proc/net/if_inet6", "re");
+- if (ifaces->fp6 == NULL) {
+- log_error("Error opening '/proc/net/if_inet6' to "
+- "list IPv6 interfaces; %m");
+- close(ifaces->sock);
+- ifaces->sock = -1;
+- fclose(ifaces->fp);
+- ifaces->fp = NULL;
+- return 0;
+- }
+- } else {
+- ifaces->fp6 = NULL;
+- }
+-#endif
+-
+- return 1;
+-}
+-
+-/*
+- * Read our IPv4 interfaces from /proc/net/dev.
+- *
+- * The file looks something like this:
+- *
+- * Inter-| Receive ...
+- * face |bytes packets errs drop fifo frame ...
+- * lo: 1580562 4207 0 0 0 0 ...
+- * eth0: 0 0 0 0 0 0 ...
+- * eth1:1801552440 37895 0 14 0 ...
+- *
+- * We only care about the interface name, which is at the start of
+- * each line.
+- *
+- * We use an ioctl() to get the address and flags for each interface.
+- */
+-static int
+-next_iface4(struct iface_info *info, int *err, struct iface_conf_list *ifaces) {
+- char buf[256];
+- int len;
+- char *p;
+- char *name;
+- struct ifreq tmp;
+-
+- /*
+- * Loop exits when we find an interface that has an address, or
+- * when we run out of interfaces.
+- */
+- for (;;) {
+- do {
+- /*
+- * Read the next line in the file.
+- */
+- if (fgets(buf, sizeof(buf), ifaces->fp) == NULL) {
+- if (ferror(ifaces->fp)) {
+- *err = 1;
+- log_error("Error reading interface "
+- "information");
+- } else {
+- *err = 0;
+- }
+- return 0;
+- }
+-
+- /*
+- * Make sure the line is a nice,
+- * newline-terminated line.
+- */
+- len = strlen(buf);
+- if ((len <= 0) || (buf[len-1] != '\n')) {
+- log_error("Bad line reading interface "
+- "information");
+- *err = 1;
+- return 0;
+- }
+-
+- /*
+- * Figure out our name.
+- */
+- p = strrchr(buf, ':');
+- if (p == NULL) {
+- log_error("Bad line reading interface "
+- "information (no colon)");
+- *err = 1;
+- return 0;
+- }
+- *p = '\0';
+- name = buf;
+- while (isspace(*name)) {
+- name++;
+- }
+-
+- /*
+- * Copy our name into our interface structure.
+- */
+- len = p - name;
+- if (len >= sizeof(info->name)) {
+- *err = 1;
+- log_error("Interface name '%s' too long", name);
+- return 0;
+- }
+- strcpy(info->name, name);
+-
+-#ifdef ALIAS_NAMED_PERMUTED
+- /* interface aliases look like "eth0:1" or "wlan1:3" */
+- s = strchr(info->name, ':');
+- if (s != NULL) {
+- *s = '\0';
+- }
+-#endif
+-
+-#ifdef SKIP_DUMMY_INTERFACES
+- } while (strncmp(info->name, "dummy", 5) == 0);
+-#else
+- } while (0);
+-#endif
+-
+- memset(&tmp, 0, sizeof(tmp));
+- strcpy(tmp.ifr_name, name);
+- if (ioctl(ifaces->sock, SIOCGIFADDR, &tmp) < 0) {
+- if (errno == EADDRNOTAVAIL) {
+- continue;
+- }
+- log_error("Error getting interface address "
+- "for '%s'; %m", name);
+- *err = 1;
+- return 0;
+- }
+- memcpy(&info->addr, &tmp.ifr_addr, sizeof(tmp.ifr_addr));
+-
+- memset(&tmp, 0, sizeof(tmp));
+- strcpy(tmp.ifr_name, name);
+- if (ioctl(ifaces->sock, SIOCGIFFLAGS, &tmp) < 0) {
+- log_error("Error getting interface flags for '%s'; %m",
+- name);
+- *err = 1;
+- return 0;
+- }
+- info->flags = tmp.ifr_flags;
+-
+- *err = 0;
+- return 1;
+- }
+-}
+-
+-#ifdef DHCPv6
+-/*
+- * Read our IPv6 interfaces from /proc/net/if_inet6.
+- *
+- * The file looks something like this:
+- *
+- * fe80000000000000025056fffec00008 05 40 20 80 vmnet8
+- * 00000000000000000000000000000001 01 80 10 80 lo
+- * fe80000000000000025056fffec00001 06 40 20 80 vmnet1
+- * 200108881936000202166ffffe497d9b 03 40 00 00 eth1
+- * fe8000000000000002166ffffe497d9b 03 40 20 80 eth1
+- *
+- * We get IPv6 address from the start, the interface name from the end,
+- * and ioctl() to get flags.
+- */
+-static int
+-next_iface6(struct iface_info *info, int *err, struct iface_conf_list *ifaces) {
+- char buf[256];
+- int len;
+- char *p;
+- char *name;
+- int i;
+- struct sockaddr_in6 addr;
+- struct ifreq tmp;
+-
+- do {
+- /*
+- * Read the next line in the file.
+- */
+- if (fgets(buf, sizeof(buf), ifaces->fp6) == NULL) {
+- if (ferror(ifaces->fp6)) {
+- *err = 1;
+- log_error("Error reading IPv6 "
+- "interface information");
+- } else {
+- *err = 0;
+- }
+- return 0;
+- }
+-
+- /*
+- * Make sure the line is a nice, newline-terminated line.
+- */
+- len = strlen(buf);
+- if ((len <= 0) || (buf[len-1] != '\n')) {
+- log_error("Bad line reading IPv6 "
+- "interface information");
+- *err = 1;
+- return 0;
+- }
+-
+- /*
+- * Figure out our name.
+- */
+- buf[--len] = '\0';
+- p = strrchr(buf, ' ');
+- if (p == NULL) {
+- log_error("Bad line reading IPv6 interface "
+- "information (no space)");
+- *err = 1;
+- return 0;
+- }
+- name = p+1;
+-
+- /*
+- * Copy our name into our interface structure.
+- */
+- len = strlen(name);
+- if (len >= sizeof(info->name)) {
+- *err = 1;
+- log_error("IPv6 interface name '%s' too long", name);
+- return 0;
+- }
+- strcpy(info->name, name);
+-
+-#ifdef SKIP_DUMMY_INTERFACES
+- } while (strncmp(info->name, "dummy", 5) == 0);
+-#else
+- } while (0);
+-#endif
+-
+- /*
+- * Double-check we start with the IPv6 address.
+- */
+- for (i=0; i<32; i++) {
+- if (!isxdigit(buf[i]) || isupper(buf[i])) {
+- *err = 1;
+- log_error("Bad line reading IPv6 interface address "
+- "for '%s'", name);
+- return 0;
+- }
+- }
+-
+- /*
+- * Load our socket structure.
+- */
+- memset(&addr, 0, sizeof(addr));
+- addr.sin6_family = AF_INET6;
+- for (i=0; i<16; i++) {
+- unsigned char byte;
+- static const char hex[] = "0123456789abcdef";
+- byte = ((index(hex, buf[i * 2]) - hex) << 4) |
+- (index(hex, buf[i * 2 + 1]) - hex);
+- addr.sin6_addr.s6_addr[i] = byte;
+- }
+- memcpy(&info->addr, &addr, sizeof(addr));
+-
+- /*
+- * Get our flags.
+- */
+- memset(&tmp, 0, sizeof(tmp));
+- strcpy(tmp.ifr_name, name);
+- if (ioctl(ifaces->sock, SIOCGIFFLAGS, &tmp) < 0) {
+- log_error("Error getting interface flags for '%s'; %m", name);
+- *err = 1;
+- return 0;
+- }
+- info->flags = tmp.ifr_flags;
+-
+- *err = 0;
+- return 1;
+-}
+-#endif /* DHCPv6 */
+-
+-/*
+- * Retrieve the next interface.
+- *
+- * Returns information in the info structure.
+- * Sets err to 1 if there is an error, otherwise 0.
+- */
+-int
+-next_iface(struct iface_info *info, int *err, struct iface_conf_list *ifaces) {
+- if (next_iface4(info, err, ifaces)) {
+- return 1;
+- }
+-#ifdef DHCPv6
+- if (!(*err) && ifaces->fp6) {
+- if (local_family == AF_INET6)
+- return next_iface6(info, err, ifaces);
+- }
+-#endif
+- return 0;
+-}
+-
+-/*
+- * End scan of interfaces.
+- */
+-void
+-end_iface_scan(struct iface_conf_list *ifaces) {
+- fclose(ifaces->fp);
+- ifaces->fp = NULL;
+- close(ifaces->sock);
+- ifaces->sock = -1;
+-#ifdef DHCPv6
+- if (local_family == AF_INET6) {
+- if (ifaces->fp6)
+- fclose(ifaces->fp6);
+- ifaces->fp6 = NULL;
+- }
+-#endif
+-}
+ #else
+
+ /*
+ * BSD support
+ * -----------
+ *
+- * FreeBSD, NetBSD, OpenBSD, and OS X all have the getifaddrs()
++ * FreeBSD, NetBSD, OpenBSD, OS X and Linux all have the getifaddrs()
+ * function.
+ *
+ * The getifaddrs() man page describes the use.
+@@ -814,6 +433,8 @@ begin_iface_scan(struct iface_conf_list
+ */
+ int
+ next_iface(struct iface_info *info, int *err, struct iface_conf_list *ifaces) {
++ size_t sa_len = 0;
++
+ if (ifaces->next == NULL) {
+ *err = 0;
+ return 0;
+@@ -825,8 +446,20 @@ next_iface(struct iface_info *info, int
+ return 0;
+ }
+ strcpy(info->name, ifaces->next->ifa_name);
+- memcpy(&info->addr, ifaces->next->ifa_addr,
+- ifaces->next->ifa_addr->sa_len);
++
++ memset(&info->addr, 0 , sizeof(info->addr));
++
++ if (ifaces->next->ifa_addr != NULL) {
++#ifdef HAVE_SA_LEN
++ sa_len = ifaces->next->ifa_addr->sa_len;
++#else
++ if (ifaces->next->ifa_addr->sa_family == AF_INET)
++ sa_len = sizeof(struct sockaddr_in);
++ else if (ifaces->next->ifa_addr->sa_family == AF_INET6)
++ sa_len = sizeof(struct sockaddr_in6);
++#endif
++ memcpy(&info->addr, ifaces->next->ifa_addr, sa_len);
++ }
+ info->flags = ifaces->next->ifa_flags;
+ ifaces->next = ifaces->next->ifa_next;
+ *err = 0;
-diff -up dhcp-4.2.2/client/dhclient.c.improved-xid dhcp-4.2.2/client/dhclient.c
---- dhcp-4.2.2/client/dhclient.c.improved-xid 2011-09-16 18:18:00.649730661 +0200
-+++ dhcp-4.2.2/client/dhclient.c 2011-09-16 18:22:36.815035513 +0200
-@@ -898,6 +898,26 @@ main(int argc, char **argv) {
+diff -up dhcp-4.2.4b1/client/dhclient.c.improved-xid dhcp-4.2.4b1/client/dhclient.c
+--- dhcp-4.2.4b1/client/dhclient.c.improved-xid 2012-04-16 17:42:37.444217424 +0200
++++ dhcp-4.2.4b1/client/dhclient.c 2012-04-16 17:45:32.105770755 +0200
+@@ -888,6 +888,26 @@ main(int argc, char **argv) {
}
}
/* At this point, all the interfaces that the script thinks
are relevant should be running, so now we once again call
discover_interfaces(), and this time ask it to actually set
-@@ -912,14 +932,36 @@ main(int argc, char **argv) {
+@@ -902,14 +922,36 @@ main(int argc, char **argv) {
Not much entropy, but we're booting, so we're not likely to
find anything better. */
seed = 0;
/* Setup specific Infiniband options */
for (ip = interfaces; ip; ip = ip->next) {
-@@ -1457,7 +1499,7 @@ void dhcpack (packet)
+@@ -1447,7 +1489,7 @@ void dhcpack (packet)
return;
}
lease = packet_to_lease (packet, client);
if (!lease) {
-@@ -2174,7 +2216,7 @@ void dhcpnak (packet)
+@@ -2164,7 +2206,7 @@ void dhcpnak (packet)
return;
}
if (!client -> active) {
#if defined (DEBUG)
-@@ -2300,10 +2342,10 @@ void send_discover (cpp)
+@@ -2290,10 +2332,10 @@ void send_discover (cpp)
client -> packet.secs = htons (65535);
client -> secs = client -> packet.secs;
+ ntohs (sockaddr_broadcast.sin_port), (long)(client -> interval), client -> xid);
/* Send out a packet. */
- result = send_packet (client -> interface, (struct packet *)0,
-@@ -2584,10 +2626,10 @@ void send_request (cpp)
+ result = send_packet(client->interface, NULL, &client->packet,
+@@ -2577,10 +2619,10 @@ void send_request (cpp)
client -> packet.secs = htons (65535);
}
+ ntohs (destination.sin_port), client -> xid);
if (destination.sin_addr.s_addr != INADDR_BROADCAST &&
- fallback_interface)
-@@ -2618,10 +2660,10 @@ void send_decline (cpp)
+ fallback_interface) {
+@@ -2620,10 +2662,10 @@ void send_decline (cpp)
int result;
- log_info ("DHCPDECLINE on %s to %s port %d",
+ log_info ("DHCPDECLINE on %s to %s port %d (xid=0x%x)",
- client -> name ? client -> name : client -> interface -> name,
- inet_ntoa (sockaddr_broadcast.sin_addr),
-- ntohs (sockaddr_broadcast.sin_port));
-+ ntohs (sockaddr_broadcast.sin_port), client -> xid);
+ client->name ? client->name : client->interface->name,
+ inet_ntoa(sockaddr_broadcast.sin_addr),
+- ntohs(sockaddr_broadcast.sin_port));
++ ntohs(sockaddr_broadcast.sin_port), client -> xid);
/* Send out a packet. */
- result = send_packet (client -> interface, (struct packet *)0,
-@@ -2661,10 +2703,10 @@ void send_release (cpp)
+ result = send_packet(client->interface, NULL, &client->packet,
+@@ -2666,10 +2708,10 @@ void send_release (cpp)
return;
}
- ntohs (destination.sin_port));
+ ntohs (destination.sin_port), client -> xid);
- if (fallback_interface)
- result = send_packet (fallback_interface,
+ if (fallback_interface) {
+ result = send_packet(fallback_interface, NULL, &client->packet,
-diff -up dhcp-4.2.2/client/dhclient.c.lpf-ib dhcp-4.2.2/client/dhclient.c
---- dhcp-4.2.2/client/dhclient.c.lpf-ib 2011-09-19 11:24:08.693775799 +0200
-+++ dhcp-4.2.2/client/dhclient.c 2011-09-19 11:24:08.703775541 +0200
-@@ -113,6 +113,8 @@ static int check_domain_name_list(const
+diff -up dhcp-4.2.4/client/dhclient.c.lpf-ib dhcp-4.2.4/client/dhclient.c
+--- dhcp-4.2.4/client/dhclient.c.lpf-ib 2012-07-18 21:08:48.100835005 +0200
++++ dhcp-4.2.4/client/dhclient.c 2012-07-18 21:08:48.111834856 +0200
+@@ -113,6 +113,8 @@ static int check_domain_name_list(const
static int check_option_values(struct universe *universe, unsigned int opt,
const char *ptr, size_t len);
int
main(int argc, char **argv) {
int fd;
-@@ -919,6 +921,14 @@ main(int argc, char **argv) {
+@@ -909,6 +911,14 @@ main(int argc, char **argv) {
}
srandom(seed + cur_time + (unsigned)getpid());
/* Start a configuration state machine for each interface. */
#ifdef DHCPv6
if (local_family == AF_INET6) {
-@@ -1195,6 +1205,29 @@ int find_subnet (struct subnet **sp,
+@@ -1185,6 +1195,29 @@ int find_subnet (struct subnet **sp,
return 0;
}
/* Individual States:
*
* Each routine is called from the dhclient_state_machine() in one of
-diff -up dhcp-4.2.2/common/bpf.c.lpf-ib dhcp-4.2.2/common/bpf.c
---- dhcp-4.2.2/common/bpf.c.lpf-ib 2011-09-19 11:24:08.694775773 +0200
-+++ dhcp-4.2.2/common/bpf.c 2011-09-19 11:24:08.704775516 +0200
+diff -up dhcp-4.2.4/common/bpf.c.lpf-ib dhcp-4.2.4/common/bpf.c
+--- dhcp-4.2.4/common/bpf.c.lpf-ib 2012-07-18 21:08:48.101834991 +0200
++++ dhcp-4.2.4/common/bpf.c 2012-07-18 21:08:48.111834856 +0200
@@ -198,11 +198,44 @@ struct bpf_insn dhcp_bpf_filter [] = {
BPF_STMT(BPF_RET+BPF_K, 0),
};
#if defined (HAVE_TR_SUPPORT)
struct bpf_insn dhcp_bpf_tr_filter [] = {
/* accept all token ring packets due to variable length header */
-diff -up dhcp-4.2.2/common/lpf.c.lpf-ib dhcp-4.2.2/common/lpf.c
---- dhcp-4.2.2/common/lpf.c.lpf-ib 2011-09-19 11:24:08.694775773 +0200
-+++ dhcp-4.2.2/common/lpf.c 2011-09-19 11:26:15.107109935 +0200
+diff -up dhcp-4.2.4/common/lpf.c.lpf-ib dhcp-4.2.4/common/lpf.c
+--- dhcp-4.2.4/common/lpf.c.lpf-ib 2012-07-18 21:08:48.101834991 +0200
++++ dhcp-4.2.4/common/lpf.c 2012-07-18 21:10:47.367210799 +0200
@@ -42,6 +42,7 @@
#include "includes/netinet/udp.h"
#include "includes/netinet/if_ether.h"
ssize_t send_packet (interface, packet, raw, len, from, to, hto)
struct interface_info *interface;
struct packet *packet;
-@@ -335,6 +420,11 @@ ssize_t send_packet (interface, packet,
+@@ -335,6 +420,11 @@ ssize_t send_packet (interface, packet,
return send_fallback (interface, packet, raw,
len, from, to, hto);
if (hto == NULL && interface->anycast_mac_addr.hlen)
hto = &interface->anycast_mac_addr;
-@@ -356,6 +446,42 @@ ssize_t send_packet (interface, packet,
+@@ -356,6 +446,42 @@ ssize_t send_packet (interface, packet,
#endif /* USE_LPF_SEND */
#ifdef USE_LPF_RECEIVE
ssize_t receive_packet (interface, buf, len, from, hfrom)
struct interface_info *interface;
unsigned char *buf;
-@@ -382,6 +508,10 @@ ssize_t receive_packet (interface, buf,
+@@ -382,6 +508,10 @@ ssize_t receive_packet (interface, buf,
};
struct cmsghdr *cmsg;
length = recvmsg (interface -> rfdesc, &msg, 0);
if (length <= 0)
return length;
-@@ -462,33 +592,44 @@ void maybe_setup_fallback ()
+@@ -461,11 +591,32 @@ void maybe_setup_fallback ()
+ }
}
- void
+-void
-get_hw_addr(const char *name, struct hardware *hw) {
-- int sock;
-- struct ifreq tmp;
-- struct sockaddr *sa;
-+get_hw_addr(struct interface_info *info)
++struct sockaddr_ll *
++get_ll (struct ifaddrs *ifaddrs, struct ifaddrs **ifa, char *name)
+{
-+ struct hardware *hw = &info->hw_address;
-+ char *name = info->name;
-+ struct ifaddrs *ifaddrs;
-+ struct ifaddrs *ifa;
-+ struct sockaddr_ll *sll = NULL;
-
-- if (strlen(name) >= sizeof(tmp.ifr_name)) {
-- log_fatal("Device name too long: \"%s\"", name);
-- }
-+ if (getifaddrs(&ifaddrs) == -1)
-+ log_fatal("Failed to get interfaces");
-
-- sock = socket(AF_INET, SOCK_DGRAM, 0);
-- if (sock < 0) {
-- log_fatal("Can't create socket for \"%s\": %m", name);
-+ for (ifa = ifaddrs; ifa != NULL; ifa = ifa->ifa_next) {
-+
-+ if (ifa->ifa_addr == NULL)
++ for (*ifa = ifaddrs; *ifa != NULL; *ifa = (*ifa)->ifa_next) {
++ if ((*ifa)->ifa_addr == NULL)
+ continue;
+
-+ if (ifa->ifa_addr->sa_family != AF_PACKET)
++ if ((*ifa)->ifa_addr->sa_family != AF_PACKET)
+ continue;
+
-+ if (ifa->ifa_flags & IFF_LOOPBACK)
++ if ((*ifa)->ifa_flags & IFF_LOOPBACK)
+ continue;
+
-+ if (strcmp(ifa->ifa_name, name) == 0) {
-+ sll = (struct sockaddr_ll *)(void *)ifa->ifa_addr;
-+ break;
-+ }
- }
++ if (strcmp((*ifa)->ifa_name, name) == 0)
++ return (struct sockaddr_ll *)(void *)(*ifa)->ifa_addr;
++ }
++ return NULL;
++}
++
++struct sockaddr_ll *
++ioctl_get_ll(char *name)
++{
+ int sock;
+ struct ifreq tmp;
+- struct sockaddr *sa;
++ struct sockaddr *sa = NULL;
++ struct sockaddr_ll *sll = NULL;
-- memset(&tmp, 0, sizeof(tmp));
-- strcpy(tmp.ifr_name, name);
-- if (ioctl(sock, SIOCGIFHWADDR, &tmp) < 0) {
+ if (strlen(name) >= sizeof(tmp.ifr_name)) {
+ log_fatal("Device name too long: \"%s\"", name);
+@@ -479,16 +630,44 @@ get_hw_addr(const char *name, struct har
+ memset(&tmp, 0, sizeof(tmp));
+ strcpy(tmp.ifr_name, name);
+ if (ioctl(sock, SIOCGIFHWADDR, &tmp) < 0) {
- log_fatal("Error getting hardware address for \"%s\": %m",
-- name);
-+ if (sll == NULL) {
-+ freeifaddrs(ifaddrs);
-+ log_fatal("Failed to get HW address for %s\n", name);
++ log_fatal("Error getting hardware address for \"%s\": %m",
+ name);
}
-- sa = &tmp.ifr_hwaddr;
+ sa = &tmp.ifr_hwaddr;
- switch (sa->sa_family) {
++ sll = dmalloc (sizeof (struct sockaddr_ll), MDL);
++ if (!sll)
++ log_fatal("Unable to allocate memory for link layer address");
++ memcpy(&sll->sll_hatype, &sa->sa_family, sizeof (sll->sll_hatype));
++ memcpy(sll->sll_addr, sa->sa_data, sizeof (sll->sll_addr));
++ return sll;
++}
++
++void
++get_hw_addr(struct interface_info *info)
++{
++ struct hardware *hw = &info->hw_address;
++ char *name = info->name;
++ struct ifaddrs *ifaddrs = NULL;
++ struct ifaddrs *ifa = NULL;
++ struct sockaddr_ll *sll = NULL;
++
++ if (getifaddrs(&ifaddrs) == -1)
++ log_fatal("Failed to get interfaces");
++
++ if ((sll = get_ll(ifaddrs, &ifa, name)) == NULL) {
++ /*
++ * We were unable to get link-layer address for name.
++ * Fall back to ioctl(SIOCGIFHWADDR).
++ */
++ sll = ioctl_get_ll(name);
++ }
++
+ switch (sll->sll_hatype) {
case ARPHRD_ETHER:
hw->hlen = 7;
break;
case ARPHRD_IEEE802:
#ifdef ARPHRD_IEEE802_TR
-@@ -496,18 +637,35 @@ get_hw_addr(const char *name, struct har
+@@ -496,18 +675,35 @@ get_hw_addr(const char *name, struct har
#endif /* ARPHRD_IEEE802_TR */
hw->hlen = 7;
hw->hbuf[0] = HTYPE_IEEE802;
if (local_family != AF_INET6)
- log_fatal("Unsupported device type %d for \"%s\"",
- sa->sa_family, name);
-+ log_fatal("Unsupported device type %ld for \"%s\"",
-+ (long int)sll->sll_family, name);
++ log_fatal("local_family != AF_INET6 for \"%s\"",
++ name);
hw->hlen = 0;
hw->hbuf[0] = HTYPE_RESERVED;
/* 0xdeadbeef should never occur on the wire,
-@@ -520,10 +678,11 @@ get_hw_addr(const char *name, struct har
+@@ -520,10 +716,11 @@ get_hw_addr(const char *name, struct har
break;
#endif
default:
-+ freeifaddrs(ifaddrs);
- log_fatal("Unsupported device type %ld for \"%s\"",
+- log_fatal("Unsupported device type %ld for \"%s\"",
- (long int)sa->sa_family, name);
-+ (long int)sll->sll_family, name);
++ freeifaddrs(ifaddrs);
++ log_fatal("Unsupported device type %h for \"%s\"",
++ sll->sll_hatype, name);
}
- close(sock);
+ freeifaddrs(ifaddrs);
}
#endif
-diff -up dhcp-4.2.2/common/socket.c.lpf-ib dhcp-4.2.2/common/socket.c
---- dhcp-4.2.2/common/socket.c.lpf-ib 2011-06-27 18:18:20.000000000 +0200
-+++ dhcp-4.2.2/common/socket.c 2011-09-19 11:24:08.705775490 +0200
-@@ -324,7 +324,7 @@ void if_register_send (info)
+diff -up dhcp-4.2.4/common/socket.c.lpf-ib dhcp-4.2.4/common/socket.c
+--- dhcp-4.2.4/common/socket.c.lpf-ib 2012-03-09 12:28:11.000000000 +0100
++++ dhcp-4.2.4/common/socket.c 2012-07-18 21:08:48.112834843 +0200
+@@ -325,7 +325,7 @@ void if_register_send (info)
info->wfdesc = if_register_socket(info, AF_INET, 0);
/* If this is a normal IPv4 address, get the hardware address. */
if (strcmp(info->name, "fallback") != 0)
#if defined (USE_SOCKET_FALLBACK)
/* Fallback only registers for send, but may need to receive as
well. */
-@@ -387,7 +387,7 @@ void if_register_receive (info)
+@@ -388,7 +388,7 @@ void if_register_receive (info)
#endif /* IP_PKTINFO... */
/* If this is a normal IPv4 address, get the hardware address. */
if (strcmp(info->name, "fallback") != 0)
if (!quiet_interface_discovery)
log_info ("Listening on Socket/%s%s%s",
-@@ -497,7 +497,7 @@ if_register6(struct interface_info *info
+@@ -498,7 +498,7 @@ if_register6(struct interface_info *info
if (req_multi)
if_register_multicast(info);
if (!quiet_interface_discovery) {
if (info->shared_network != NULL) {
-diff -up dhcp-4.2.2/includes/dhcpd.h.lpf-ib dhcp-4.2.2/includes/dhcpd.h
---- dhcp-4.2.2/includes/dhcpd.h.lpf-ib 2011-09-19 11:24:08.696775721 +0200
-+++ dhcp-4.2.2/includes/dhcpd.h 2011-09-19 11:24:08.707775438 +0200
+diff -up dhcp-4.2.4/includes/dhcpd.h.lpf-ib dhcp-4.2.4/includes/dhcpd.h
+--- dhcp-4.2.4/includes/dhcpd.h.lpf-ib 2012-07-18 21:08:48.102834978 +0200
++++ dhcp-4.2.4/includes/dhcpd.h 2012-07-18 21:08:48.114834815 +0200
@@ -1243,6 +1243,7 @@ struct interface_info {
struct shared_network *shared_network;
/* Networks connected to this interface. */
struct in_addr *addresses; /* Addresses associated with this
* interface.
*/
-@@ -2356,7 +2357,7 @@ void print_dns_status (int, struct dhcp_
+@@ -2360,7 +2361,7 @@ void print_dns_status (int, struct dhcp_
#endif
const char *print_time(TIME);
/* socket.c */
#if defined (USE_SOCKET_SEND) || defined (USE_SOCKET_RECEIVE) \
-diff -up dhcp-4.2.2/includes/dhcp.h.lpf-ib dhcp-4.2.2/includes/dhcp.h
---- dhcp-4.2.2/includes/dhcp.h.lpf-ib 2011-09-19 11:24:08.696775721 +0200
-+++ dhcp-4.2.2/includes/dhcp.h 2011-09-19 11:24:08.707775438 +0200
-@@ -79,6 +79,7 @@ struct dhcp_packet {
- #define HTYPE_ETHER 1 /* Ethernet 10Mbps */
- #define HTYPE_IEEE802 6 /* IEEE 802.2 Token Ring... */
- #define HTYPE_FDDI 8 /* FDDI... */
-+#define HTYPE_INFINIBAND 32 /* Infiniband IPoIB */
-
- #define HTYPE_RESERVED 0 /* RFC 5494 */
-
-diff -up dhcp-4.2.2b1/client/clparse.c.options dhcp-4.2.2b1/client/clparse.c
---- dhcp-4.2.2b1/client/clparse.c.options 2011-04-21 16:08:14.000000000 +0200
-+++ dhcp-4.2.2b1/client/clparse.c 2011-07-01 13:51:52.935755570 +0200
-@@ -146,6 +146,7 @@ isc_result_t read_client_conf ()
+diff -up dhcp-4.2.4b1/client/clparse.c.options dhcp-4.2.4b1/client/clparse.c
+--- dhcp-4.2.4b1/client/clparse.c.options 2012-03-09 12:28:10.000000000 +0100
++++ dhcp-4.2.4b1/client/clparse.c 2012-04-16 17:24:58.794047046 +0200
+@@ -154,6 +154,7 @@ isc_result_t read_client_conf ()
/* Requested lease time, used by DHCPv6 (DHCPv4 uses the option cache)
*/
top_level_config.requested_lease = 7200;
group_allocate (&top_level_config.on_receipt, MDL);
if (!top_level_config.on_receipt)
-@@ -313,7 +314,8 @@ void read_client_leases ()
+@@ -320,7 +321,8 @@ void read_client_leases ()
interface-declaration |
LEASE client-lease-statement |
ALIAS client-lease-statement |
void parse_client_statement (cfile, ip, config)
struct parse *cfile;
-@@ -732,6 +734,12 @@ void parse_client_statement (cfile, ip,
+@@ -739,6 +741,12 @@ void parse_client_statement (cfile, ip,
parse_reject_statement (cfile, config);
return;
default:
lose = 0;
stmt = (struct executable_statement *)0;
-diff -up dhcp-4.2.2b1/client/dhclient.c.options dhcp-4.2.2b1/client/dhclient.c
---- dhcp-4.2.2b1/client/dhclient.c.options 2011-05-11 16:20:59.000000000 +0200
-+++ dhcp-4.2.2b1/client/dhclient.c 2011-07-01 13:51:52.936755545 +0200
+diff -up dhcp-4.2.4b1/client/dhclient.c.options dhcp-4.2.4b1/client/dhclient.c
+--- dhcp-4.2.4b1/client/dhclient.c.options 2012-04-11 22:43:24.000000000 +0200
++++ dhcp-4.2.4b1/client/dhclient.c 2012-04-16 17:24:58.795047032 +0200
@@ -39,6 +39,12 @@
#include <limits.h>
#include <dns/result.h>
TIME default_lease_time = 43200; /* 12 hours... */
TIME max_lease_time = 86400; /* 24 hours... */
-@@ -87,6 +93,9 @@ int wanted_ia_na = -1; /* the absolute
+@@ -87,6 +93,9 @@ int wanted_ia_na = -1; /* the absolute
int wanted_ia_ta = 0;
int wanted_ia_pd = 0;
char *mockup_relay = NULL;
+ }
+
+ if ((timeout_arg = atoi(argv[i])) <= 0) {
-+ log_error("-T timeout option must be > 0 - bad value: %s",argv[i]);
++ log_error("timeout option must be > 0 - bad value: %s",argv[i]);
+ exit(1);
+ }
+ } else if (!strcmp(argv[i], "-V")) {
} else if (argv[i][0] == '-') {
usage();
} else if (interfaces_requested < 0) {
-@@ -484,6 +584,166 @@ main(int argc, char **argv) {
+@@ -484,6 +584,156 @@ main(int argc, char **argv) {
/* Parse the dhclient.conf file. */
read_client_conf();
+
+ if (timeout_arg) {
+ /* we just set the toplevel timeout, but per-client
-+ * timeouts may still be at defaults. Also, it makes no
-+ * sense having the reboot_timeout or backoff_cutoff
-+ * greater than the timeout:
++ * timeouts may still be at defaults.
+ */
-+ if ((top_level_config.backoff_cutoff == 15) && (top_level_config.backoff_cutoff > (timeout_arg / 2)))
-+ top_level_config.backoff_cutoff = (((unsigned long)(timeout_arg / 2)) == 0) ? timeout_arg : (unsigned long)(timeout_arg / 2);
-+
+ for (ip=interfaces; ip; ip = ip->next) {
+ if (ip->client->config->timeout == 60)
+ ip->client->config->timeout = timeout_arg;
-+
-+ if ((ip->client->config->reboot_timeout == 10) && (ip->client->config->reboot_timeout > ip->client->config->timeout))
-+ ip->client->config->reboot_timeout = ip->client->config->timeout;
-+ if ((ip->client->config->backoff_cutoff == 15) && (ip->client->config->backoff_cutoff > top_level_config.backoff_cutoff))
-+ ip->client->config->backoff_cutoff = top_level_config.backoff_cutoff;
+ }
+ }
+
/* Parse the lease database. */
read_client_leases();
-@@ -2397,7 +2657,8 @@ void make_discover (client, lease)
+@@ -2421,7 +2671,8 @@ void make_discover (client, lease)
client -> packet.xid = random ();
client -> packet.secs = 0; /* filled in by send_discover. */
client -> packet.flags = 0;
else
client -> packet.flags = htons (BOOTP_BROADCAST);
-@@ -2481,7 +2742,9 @@ void make_request (client, lease)
+@@ -2505,7 +2756,9 @@ void make_request (client, lease)
} else {
memset (&client -> packet.ciaddr, 0,
sizeof client -> packet.ciaddr);
client -> packet.flags = 0;
else
client -> packet.flags = htons (BOOTP_BROADCAST);
-@@ -2543,7 +2806,8 @@ void make_decline (client, lease)
+@@ -2567,7 +2820,8 @@ void make_decline (client, lease)
client -> packet.hops = 0;
client -> packet.xid = client -> xid;
client -> packet.secs = 0; /* Filled in by send_request. */
client -> packet.flags = 0;
else
client -> packet.flags = htons (BOOTP_BROADCAST);
-diff -up dhcp-4.2.2b1/common/conflex.c.options dhcp-4.2.2b1/common/conflex.c
---- dhcp-4.2.2b1/common/conflex.c.options 2011-05-11 16:20:59.000000000 +0200
-+++ dhcp-4.2.2b1/common/conflex.c 2011-07-01 13:51:52.938755494 +0200
-@@ -808,6 +808,8 @@ intern(char *atom, enum dhcp_token dfv)
+diff -up dhcp-4.2.4b1/common/conflex.c.options dhcp-4.2.4b1/common/conflex.c
+--- dhcp-4.2.4b1/common/conflex.c.options 2012-02-16 22:09:14.000000000 +0100
++++ dhcp-4.2.4b1/common/conflex.c 2012-04-16 17:24:58.796047018 +0200
+@@ -808,6 +808,8 @@ intern(char *atom, enum dhcp_token dfv)
return BALANCE;
if (!strcasecmp (atom + 1, "ound"))
return BOUND;
break;
case 'c':
if (!strcasecmp(atom + 1, "ase"))
-diff -up dhcp-4.2.2b1/includes/dhcpd.h.options dhcp-4.2.2b1/includes/dhcpd.h
---- dhcp-4.2.2b1/includes/dhcpd.h.options 2011-05-20 16:21:11.000000000 +0200
-+++ dhcp-4.2.2b1/includes/dhcpd.h 2011-07-01 13:51:52.940755442 +0200
+diff -up dhcp-4.2.4b1/includes/dhcpd.h.options dhcp-4.2.4b1/includes/dhcpd.h
+--- dhcp-4.2.4b1/includes/dhcpd.h.options 2012-04-10 02:55:06.000000000 +0200
++++ dhcp-4.2.4b1/includes/dhcpd.h 2012-04-16 17:24:58.797047004 +0200
@@ -1147,6 +1147,9 @@ struct client_config {
int do_forward_update; /* If nonzero, and if we have the
information we need, update the
};
/* Per-interface state used in the dhcp client... */
-diff -up dhcp-4.2.2b1/includes/dhctoken.h.options dhcp-4.2.2b1/includes/dhctoken.h
---- dhcp-4.2.2b1/includes/dhctoken.h.options 2011-05-12 14:02:47.000000000 +0200
-+++ dhcp-4.2.2b1/includes/dhctoken.h 2011-07-01 13:53:43.316861637 +0200
-@@ -361,7 +361,8 @@ enum dhcp_token {
- GETHOSTNAME = 662,
- REWIND = 663,
- INITIAL_DELAY = 664,
-- GETHOSTBYNAME = 665
-+ GETHOSTBYNAME = 665,
-+ BOOTP_BROADCAST_ALWAYS = 666
+diff -up dhcp-4.2.4b1/includes/dhctoken.h.options dhcp-4.2.4b1/includes/dhctoken.h
+--- dhcp-4.2.4b1/includes/dhctoken.h.options 2012-02-16 22:09:15.000000000 +0100
++++ dhcp-4.2.4b1/includes/dhctoken.h 2012-04-16 17:25:53.819276248 +0200
+@@ -364,7 +364,8 @@ enum dhcp_token {
+ GETHOSTBYNAME = 665,
+ PRIMARY6 = 666,
+ SECONDARY6 = 667,
+- TOKEN_INFINIBAND = 668
++ TOKEN_INFINIBAND = 668,
++ BOOTP_BROADCAST_ALWAYS = 669
};
#define is_identifier(x) ((x) >= FIRST_TOKEN && \
--- /dev/null
+diff -up dhcp-4.2.4b1/includes/dhcpd.h.paths dhcp-4.2.4b1/includes/dhcpd.h
+--- dhcp-4.2.4b1/includes/dhcpd.h.paths 2012-04-18 11:12:34.000000000 +0200
++++ dhcp-4.2.4b1/includes/dhcpd.h 2012-04-18 11:14:38.541272405 +0200
+@@ -1420,7 +1420,7 @@ typedef unsigned char option_mask [16];
+ #else /* !DEBUG */
+
+ #ifndef _PATH_DHCPD_CONF
+-#define _PATH_DHCPD_CONF "/etc/dhcpd.conf"
++#define _PATH_DHCPD_CONF "/etc/dhcp/dhcpd.conf"
+ #endif /* DEBUG */
+
+ #ifndef _PATH_DHCPD_DB
+@@ -1442,11 +1442,11 @@ typedef unsigned char option_mask [16];
+ #endif /* DEBUG */
+
+ #ifndef _PATH_DHCLIENT_CONF
+-#define _PATH_DHCLIENT_CONF "/etc/dhclient.conf"
++#define _PATH_DHCLIENT_CONF "/etc/dhcp/dhclient.conf"
+ #endif
+
+ #ifndef _PATH_DHCLIENT_SCRIPT
+-#define _PATH_DHCLIENT_SCRIPT "/sbin/dhclient-script"
++#define _PATH_DHCLIENT_SCRIPT "/usr/sbin/dhclient-script"
+ #endif
+
+ #ifndef _PATH_DHCLIENT_PID
-diff -up dhcp-4.2.2b1/client/clparse.c.rfc3442 dhcp-4.2.2b1/client/clparse.c
---- dhcp-4.2.2b1/client/clparse.c.rfc3442 2011-07-01 14:22:38.031534508 +0200
-+++ dhcp-4.2.2b1/client/clparse.c 2011-07-01 14:22:38.128532940 +0200
+diff -up dhcp-4.2.4b1/client/clparse.c.rfc3442 dhcp-4.2.4b1/client/clparse.c
+--- dhcp-4.2.4b1/client/clparse.c.rfc3442 2012-04-16 17:34:27.546079944 +0200
++++ dhcp-4.2.4b1/client/clparse.c 2012-04-16 17:34:27.605079118 +0200
@@ -37,7 +37,7 @@
struct client_config top_level_config;
struct option *default_requested_options[NUM_DEFAULT_REQUESTED_OPTS + 1];
static void parse_client_default_duid(struct parse *cfile);
-@@ -82,7 +82,11 @@ isc_result_t read_client_conf ()
+@@ -90,7 +90,11 @@ isc_result_t read_client_conf ()
dhcp_universe.code_hash, &code, 0, MDL);
/* 4 */
option_code_hash_lookup(&default_requested_options[3],
dhcp_universe.code_hash, &code, 0, MDL);
-@@ -136,6 +140,11 @@ isc_result_t read_client_conf ()
+@@ -144,6 +148,11 @@ isc_result_t read_client_conf ()
option_code_hash_lookup(&default_requested_options[13],
dhcp_universe.code_hash, &code, 0, MDL);
for (code = 0 ; code < NUM_DEFAULT_REQUESTED_OPTS ; code++) {
if (default_requested_options[code] == NULL)
log_fatal("Unable to find option definition for "
-diff -up dhcp-4.2.2b1/common/dhcp-options.5.rfc3442 dhcp-4.2.2b1/common/dhcp-options.5
---- dhcp-4.2.2b1/common/dhcp-options.5.rfc3442 2011-07-01 14:22:38.020534686 +0200
-+++ dhcp-4.2.2b1/common/dhcp-options.5 2011-07-01 14:22:38.129532924 +0200
-@@ -115,6 +115,26 @@ hexadecimal, separated by colons. For
+diff -up dhcp-4.2.4b1/common/dhcp-options.5.rfc3442 dhcp-4.2.4b1/common/dhcp-options.5
+--- dhcp-4.2.4b1/common/dhcp-options.5.rfc3442 2012-04-16 17:34:27.537080070 +0200
++++ dhcp-4.2.4b1/common/dhcp-options.5 2012-04-16 17:34:27.606079104 +0200
+@@ -115,6 +115,26 @@ hexadecimal, separated by colons. For
or
option dhcp-client-identifier 43:4c:49:45:54:2d:46:4f:4f;
.fi
.B option \fBstreettalk-directory-assistance-server\fR \fIip-address\fR
[\fB,\fR \fIip-address\fR...]\fB;\fR
.fi
-diff -up dhcp-4.2.2b1/common/inet.c.rfc3442 dhcp-4.2.2b1/common/inet.c
---- dhcp-4.2.2b1/common/inet.c.rfc3442 2011-05-11 02:47:22.000000000 +0200
-+++ dhcp-4.2.2b1/common/inet.c 2011-07-01 14:22:38.130532908 +0200
+diff -up dhcp-4.2.4b1/common/inet.c.rfc3442 dhcp-4.2.4b1/common/inet.c
+--- dhcp-4.2.4b1/common/inet.c.rfc3442 2011-05-11 02:47:22.000000000 +0200
++++ dhcp-4.2.4b1/common/inet.c 2012-04-16 17:34:27.607079090 +0200
@@ -528,6 +528,60 @@ free_iaddrcidrnetlist(struct iaddrcidrne
return ISC_R_SUCCESS;
}
/* piaddr() turns an iaddr structure into a printable address. */
/* XXX: should use a const pointer rather than passing the structure */
const char *
-diff -up dhcp-4.2.2b1/common/options.c.rfc3442 dhcp-4.2.2b1/common/options.c
---- dhcp-4.2.2b1/common/options.c.rfc3442 2011-03-24 22:57:13.000000000 +0100
-+++ dhcp-4.2.2b1/common/options.c 2011-07-01 14:22:38.132532876 +0200
+diff -up dhcp-4.2.4b1/common/options.c.rfc3442 dhcp-4.2.4b1/common/options.c
+--- dhcp-4.2.4b1/common/options.c.rfc3442 2012-03-20 01:31:53.000000000 +0100
++++ dhcp-4.2.4b1/common/options.c 2012-04-16 17:34:27.608079076 +0200
@@ -706,7 +706,11 @@ cons_options(struct packet *inpacket, st
* packet.
*/
case '6':
iaddr.len = 16;
memcpy(iaddr.iabuf, dp, 16);
-diff -up dhcp-4.2.2b1/common/parse.c.rfc3442 dhcp-4.2.2b1/common/parse.c
---- dhcp-4.2.2b1/common/parse.c.rfc3442 2011-07-01 14:22:38.097533441 +0200
-+++ dhcp-4.2.2b1/common/parse.c 2011-07-01 14:22:38.135532828 +0200
+diff -up dhcp-4.2.4b1/common/parse.c.rfc3442 dhcp-4.2.4b1/common/parse.c
+--- dhcp-4.2.4b1/common/parse.c.rfc3442 2012-04-16 17:34:27.577079510 +0200
++++ dhcp-4.2.4b1/common/parse.c 2012-04-16 17:34:27.610079048 +0200
@@ -341,6 +341,39 @@ int parse_ip_addr (cfile, addr)
}
* Return true if every character in the string is hexadecimal.
*/
static int
-@@ -700,8 +733,10 @@ unsigned char *parse_numeric_aggregate (
+@@ -704,8 +737,10 @@ unsigned char *parse_numeric_aggregate (
if (count) {
token = peek_token (&val, (unsigned *)0, cfile);
if (token != separator) {
if (token != RBRACE && token != LBRACE)
token = next_token (&val,
(unsigned *)0,
-@@ -1624,6 +1659,9 @@ int parse_option_code_definition (cfile,
+@@ -1628,6 +1663,9 @@ int parse_option_code_definition (cfile,
case IP_ADDRESS:
type = 'I';
break;
case IP6_ADDRESS:
type = '6';
break;
-@@ -5288,6 +5326,15 @@ int parse_option_token (rv, cfile, fmt,
+@@ -5375,6 +5413,15 @@ int parse_option_token (rv, cfile, fmt,
}
break;
case '6': /* IPv6 address. */
if (!parse_ip6_addr(cfile, &addr)) {
return 0;
-@@ -5548,6 +5595,13 @@ int parse_option_decl (oc, cfile)
+@@ -5635,6 +5682,13 @@ int parse_option_decl (oc, cfile)
goto exit;
len = ip_addr.len;
dp = ip_addr.iabuf;
alloc:
if (hunkix + len > sizeof hunkbuf) {
-diff -up dhcp-4.2.2b1/common/tables.c.rfc3442 dhcp-4.2.2b1/common/tables.c
---- dhcp-4.2.2b1/common/tables.c.rfc3442 2011-07-01 14:22:38.087533601 +0200
-+++ dhcp-4.2.2b1/common/tables.c 2011-07-01 14:22:38.137532796 +0200
-@@ -51,6 +51,7 @@ HASH_FUNCTIONS (option_code, const unsig
+diff -up dhcp-4.2.4b1/common/tables.c.rfc3442 dhcp-4.2.4b1/common/tables.c
+--- dhcp-4.2.4b1/common/tables.c.rfc3442 2012-04-16 17:34:27.566079664 +0200
++++ dhcp-4.2.4b1/common/tables.c 2012-04-16 17:34:27.611079034 +0200
+@@ -52,6 +52,7 @@ HASH_FUNCTIONS (option_code, const unsig
Format codes:
I - IPv4 address
6 - IPv6 address
l - 32-bit signed integer
L - 32-bit unsigned integer
-@@ -208,6 +209,7 @@ static struct option dhcp_options[] = {
+@@ -209,6 +210,7 @@ static struct option dhcp_options[] = {
{ "default-url", "t", &dhcp_universe, 114, 1 },
{ "subnet-selection", "I", &dhcp_universe, 118, 1 },
{ "domain-search", "D", &dhcp_universe, 119, 1 },
{ "vivco", "Evendor-class.", &dhcp_universe, 124, 1 },
{ "vivso", "Evendor.", &dhcp_universe, 125, 1 },
#if 0
-diff -up dhcp-4.2.2b1/includes/dhcpd.h.rfc3442 dhcp-4.2.2b1/includes/dhcpd.h
---- dhcp-4.2.2b1/includes/dhcpd.h.rfc3442 2011-07-01 14:22:38.000000000 +0200
-+++ dhcp-4.2.2b1/includes/dhcpd.h 2011-07-01 14:24:19.999810333 +0200
-@@ -2662,6 +2662,7 @@ isc_result_t range2cidr(struct iaddrcidr
+diff -up dhcp-4.2.4b1/includes/dhcpd.h.rfc3442 dhcp-4.2.4b1/includes/dhcpd.h
+--- dhcp-4.2.4b1/includes/dhcpd.h.rfc3442 2012-04-16 17:34:27.543079986 +0200
++++ dhcp-4.2.4b1/includes/dhcpd.h 2012-04-16 17:34:27.613079006 +0200
+@@ -2666,6 +2666,7 @@ isc_result_t range2cidr(struct iaddrcidr
const struct iaddr *lo, const struct iaddr *hi);
isc_result_t free_iaddrcidrnetlist(struct iaddrcidrnetlist **result);
const char *piaddr (struct iaddr);
char *piaddrmask(struct iaddr *, struct iaddr *);
char *piaddrcidr(const struct iaddr *, unsigned int);
u_int16_t validate_port(char *);
-@@ -2869,6 +2870,7 @@ void parse_client_lease_declaration (str
+@@ -2873,6 +2874,7 @@ void parse_client_lease_declaration (str
int parse_option_decl (struct option_cache **, struct parse *);
void parse_string_list (struct parse *, struct string_list **, int);
int parse_ip_addr (struct parse *, struct iaddr *);
int parse_ip_addr_with_subnet(struct parse *, struct iaddrmatch *);
void parse_reject_statement (struct parse *, struct client_config *);
-diff -up dhcp-4.2.2b1/includes/dhcp.h.rfc3442 dhcp-4.2.2b1/includes/dhcp.h
---- dhcp-4.2.2b1/includes/dhcp.h.rfc3442 2009-11-20 02:49:01.000000000 +0100
-+++ dhcp-4.2.2b1/includes/dhcp.h 2011-07-01 14:22:38.145532665 +0200
-@@ -158,6 +158,7 @@ struct dhcp_packet {
+diff -up dhcp-4.2.4b1/includes/dhcp.h.rfc3442 dhcp-4.2.4b1/includes/dhcp.h
+--- dhcp-4.2.4b1/includes/dhcp.h.rfc3442 2012-02-16 22:09:14.000000000 +0100
++++ dhcp-4.2.4b1/includes/dhcp.h 2012-04-16 17:34:27.613079006 +0200
+@@ -163,6 +163,7 @@ struct dhcp_packet {
#define DHO_ASSOCIATED_IP 92
#define DHO_SUBNET_SELECTION 118 /* RFC3011! */
#define DHO_DOMAIN_SEARCH 119 /* RFC3397 */
#define DHO_VIVCO_SUBOPTIONS 124
#define DHO_VIVSO_SUBOPTIONS 125
-diff -up dhcp-4.2.2b1/includes/dhctoken.h.rfc3442 dhcp-4.2.2b1/includes/dhctoken.h
---- dhcp-4.2.2b1/includes/dhctoken.h.rfc3442 2011-07-01 14:22:37.000000000 +0200
-+++ dhcp-4.2.2b1/includes/dhctoken.h 2011-07-01 14:25:12.541867623 +0200
-@@ -362,7 +362,8 @@ enum dhcp_token {
- REWIND = 663,
- INITIAL_DELAY = 664,
- GETHOSTBYNAME = 665,
-- BOOTP_BROADCAST_ALWAYS = 666
-+ BOOTP_BROADCAST_ALWAYS = 666,
-+ DESTINATION_DESCRIPTOR = 667
+diff -up dhcp-4.2.4b1/includes/dhctoken.h.rfc3442 dhcp-4.2.4b1/includes/dhctoken.h
+--- dhcp-4.2.4b1/includes/dhctoken.h.rfc3442 2012-04-16 17:34:27.000000000 +0200
++++ dhcp-4.2.4b1/includes/dhctoken.h 2012-04-16 17:35:15.028414805 +0200
+@@ -365,7 +365,8 @@ enum dhcp_token {
+ PRIMARY6 = 666,
+ SECONDARY6 = 667,
+ TOKEN_INFINIBAND = 668,
+- BOOTP_BROADCAST_ALWAYS = 669
++ BOOTP_BROADCAST_ALWAYS = 669,
++ DESTINATION_DESCRIPTOR = 670
};
#define is_identifier(x) ((x) >= FIRST_TOKEN && \
--- /dev/null
+diff -up dhcp-4.2.4b1/client/dhclient.c.send_release dhcp-4.2.4b1/client/dhclient.c
+--- dhcp-4.2.4b1/client/dhclient.c.send_release 2012-04-16 17:48:52.000000000 +0200
++++ dhcp-4.2.4b1/client/dhclient.c 2012-04-16 17:50:44.357396720 +0200
+@@ -2764,8 +2764,8 @@ void send_release (cpp)
+ inet_ntoa (destination.sin_addr),
+ ntohs (destination.sin_port), client -> xid);
+
+- if (fallback_interface) {
+- result = send_packet(fallback_interface, NULL, &client->packet,
++ if (client -> interface) {
++ result = send_packet(client -> interface, NULL, &client->packet,
+ client->packet_length, from, &destination,
+ NULL);
+ if (result < 0) {
+@@ -2776,7 +2776,7 @@ void send_release (cpp)
+ }
+ } else {
+ /* Send out a packet. */
+- result = send_packet(client->interface, NULL, &client->packet,
++ result = send_packet(fallback_interface, NULL, &client->packet,
+ client->packet_length, from, &destination,
+ NULL);
+ if (result < 0) {
-diff -up dhcp-4.2.2/configure.ac.systemtap dhcp-4.2.2/configure.ac
---- dhcp-4.2.2/configure.ac.systemtap 2011-09-21 15:13:35.515434854 +0200
-+++ dhcp-4.2.2/configure.ac 2011-09-21 15:13:35.574434049 +0200
-@@ -485,6 +485,35 @@ else
+diff -up dhcp-4.2.4b1/configure.ac.systemtap dhcp-4.2.4b1/configure.ac
+--- dhcp-4.2.4b1/configure.ac.systemtap 2012-04-16 17:46:10.913227143 +0200
++++ dhcp-4.2.4b1/configure.ac 2012-04-16 17:46:10.947226667 +0200
+@@ -504,6 +504,35 @@ else
AC_MSG_RESULT(no)
fi
# Solaris needs some libraries for functions
AC_SEARCH_LIBS(socket, [socket])
AC_SEARCH_LIBS(inet_ntoa, [nsl])
-@@ -631,6 +660,7 @@ AC_OUTPUT([
+@@ -650,6 +679,7 @@ AC_OUTPUT([
relay/Makefile
server/Makefile
tests/Makefile
])
sh util/bindvar.sh
-diff -up dhcp-4.2.2/Makefile.am.systemtap dhcp-4.2.2/Makefile.am
---- dhcp-4.2.2/Makefile.am.systemtap 2011-09-21 15:13:35.339437258 +0200
-+++ dhcp-4.2.2/Makefile.am 2011-09-21 15:13:35.574434049 +0200
+diff -up dhcp-4.2.4b1/Makefile.am.systemtap dhcp-4.2.4b1/Makefile.am
+--- dhcp-4.2.4b1/Makefile.am.systemtap 2012-04-16 17:46:10.791228851 +0200
++++ dhcp-4.2.4b1/Makefile.am 2012-04-16 17:46:10.947226667 +0200
@@ -29,5 +29,8 @@ endif
- SUBDIRS += includes tests common dst omapip client dhcpctl relay server
+ SUBDIRS += includes tests common omapip client dhcpctl relay server
+SUBDIRS += tapset
+#DIST_SUBDIRS = $(SUBDIRS)
+
nobase_include_HEADERS = dhcpctl/dhcpctl.h
-diff -up dhcp-4.2.2/server/dhcp.c.systemtap dhcp-4.2.2/server/dhcp.c
---- dhcp-4.2.2/server/dhcp.c.systemtap 2011-09-21 15:13:35.362436945 +0200
-+++ dhcp-4.2.2/server/dhcp.c 2011-09-21 15:13:35.576434021 +0200
+diff -up dhcp-4.2.4b1/server/dhcp.c.systemtap dhcp-4.2.4b1/server/dhcp.c
+--- dhcp-4.2.4b1/server/dhcp.c.systemtap 2012-04-16 17:46:10.816228501 +0200
++++ dhcp-4.2.4b1/server/dhcp.c 2012-04-16 17:48:11.528537555 +0200
@@ -36,7 +36,7 @@
#include <errno.h>
#include <limits.h>
}
void dhcprequest (packet, ms_nulltp, ip_lease)
-@@ -422,6 +426,8 @@ void dhcprequest (packet, ms_nulltp, ip_
- int have_server_identifier = 0;
+@@ -421,6 +425,8 @@ void dhcprequest (packet, ms_nulltp, ip_
+ #endif
int have_requested_addr = 0;
+ TRACE(DHCPD_REQUEST_START());
oc = lookup_option (&dhcp_universe, packet -> options,
DHO_DHCP_REQUESTED_ADDRESS);
memset (&data, 0, sizeof data);
-@@ -679,6 +685,9 @@ void dhcprequest (packet, ms_nulltp, ip_
+@@ -677,6 +683,9 @@ void dhcprequest (packet, ms_nulltp, ip_
log_info ("%s: unknown lease %s.", msgbuf, piaddr (cip));
out:
if (subnet)
subnet_dereference (&subnet, MDL);
if (lease)
-@@ -697,6 +706,7 @@ void dhcprelease (packet, ms_nulltp)
+@@ -695,6 +704,7 @@ void dhcprelease (packet, ms_nulltp)
const char *s;
char msgbuf [1024], cstr[16]; /* XXX */
/* DHCPRELEASE must not specify address in requested-address
option, but old protocol specs weren't explicit about this,
-@@ -821,6 +831,8 @@ void dhcprelease (packet, ms_nulltp)
+@@ -819,6 +829,8 @@ void dhcprelease (packet, ms_nulltp)
#endif
if (lease)
lease_dereference (&lease, MDL);
}
void dhcpdecline (packet, ms_nulltp)
-@@ -838,6 +850,8 @@ void dhcpdecline (packet, ms_nulltp)
+@@ -836,6 +848,8 @@ void dhcpdecline (packet, ms_nulltp)
struct option_cache *oc;
struct data_string data;
/* DHCPDECLINE must specify address. */
if (!(oc = lookup_option (&dhcp_universe, packet -> options,
DHO_DHCP_REQUESTED_ADDRESS)))
-@@ -949,6 +963,8 @@ void dhcpdecline (packet, ms_nulltp)
+@@ -947,6 +961,8 @@ void dhcpdecline (packet, ms_nulltp)
option_state_dereference (&options, MDL);
if (lease)
lease_dereference (&lease, MDL);
void dhcpinform (packet, ms_nulltp)
@@ -970,6 +986,8 @@ void dhcpinform (packet, ms_nulltp)
- struct in_addr from;
- isc_boolean_t zeroed_ciaddr;
+ struct interface_info *interface;
+ int result;
+ TRACE(DHCPD_INFORM_START());
+
/* The client should set ciaddr to its IP address, but apparently
it's common for clients not to do this, so we'll use their IP
source address if they didn't set ciaddr. */
-@@ -1320,6 +1338,8 @@ void dhcpinform (packet, ms_nulltp)
- from, &to, (struct hardware *)0);
+@@ -1327,6 +1345,8 @@ void dhcpinform (packet, ms_nulltp)
+
if (subnet)
subnet_dereference (&subnet, MDL);
+
}
void nak_lease (packet, cip)
-@@ -1336,6 +1356,8 @@ void nak_lease (packet, cip)
+@@ -1343,6 +1363,8 @@ void nak_lease (packet, cip)
struct option_state *options = (struct option_state *)0;
struct option_cache *oc = (struct option_cache *)0;
option_state_allocate (&options, MDL);
memset (&outgoing, 0, sizeof outgoing);
memset (&raw, 0, sizeof raw);
-@@ -1474,6 +1496,8 @@ void nak_lease (packet, cip)
- errno = 0;
- result = send_packet(packet->interface, packet, &raw,
- outgoing.packet_length, from, &to, NULL);
-+
+@@ -1494,6 +1516,7 @@ void nak_lease (packet, cip)
+ packet->interface->name);
+ }
+
+ TRACE(DHCPD_NAK_LEASE_DONE());
}
void ack_lease (packet, lease, offer, when, msg, ms_nulltp, hp)
-@@ -1515,6 +1539,8 @@ void ack_lease (packet, lease, offer, wh
+@@ -1535,6 +1558,8 @@ void ack_lease (packet, lease, offer, wh
if (lease -> state)
return;
/* Save original cltt for comparison later. */
lease_cltt = lease->cltt;
-@@ -2877,6 +2903,8 @@ void ack_lease (packet, lease, offer, wh
+@@ -2897,6 +2922,8 @@ void ack_lease (packet, lease, offer, wh
#endif
dhcp_reply(lease);
}
}
/*
-@@ -3029,6 +3057,8 @@ void dhcp_reply (lease)
+@@ -3049,6 +3076,8 @@ void dhcp_reply (lease)
if (!state)
log_fatal ("dhcp_reply was supplied lease with no state!");
/* Compose a response for the client... */
memset (&raw, 0, sizeof raw);
memset (&d1, 0, sizeof d1);
-@@ -3236,6 +3266,8 @@ void dhcp_reply (lease)
+@@ -3270,6 +3299,8 @@ void dhcp_reply (lease)
free_lease_state (state, MDL);
lease -> state = (struct lease_state *)0;
}
int find_lease (struct lease **lp,
-@@ -3258,6 +3290,8 @@ int find_lease (struct lease **lp,
+@@ -3292,6 +3323,8 @@ int find_lease (struct lease **lp,
struct data_string client_identifier;
struct hardware h;
#if defined(FAILOVER_PROTOCOL)
/* Quick check to see if the peer has leases. */
if (peer_has_leases) {
-@@ -3985,6 +4019,9 @@ int find_lease (struct lease **lp,
+@@ -4019,6 +4052,9 @@ int find_lease (struct lease **lp,
#if defined (DEBUG_FIND_LEASE)
log_info ("Not returning a lease.");
#endif
return 0;
}
-diff -up dhcp-4.2.2/server/dhcpd.c.systemtap dhcp-4.2.2/server/dhcpd.c
---- dhcp-4.2.2/server/dhcpd.c.systemtap 2011-09-21 15:13:35.471435455 +0200
-+++ dhcp-4.2.2/server/dhcpd.c 2011-09-21 15:14:47.686449112 +0200
-@@ -63,6 +63,8 @@ static const char url [] =
- int keep_capabilities = 0;
- #endif
+diff -up dhcp-4.2.4b1/server/dhcpd.c.systemtap dhcp-4.2.4b1/server/dhcpd.c
+--- dhcp-4.2.4b1/server/dhcpd.c.systemtap 2012-04-16 17:46:10.928226933 +0200
++++ dhcp-4.2.4b1/server/dhcpd.c 2012-04-16 17:46:10.951226611 +0200
+@@ -58,6 +58,8 @@ static const char url [] =
+ # undef group
+ #endif /* PARANOIA */
+#include "trace.h"
+
static void usage(void);
struct iaddr server_identifier;
-@@ -887,7 +889,7 @@ main(int argc, char **argv) {
- log_info ("Dropped all capabilities.");
- }
- #endif
--
-+ TRACE(DHCPD_MAIN());
+@@ -859,6 +861,7 @@ main(int argc, char **argv) {
+ omapi_set_int_value ((omapi_object_t *)dhcp_control_object,
+ (omapi_object_t *)0, "state", server_running);
+
++ TRACE(DHCPD_MAIN());
/* Receive packets and dispatch them... */
dispatch ();
-diff -up dhcp-4.2.2/server/dhcpv6.c.systemtap dhcp-4.2.2/server/dhcpv6.c
---- dhcp-4.2.2/server/dhcpv6.c.systemtap 2011-09-21 15:13:35.528434676 +0200
-+++ dhcp-4.2.2/server/dhcpv6.c 2011-09-21 15:13:35.579433979 +0200
+diff -up dhcp-4.2.4b1/server/dhcpv6.c.systemtap dhcp-4.2.4b1/server/dhcpv6.c
+--- dhcp-4.2.4b1/server/dhcpv6.c.systemtap 2012-04-16 17:46:10.925226975 +0200
++++ dhcp-4.2.4b1/server/dhcpv6.c 2012-04-16 17:46:10.953226583 +0200
@@ -15,6 +15,7 @@
*/
#ifdef DHCPv6
-@@ -4171,6 +4172,8 @@ static void
+@@ -4198,6 +4199,8 @@ static void
dhcpv6_solicit(struct data_string *reply_ret, struct packet *packet) {
struct data_string client_id;
/*
* Validate our input.
*/
-@@ -4184,6 +4187,8 @@ dhcpv6_solicit(struct data_string *reply
+@@ -4211,6 +4214,8 @@ dhcpv6_solicit(struct data_string *reply
* Clean up.
*/
data_string_forget(&client_id, MDL);
}
/*
-@@ -4197,6 +4202,8 @@ dhcpv6_request(struct data_string *reply
+@@ -4224,6 +4229,8 @@ dhcpv6_request(struct data_string *reply
struct data_string client_id;
struct data_string server_id;
/*
* Validate our input.
*/
-@@ -4214,6 +4221,8 @@ dhcpv6_request(struct data_string *reply
+@@ -4241,6 +4248,8 @@ dhcpv6_request(struct data_string *reply
*/
data_string_forget(&client_id, MDL);
data_string_forget(&server_id, MDL);
}
/* Find a DHCPv6 packet's shared network from hints in the packet.
-@@ -4326,6 +4335,8 @@ dhcpv6_confirm(struct data_string *reply
+@@ -4353,6 +4362,8 @@ dhcpv6_confirm(struct data_string *reply
struct dhcpv6_packet *reply = (struct dhcpv6_packet *)reply_data;
int reply_ofs = (int)(offsetof(struct dhcpv6_packet, options));
/*
* Basic client message validation.
*/
-@@ -4512,6 +4523,8 @@ exit:
+@@ -4539,6 +4550,8 @@ exit:
option_state_dereference(&cli_enc_opt_state, MDL);
if (opt_state != NULL)
option_state_dereference(&opt_state, MDL);
}
/*
-@@ -4526,6 +4539,8 @@ dhcpv6_renew(struct data_string *reply,
+@@ -4553,6 +4566,8 @@ dhcpv6_renew(struct data_string *reply,
struct data_string client_id;
struct data_string server_id;
/*
* Validate the request.
*/
-@@ -4543,6 +4558,8 @@ dhcpv6_renew(struct data_string *reply,
+@@ -4570,6 +4585,8 @@ dhcpv6_renew(struct data_string *reply,
*/
data_string_forget(&server_id, MDL);
data_string_forget(&client_id, MDL);
}
/*
-@@ -4556,6 +4573,8 @@ static void
+@@ -4583,6 +4600,8 @@ static void
dhcpv6_rebind(struct data_string *reply, struct packet *packet) {
struct data_string client_id;
if (!valid_client_msg(packet, &client_id)) {
return;
}
-@@ -4563,6 +4582,8 @@ dhcpv6_rebind(struct data_string *reply,
+@@ -4590,6 +4609,8 @@ dhcpv6_rebind(struct data_string *reply,
lease_to_client(reply, packet, &client_id, NULL);
data_string_forget(&client_id, MDL);
}
static void
-@@ -5009,6 +5030,8 @@ dhcpv6_decline(struct data_string *reply
+@@ -5034,6 +5055,8 @@ dhcpv6_decline(struct data_string *reply
struct data_string client_id;
struct data_string server_id;
/*
* Validate our input.
*/
-@@ -5029,6 +5052,8 @@ dhcpv6_decline(struct data_string *reply
+@@ -5054,6 +5077,8 @@ dhcpv6_decline(struct data_string *reply
data_string_forget(&server_id, MDL);
data_string_forget(&client_id, MDL);
}
static void
-@@ -5479,6 +5504,8 @@ dhcpv6_release(struct data_string *reply
+@@ -5502,6 +5527,8 @@ dhcpv6_release(struct data_string *reply
struct data_string client_id;
struct data_string server_id;
/*
* Validate our input.
*/
-@@ -5500,6 +5527,8 @@ dhcpv6_release(struct data_string *reply
+@@ -5523,6 +5550,8 @@ dhcpv6_release(struct data_string *reply
data_string_forget(&server_id, MDL);
data_string_forget(&client_id, MDL);
}
/*
-@@ -5512,6 +5541,8 @@ dhcpv6_information_request(struct data_s
+@@ -5535,6 +5564,8 @@ dhcpv6_information_request(struct data_s
struct data_string client_id;
struct data_string server_id;
/*
* Validate our input.
*/
-@@ -5543,6 +5574,8 @@ dhcpv6_information_request(struct data_s
+@@ -5566,6 +5597,8 @@ dhcpv6_information_request(struct data_s
data_string_forget(&client_id, MDL);
}
data_string_forget(&server_id, MDL);
}
/*
-@@ -5571,6 +5604,8 @@ dhcpv6_relay_forw(struct data_string *re
+@@ -5594,6 +5627,8 @@ dhcpv6_relay_forw(struct data_string *re
struct dhcpv6_relay_packet *reply;
int reply_ofs;
/*
* Initialize variables for early exit.
*/
-@@ -5828,6 +5863,8 @@ exit:
+@@ -5853,6 +5888,8 @@ exit:
if (enc_packet != NULL) {
packet_dereference(&enc_packet, MDL);
}
}
static void
-diff -up dhcp-4.2.2/server/failover.c.systemtap dhcp-4.2.2/server/failover.c
---- dhcp-4.2.2/server/failover.c.systemtap 2011-05-11 16:21:00.000000000 +0200
-+++ dhcp-4.2.2/server/failover.c 2011-09-21 15:13:35.584433913 +0200
-@@ -35,6 +35,8 @@
+diff -up dhcp-4.2.4b1/server/failover.c.systemtap dhcp-4.2.4b1/server/failover.c
+--- dhcp-4.2.4b1/server/failover.c.systemtap 2012-03-19 23:29:49.000000000 +0100
++++ dhcp-4.2.4b1/server/failover.c 2012-04-16 17:46:10.955226555 +0200
+@@ -36,6 +36,8 @@
#include "dhcpd.h"
#include <omapip/omapip_p.h>
#if defined (FAILOVER_PROTOCOL)
dhcp_failover_state_t *failover_states;
static isc_result_t do_a_failover_option (omapi_object_t *,
-@@ -1711,6 +1713,8 @@ isc_result_t dhcp_failover_set_state (dh
+@@ -1712,6 +1714,8 @@ isc_result_t dhcp_failover_set_state (dh
struct lease *l;
struct timeval tv;
/* If we're in certain states where we're sending updates, and the peer
* state changes, we need to re-schedule any pending updates just to
* be on the safe side. This results in retransmission.
-@@ -1938,6 +1942,8 @@ isc_result_t dhcp_failover_set_state (dh
+@@ -1939,6 +1943,8 @@ isc_result_t dhcp_failover_set_state (dh
break;
}
return ISC_R_SUCCESS;
}
-@@ -2420,6 +2426,8 @@ dhcp_failover_pool_dobalance(dhcp_failov
+@@ -2422,6 +2428,8 @@ dhcp_failover_pool_dobalance(dhcp_failov
if (state -> me.state != normal)
return 0;
state->last_balance = cur_time;
for (s = shared_networks ; s ; s = s->next) {
-@@ -2580,6 +2588,8 @@ dhcp_failover_pool_dobalance(dhcp_failov
+@@ -2582,6 +2590,8 @@ dhcp_failover_pool_dobalance(dhcp_failov
if (leases_queued)
commit_leases();
return leases_queued;
}
-diff -up dhcp-4.2.2/server/Makefile.am.systemtap dhcp-4.2.2/server/Makefile.am
---- dhcp-4.2.2/server/Makefile.am.systemtap 2011-09-21 15:13:35.517434828 +0200
-+++ dhcp-4.2.2/server/Makefile.am 2011-09-21 15:13:35.585433900 +0200
+diff -up dhcp-4.2.4b1/server/Makefile.am.systemtap dhcp-4.2.4b1/server/Makefile.am
+--- dhcp-4.2.4b1/server/Makefile.am.systemtap 2012-04-16 17:46:10.914227129 +0200
++++ dhcp-4.2.4b1/server/Makefile.am 2012-04-16 17:46:10.956226541 +0200
@@ -4,7 +4,7 @@ dist_sysconf_DATA = dhcpd.conf
sbin_PROGRAMS = dhcpd
dhcpd_SOURCES = dhcpd.c dhcp.c bootp.c confpars.c db.c class.c failover.c \
dhcpd_CFLAGS = $(LDAP_CFLAGS)
dhcpd_LDADD = ../common/libdhcp.a ../omapip/libomapi.la \
-@@ -14,3 +14,13 @@ dhcpd_LDADD = ../common/libdhcp.a ../oma
+@@ -13,3 +13,13 @@ dhcpd_LDADD = ../common/libdhcp.a ../oma
man_MANS = dhcpd.8 dhcpd.conf.5 dhcpd.leases.5
EXTRA_DIST = $(man_MANS)
+
+dhcpd_LDADD += probes.o
+endif
-diff -up dhcp-4.2.2/server/probes.d.systemtap dhcp-4.2.2/server/probes.d
---- dhcp-4.2.2/server/probes.d.systemtap 2011-09-21 15:13:35.585433900 +0200
-+++ dhcp-4.2.2/server/probes.d 2011-09-21 15:13:35.585433900 +0200
+diff -up dhcp-4.2.4b1/server/probes.d.systemtap dhcp-4.2.4b1/server/probes.d
+--- dhcp-4.2.4b1/server/probes.d.systemtap 2012-04-16 17:46:10.956226541 +0200
++++ dhcp-4.2.4b1/server/probes.d 2012-04-16 17:46:10.956226541 +0200
@@ -0,0 +1,43 @@
+provider dhcpd {
+ probe main();
+ probe failover_set_state_start(int, int) /* state, new_state */
+ probe failover_set_state_done()
+};
-diff -up dhcp-4.2.2/server/trace.h.systemtap dhcp-4.2.2/server/trace.h
---- dhcp-4.2.2/server/trace.h.systemtap 2011-09-21 15:13:35.585433900 +0200
-+++ dhcp-4.2.2/server/trace.h 2011-09-21 15:13:35.585433900 +0200
+diff -up dhcp-4.2.4b1/server/trace.h.systemtap dhcp-4.2.4b1/server/trace.h
+--- dhcp-4.2.4b1/server/trace.h.systemtap 2012-04-16 17:46:10.956226541 +0200
++++ dhcp-4.2.4b1/server/trace.h 2012-04-16 17:46:10.956226541 +0200
@@ -0,0 +1,11 @@
+// trace.h
+
+// Wrap the probe to allow it to be removed when no systemtap available
+#define TRACE(probe)
+#endif
-diff -up dhcp-4.2.2/tapset/dhcpd.stp.systemtap dhcp-4.2.2/tapset/dhcpd.stp
---- dhcp-4.2.2/tapset/dhcpd.stp.systemtap 2011-09-21 15:13:35.586433886 +0200
-+++ dhcp-4.2.2/tapset/dhcpd.stp 2011-09-21 15:13:35.586433886 +0200
+diff -up dhcp-4.2.4b1/tapset/dhcpd.stp.systemtap dhcp-4.2.4b1/tapset/dhcpd.stp
+--- dhcp-4.2.4b1/tapset/dhcpd.stp.systemtap 2012-04-16 17:46:10.957226527 +0200
++++ dhcp-4.2.4b1/tapset/dhcpd.stp 2012-04-16 17:46:10.957226527 +0200
@@ -0,0 +1,212 @@
+/* dhcpd tapset
+ Copyright (C) 2011, Red Hat Inc.
+{
+ probestr = sprintf("%s", $$name);
+}
-diff -up dhcp-4.2.2/tapset/Makefile.am.systemtap dhcp-4.2.2/tapset/Makefile.am
---- dhcp-4.2.2/tapset/Makefile.am.systemtap 2011-09-21 15:13:35.586433886 +0200
-+++ dhcp-4.2.2/tapset/Makefile.am 2011-09-21 15:13:35.586433886 +0200
+diff -up dhcp-4.2.4b1/tapset/Makefile.am.systemtap dhcp-4.2.4b1/tapset/Makefile.am
+--- dhcp-4.2.4b1/tapset/Makefile.am.systemtap 2012-04-16 17:46:10.957226527 +0200
++++ dhcp-4.2.4b1/tapset/Makefile.am 2012-04-16 17:46:10.957226527 +0200
@@ -0,0 +1,26 @@
+# Makefile.am for dhcp/tapset
+# Jiri Popelka
-diff -up dhcp-4.2.0/server/bootp.c.unicast dhcp-4.2.0/server/bootp.c
---- dhcp-4.2.0/server/bootp.c.unicast 2009-11-20 02:49:03.000000000 +0100
-+++ dhcp-4.2.0/server/bootp.c 2010-07-21 13:40:25.000000000 +0200
-@@ -58,6 +58,7 @@ void bootp (packet)
+diff -up dhcp-4.2.4b1/server/bootp.c.unicast dhcp-4.2.4b1/server/bootp.c
+--- dhcp-4.2.4b1/server/bootp.c.unicast 2012-04-10 23:27:06.000000000 +0200
++++ dhcp-4.2.4b1/server/bootp.c 2012-04-16 17:28:42.095919022 +0200
+@@ -59,6 +59,7 @@ void bootp (packet)
char msgbuf [1024];
int ignorep;
int peer_has_leases = 0;
if (packet -> raw -> op != BOOTREQUEST)
return;
-@@ -73,7 +74,7 @@ void bootp (packet)
+@@ -74,7 +75,7 @@ void bootp (packet)
? inet_ntoa (packet -> raw -> giaddr)
: packet -> interface -> name);
log_info ("%s: network unknown", msgbuf);
return;
}
-@@ -390,6 +391,13 @@ void bootp (packet)
- from, &to, &hto);
+@@ -399,6 +400,15 @@ void bootp (packet)
+
goto out;
}
+ } else if (norelay == 2) {
+ to.sin_addr = raw.ciaddr;
+ to.sin_port = remote_port;
+ if (fallback_interface) {
-+ result = send_packet (fallback_interface, (struct packet *)0, &raw, outgoing.packet_length, from, &to, &hto);
++ result = send_packet (fallback_interface, NULL, &raw,
++ outgoing.packet_length, from,
++ &to, &hto);
+ goto out;
+ }
/* If it comes from a client that already knows its address
and is not requesting a broadcast response, and we can
-diff -up dhcp-4.2.0/server/dhcp.c.unicast dhcp-4.2.0/server/dhcp.c
---- dhcp-4.2.0/server/dhcp.c.unicast 2010-06-01 19:29:59.000000000 +0200
-+++ dhcp-4.2.0/server/dhcp.c 2010-07-21 13:40:25.000000000 +0200
-@@ -4185,6 +4185,7 @@ int locate_network (packet)
+diff -up dhcp-4.2.4b1/server/dhcp.c.unicast dhcp-4.2.4b1/server/dhcp.c
+--- dhcp-4.2.4b1/server/dhcp.c.unicast 2012-03-09 12:28:12.000000000 +0100
++++ dhcp-4.2.4b1/server/dhcp.c 2012-04-16 17:26:55.067418285 +0200
+@@ -4299,6 +4299,7 @@ int locate_network (packet)
struct data_string data;
struct subnet *subnet = (struct subnet *)0;
struct option_cache *oc;
/* See if there's a Relay Agent Link Selection Option, or a
* Subnet Selection Option. The Link-Select and Subnet-Select
-@@ -4200,12 +4201,24 @@ int locate_network (packet)
+@@ -4314,12 +4315,24 @@ int locate_network (packet)
from the interface, if there is one. If not, fail. */
if (!oc && !packet -> raw -> giaddr.s_addr) {
if (packet -> interface -> shared_network) {
}
/* If there's an option indicating link connection, and it's valid,
-@@ -4228,7 +4241,10 @@ int locate_network (packet)
+@@ -4342,7 +4355,10 @@ int locate_network (packet)
data_string_forget (&data, MDL);
} else {
ia.len = 4;
}
/* If we know the subnet on which the IP address lives, use it. */
-@@ -4236,7 +4252,10 @@ int locate_network (packet)
+@@ -4350,7 +4366,10 @@ int locate_network (packet)
shared_network_reference (&packet -> shared_network,
subnet -> shared_network, MDL);
subnet_dereference (&subnet, MDL);
[Unit]
Description=DHCPv4 Server Daemon
-After=syslog.target network.target
+After=network.target
[Service]
ExecStartPre=/usr/lib/network/helpers/dhcpd-config-helper create ipv4
-ExecStart=/usr/sbin/dhcpd -d -user dhcpd -group dhcpd --no-pid
+ExecStart=/usr/sbin/dhcpd -d -cf /etc/dhcp/dhcpd.conf -user dhcpd -group dhcpd --no-pid
[Install]
WantedBy=multi-user.target
[Unit]
Description=DHCPv6 Server Daemon
-After=syslog.target network.target
+After=network.target
[Service]
ExecStartPre=/usr/lib/network/helpers/dhcpd-config-helper create ipv6
-ExecStart=/usr/sbin/dhcpd -d -6 -user dhcpd -group dhcpd --no-pid
+ExecStart=/usr/sbin/dhcpd -d -6 -cf /etc/dhcp/dhcpd6.conf -user dhcpd -group dhcpd --no-pid
[Install]
WantedBy=multi-user.target