diff --git a/.cvsignore b/.cvsignore index 74c50f9..5e21cc6 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1,2 +1,3 @@ ldap-for-dhcp-4.1.1-2.tar.gz dhcp-4.1.1-P1.tar.gz +dhcp-4.2.0.tar.gz diff --git a/dhcp-4.1.1-64_bit_lease_parse.patch b/dhcp-4.1.1-64_bit_lease_parse.patch deleted file mode 100644 index 9bcb918..0000000 --- a/dhcp-4.1.1-64_bit_lease_parse.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff -up dhcp-4.1.1/common/parse.c.64-bit_lease_parse dhcp-4.1.1/common/parse.c ---- dhcp-4.1.1/common/parse.c.64-bit_lease_parse 2009-07-23 21:02:09.000000000 +0200 -+++ dhcp-4.1.1/common/parse.c 2010-01-20 17:38:10.000000000 +0100 -@@ -905,8 +905,8 @@ TIME - parse_date_core(cfile) - struct parse *cfile; - { -- int guess; -- int tzoff, wday, year, mon, mday, hour, min, sec; -+ TIME guess; -+ long int tzoff, wday, year, mon, mday, hour, min, sec; - const char *val; - enum dhcp_token token; - static int months [11] = { 31, 59, 90, 120, 151, 181, diff --git a/dhcp-4.1.1-CLOEXEC.patch b/dhcp-4.1.1-CLOEXEC.patch deleted file mode 100644 index f9dc598..0000000 --- a/dhcp-4.1.1-CLOEXEC.patch +++ /dev/null @@ -1,446 +0,0 @@ -diff -up dhcp-4.1.1/client/clparse.c.cloexec dhcp-4.1.1/client/clparse.c ---- dhcp-4.1.1/client/clparse.c.cloexec 2010-01-20 17:21:53.000000000 +0100 -+++ dhcp-4.1.1/client/clparse.c 2010-01-20 17:21:53.000000000 +0100 -@@ -226,7 +226,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; -@@ -263,7 +263,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.1.1/client/dhclient.c.cloexec dhcp-4.1.1/client/dhclient.c ---- dhcp-4.1.1/client/dhclient.c.cloexec 2010-01-20 17:21:53.000000000 +0100 -+++ dhcp-4.1.1/client/dhclient.c 2010-01-20 17:21:53.000000000 +0100 -@@ -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) -@@ -467,7 +467,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; - -@@ -509,7 +509,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; - -@@ -534,7 +534,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); -@@ -2910,7 +2910,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; -@@ -3014,7 +3014,7 @@ write_duid(struct data_string *duid) - return ISC_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; -@@ -3194,7 +3194,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; -@@ -3647,9 +3647,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 (); - -@@ -3661,14 +3661,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.1.1/common/bpf.c.cloexec dhcp-4.1.1/common/bpf.c ---- dhcp-4.1.1/common/bpf.c.cloexec 2010-01-20 17:21:53.000000000 +0100 -+++ dhcp-4.1.1/common/bpf.c 2010-01-20 17:21:53.000000000 +0100 -@@ -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.1.1/common/discover.c.cloexec dhcp-4.1.1/common/discover.c ---- dhcp-4.1.1/common/discover.c.cloexec 2009-09-29 21:44:49.000000000 +0200 -+++ dhcp-4.1.1/common/discover.c 2010-01-20 17:21:53.000000000 +0100 -@@ -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.1.1/common/dlpi.c.cloexec dhcp-4.1.1/common/dlpi.c ---- dhcp-4.1.1/common/dlpi.c.cloexec 2010-01-20 17:21:53.000000000 +0100 -+++ dhcp-4.1.1/common/dlpi.c 2010-01-20 17:21:53.000000000 +0100 -@@ -804,7 +804,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.1.1/common/nit.c.cloexec dhcp-4.1.1/common/nit.c ---- dhcp-4.1.1/common/nit.c.cloexec 2010-01-20 17:21:53.000000000 +0100 -+++ dhcp-4.1.1/common/nit.c 2010-01-20 17:21:53.000000000 +0100 -@@ -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.1.1/common/resolv.c.cloexec dhcp-4.1.1/common/resolv.c ---- dhcp-4.1.1/common/resolv.c.cloexec 2009-07-25 00:04:52.000000000 +0200 -+++ dhcp-4.1.1/common/resolv.c 2010-01-20 17:21:53.000000000 +0100 -@@ -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.1.1/common/upf.c.cloexec dhcp-4.1.1/common/upf.c ---- dhcp-4.1.1/common/upf.c.cloexec 2010-01-20 17:21:53.000000000 +0100 -+++ dhcp-4.1.1/common/upf.c 2010-01-20 17:21:53.000000000 +0100 -@@ -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.1.1/dst/dst_api.c.cloexec dhcp-4.1.1/dst/dst_api.c ---- dhcp-4.1.1/dst/dst_api.c.cloexec 2009-01-22 03:07:42.000000000 +0100 -+++ dhcp-4.1.1/dst/dst_api.c 2010-01-20 17:21:53.000000000 +0100 -@@ -436,7 +436,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", -@@ -493,7 +493,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); -@@ -619,7 +619,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); -@@ -853,7 +853,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.1.1/dst/prandom.c.cloexec dhcp-4.1.1/dst/prandom.c ---- dhcp-4.1.1/dst/prandom.c.cloexec 2007-11-30 22:51:43.000000000 +0100 -+++ dhcp-4.1.1/dst/prandom.c 2010-01-20 17:21:53.000000000 +0100 -@@ -267,7 +267,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); -@@ -478,7 +478,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.1.1/minires/res_init.c.cloexec dhcp-4.1.1/minires/res_init.c ---- dhcp-4.1.1/minires/res_init.c.cloexec 2009-07-25 00:04:52.000000000 +0200 -+++ dhcp-4.1.1/minires/res_init.c 2010-01-20 17:21:53.000000000 +0100 -@@ -233,7 +233,7 @@ minires_vinit(res_state statp, int prein - (line[sizeof(name) - 1] == ' ' || \ - line[sizeof(name) - 1] == '\t')) - -- if ((fp = fopen(_PATH_RESCONF, "r")) != NULL) { -+ if ((fp = fopen(_PATH_RESCONF, "re")) != NULL) { - /* read the config file */ - while (fgets(buf, sizeof(buf), fp) != NULL) { - /* skip comments */ -diff -up dhcp-4.1.1/minires/res_query.c.cloexec dhcp-4.1.1/minires/res_query.c ---- dhcp-4.1.1/minires/res_query.c.cloexec 2009-07-25 00:04:52.000000000 +0200 -+++ dhcp-4.1.1/minires/res_query.c 2010-01-20 17:21:53.000000000 +0100 -@@ -379,7 +379,7 @@ res_hostalias(const res_state statp, con - if (statp->options & RES_NOALIASES) - return (NULL); - file = getenv("HOSTALIASES"); -- if (file == NULL || (fp = fopen(file, "r")) == NULL) -+ if (file == NULL || (fp = fopen(file, "re")) == NULL) - return (NULL); - setbuf(fp, NULL); - buf[sizeof(buf) - 1] = '\0'; -diff -up dhcp-4.1.1/omapip/trace.c.cloexec dhcp-4.1.1/omapip/trace.c ---- dhcp-4.1.1/omapip/trace.c.cloexec 2009-07-25 00:04:52.000000000 +0200 -+++ dhcp-4.1.1/omapip/trace.c 2010-01-20 17:21:53.000000000 +0100 -@@ -140,10 +140,10 @@ isc_result_t trace_begin (const char *fi - return ISC_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, 0600); -+ traceoutfile = open (filename, O_WRONLY | O_EXCL | O_CLOEXEC, 0600); - } - - if (traceoutfile < 0) { -@@ -429,7 +429,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.1.1/relay/dhcrelay.c.cloexec dhcp-4.1.1/relay/dhcrelay.c ---- dhcp-4.1.1/relay/dhcrelay.c.cloexec 2010-01-07 22:48:02.000000000 +0100 -+++ dhcp-4.1.1/relay/dhcrelay.c 2010-01-20 17:21:53.000000000 +0100 -@@ -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) -@@ -514,12 +514,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.1.1/server/confpars.c.cloexec dhcp-4.1.1/server/confpars.c ---- dhcp-4.1.1/server/confpars.c.cloexec 2010-01-20 17:21:53.000000000 +0100 -+++ dhcp-4.1.1/server/confpars.c 2010-01-20 17:21:53.000000000 +0100 -@@ -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.1.1/server/db.c.cloexec dhcp-4.1.1/server/db.c ---- dhcp-4.1.1/server/db.c.cloexec 2009-07-25 00:04:52.000000000 +0200 -+++ dhcp-4.1.1/server/db.c 2010-01-20 17:21:53.000000000 +0100 -@@ -1021,7 +1021,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 (); -@@ -1069,12 +1069,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.1.1/server/dhcpd.c.cloexec dhcp-4.1.1/server/dhcpd.c ---- dhcp-4.1.1/server/dhcpd.c.cloexec 2010-01-20 17:21:53.000000000 +0100 -+++ dhcp-4.1.1/server/dhcpd.c 2010-01-20 17:21:53.000000000 +0100 -@@ -267,11 +267,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) -@@ -772,7 +772,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) { -@@ -790,7 +790,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); -@@ -816,9 +816,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.1.1/server/ldap.c.cloexec dhcp-4.1.1/server/ldap.c ---- dhcp-4.1.1/server/ldap.c.cloexec 2010-01-20 17:21:53.000000000 +0100 -+++ dhcp-4.1.1/server/ldap.c 2010-01-20 17:21:53.000000000 +0100 -@@ -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)); diff --git a/dhcp-4.1.1-IFNAMSIZ.patch b/dhcp-4.1.1-IFNAMSIZ.patch deleted file mode 100644 index e275ff9..0000000 --- a/dhcp-4.1.1-IFNAMSIZ.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up dhcp-4.1.1/server/dhcpd.c.ifnamsiz dhcp-4.1.1/server/dhcpd.c ---- dhcp-4.1.1/server/dhcpd.c.ifnamsiz 2010-01-20 17:26:44.000000000 +0100 -+++ dhcp-4.1.1/server/dhcpd.c 2010-01-20 17:26:44.000000000 +0100 -@@ -402,7 +402,7 @@ main(int argc, char **argv) { - log_fatal ("Insufficient memory to %s %s: %s", - "record interface", argv [i], - isc_result_totext (result)); -- strcpy (tmp -> name, argv [i]); -+ strncpy (tmp -> name, argv [i], sizeof (tmp -> name)); - if (interfaces) { - interface_reference (&tmp -> next, - interfaces, MDL); diff --git a/dhcp-4.1.1-P1-parse_date.patch b/dhcp-4.1.1-P1-parse_date.patch deleted file mode 100644 index 4fef7ae..0000000 --- a/dhcp-4.1.1-P1-parse_date.patch +++ /dev/null @@ -1,207 +0,0 @@ -diff -up dhcp-4.1.1-P1/common/parse.c.parse_date dhcp-4.1.1-P1/common/parse.c ---- dhcp-4.1.1-P1/common/parse.c.parse_date 2010-06-11 14:25:10.000000000 +0200 -+++ dhcp-4.1.1-P1/common/parse.c 2010-06-11 15:00:08.000000000 +0200 -@@ -913,48 +913,46 @@ parse_date_core(cfile) - 212, 243, 273, 304, 334 }; - - /* Day of week, or "never"... */ -- token = next_token (&val, (unsigned *)0, cfile); -+ token = peek_token (&val, (unsigned *)0, cfile); - if (token == NEVER) { -- if (!parse_semi (cfile)) -- return 0; -+ next_token (&val, (unsigned *)0, cfile); /* consume NEVER*/ - return MAX_TIME; - } - - /* This indicates 'local' time format. */ - if (token == EPOCH) { -- token = next_token(&val, NULL, cfile); -- -+ next_token(&val, (unsigned *)0, cfile); /* consume EPOCH */ -+ token = peek_token (&val, (unsigned *)0, cfile); - if (token != NUMBER) { - parse_warn(cfile, "Seconds since epoch expected."); - if (token != SEMI) -- skip_to_semi(cfile); -+ next_token(&val, (unsigned *)0, cfile); - return (TIME)0; - } -+ next_token(&val, (unsigned *)0, cfile); /* consume seconds */ - - guess = atoi(val); -- -- if (!parse_semi(cfile)) -- return (TIME)0; -- - return guess; - } - - if (token != NUMBER) { - parse_warn (cfile, "numeric day of week expected."); - if (token != SEMI) -- skip_to_semi (cfile); -+ next_token(&val, (unsigned *)0, cfile); - return (TIME)0; - } -+ next_token(&val, (unsigned *)0, cfile); /* consume day of week */ - wday = atoi (val); - - /* Year... */ -- token = next_token (&val, (unsigned *)0, cfile); -+ token = peek_token (&val, (unsigned *)0, cfile); - if (token != NUMBER) { - parse_warn (cfile, "numeric year expected."); - if (token != SEMI) -- skip_to_semi (cfile); -+ next_token(&val, (unsigned *)0, cfile); - return (TIME)0; - } -+ next_token(&val, (unsigned *)0, cfile); /* consume Year*/ - - /* Note: the following is not a Y2K bug - it's a Y1.9K bug. Until - somebody invents a time machine, I think we can safely disregard -@@ -965,101 +963,113 @@ parse_date_core(cfile) - year -= 1900; - - /* Slash separating year from month... */ -- token = next_token (&val, (unsigned *)0, cfile); -+ token = peek_token (&val, (unsigned *)0, cfile); - if (token != SLASH) { - parse_warn (cfile, - "expected slash separating year from month."); - if (token != SEMI) -- skip_to_semi (cfile); -+ next_token(&val, (unsigned *)0, cfile); - return (TIME)0; - } -+ token = next_token(&val, (unsigned *)0, cfile); /* consume SLASH */ - - /* Month... */ -- token = next_token (&val, (unsigned *)0, cfile); -+ token = peek_token (&val, (unsigned *)0, cfile); - if (token != NUMBER) { - parse_warn (cfile, "numeric month expected."); - if (token != SEMI) -- skip_to_semi (cfile); -+ next_token(&val, (unsigned *)0, cfile); - return (TIME)0; - } -+ next_token(&val, (unsigned *)0, cfile); /* consume Month */ - mon = atoi (val) - 1; - - /* Slash separating month from day... */ -- token = next_token (&val, (unsigned *)0, cfile); -+ token = peek_token (&val, (unsigned *)0, cfile); - if (token != SLASH) { - parse_warn (cfile, - "expected slash separating month from day."); - if (token != SEMI) -- skip_to_semi (cfile); -+ next_token(&val, (unsigned *)0, cfile); - return (TIME)0; - } -+ next_token(&val, (unsigned *)0, cfile); /* consume SLASH */ - - /* Day of month... */ -- token = next_token (&val, (unsigned *)0, cfile); -+ token = peek_token (&val, (unsigned *)0, cfile); - if (token != NUMBER) { - parse_warn (cfile, "numeric day of month expected."); - if (token != SEMI) -- skip_to_semi (cfile); -+ next_token(&val, (unsigned *)0, cfile); - return (TIME)0; - } -+ next_token(&val, (unsigned *)0, cfile); /* consume Day of month */ - mday = atoi (val); - - /* Hour... */ -- token = next_token (&val, (unsigned *)0, cfile); -+ token = peek_token (&val, (unsigned *)0, cfile); - if (token != NUMBER) { - parse_warn (cfile, "numeric hour expected."); - if (token != SEMI) -- skip_to_semi (cfile); -+ next_token(&val, (unsigned *)0, cfile); - return (TIME)0; - } -+ next_token(&val, (unsigned *)0, cfile); /* consume Hour */ - hour = atoi (val); - - /* Colon separating hour from minute... */ -- token = next_token (&val, (unsigned *)0, cfile); -+ token = peek_token (&val, (unsigned *)0, cfile); - if (token != COLON) { - parse_warn (cfile, - "expected colon separating hour from minute."); - if (token != SEMI) -- skip_to_semi (cfile); -+ next_token(&val, (unsigned *)0, cfile); - return (TIME)0; - } -+ next_token(&val, (unsigned *)0, cfile); /* consume Colon */ - - /* Minute... */ -- token = next_token (&val, (unsigned *)0, cfile); -+ token = peek_token (&val, (unsigned *)0, cfile); - if (token != NUMBER) { - parse_warn (cfile, "numeric minute expected."); - if (token != SEMI) -- skip_to_semi (cfile); -+ next_token(&val, (unsigned *)0, cfile); - return (TIME)0; - } -+ next_token(&val, (unsigned *)0, cfile); /* consume Minute */ - min = atoi (val); - - /* Colon separating minute from second... */ -- token = next_token (&val, (unsigned *)0, cfile); -+ token = peek_token (&val, (unsigned *)0, cfile); - if (token != COLON) { - parse_warn (cfile, - "expected colon separating minute from second."); - if (token != SEMI) -- skip_to_semi (cfile); -+ next_token(&val, (unsigned *)0, cfile); - return (TIME)0; - } -+ next_token(&val, (unsigned *)0, cfile); /* consume Colon */ - - /* Second... */ -- token = next_token (&val, (unsigned *)0, cfile); -+ token = peek_token (&val, (unsigned *)0, cfile); - if (token != NUMBER) { - parse_warn (cfile, "numeric second expected."); - if (token != SEMI) -- skip_to_semi (cfile); -+ next_token(&val, (unsigned *)0, cfile); - return (TIME)0; - } -+ next_token(&val, (unsigned *)0, cfile); /* consume Second */ - sec = atoi (val); - -+ tzoff = 0; - token = peek_token (&val, (unsigned *)0, cfile); - if (token == NUMBER) { -- token = next_token (&val, (unsigned *)0, cfile); -+ next_token (&val, (unsigned *)0, cfile); /* consume tzoff */ - tzoff = atoi (val); -- } else -- tzoff = 0; -+ } else if (token != SEMI) { -+ parse_warn (cfile, "Time zone offset or semicolon expected."); -+ next_token (&val, (unsigned *)0, cfile); -+ } - - /* Guess the time value... */ - guess = ((((((365 * (year - 70) + /* Days in years since '70 */ -@@ -1095,7 +1105,7 @@ parse_date(cfile) - - /* Make sure the date ends in a semicolon... */ - if (!parse_semi(cfile)) -- return 0; -+ return (TIME)0; - return guess; - } - diff --git a/dhcp-4.1.1-UseMulticast.patch b/dhcp-4.1.1-UseMulticast.patch deleted file mode 100644 index 1c1a1f1..0000000 --- a/dhcp-4.1.1-UseMulticast.patch +++ /dev/null @@ -1,229 +0,0 @@ -diff -up dhcp-4.1.1/server/dhcpv6.c.UseMulticast dhcp-4.1.1/server/dhcpv6.c ---- dhcp-4.1.1/server/dhcpv6.c.UseMulticast 2009-09-30 23:01:20.000000000 +0200 -+++ dhcp-4.1.1/server/dhcpv6.c 2010-03-15 12:29:32.000000000 +0100 -@@ -345,6 +345,48 @@ generate_new_server_duid(void) { - } - - /* -+ * Is the D6O_UNICAST option defined in dhcpd.conf ? -+ */ -+static isc_boolean_t unicast_option_defined; -+ -+/* -+ * Did we already search dhcpd.conf for D6O_UNICAST option ? -+ * We need to store it here to not parse dhcpd.conf repeatedly. -+ */ -+static isc_boolean_t unicast_option_parsed = ISC_FALSE; -+ -+ -+/* -+ * Is the D6O_UNICAST option defined in dhcpd.conf ? -+ */ -+isc_boolean_t -+is_unicast_option_defined(void) { -+ struct option_state *opt_state; -+ struct option_cache *oc; -+ -+ /* -+ * If we are looking for the unicast option for the first time -+ */ -+ if (unicast_option_parsed == ISC_FALSE) { -+ unicast_option_parsed = ISC_TRUE; -+ opt_state = NULL; -+ if (!option_state_allocate(&opt_state, MDL)) { -+ log_fatal("No memory for option state."); -+ } -+ -+ execute_statements_in_scope(NULL, NULL, NULL, NULL, NULL, -+ opt_state, &global_scope, root_group, NULL); -+ -+ oc = lookup_option(&dhcpv6_universe, opt_state, D6O_UNICAST); -+ unicast_option_defined = (oc != NULL); -+ -+ option_state_dereference(&opt_state, MDL); -+ } -+ -+ return (unicast_option_defined); -+} -+ -+/* - * Get the client identifier from the packet. - */ - isc_result_t -@@ -1398,6 +1440,56 @@ lease_to_client(struct data_string *repl - reply.shared->group); - } - -+ /* reject unicast message, unless we set unicast option */ -+ if ((packet->unicast == ISC_TRUE) && !is_unicast_option_defined()) -+ /* -+ * RFC3315 section 18.2.1 (Request): -+ * -+ * When the server receives a Request message via unicast from a client -+ * to which the server has not sent a unicast option, the server -+ * discards the Request message and responds with a Reply message -+ * containing a Status Code option with the value UseMulticast, a Server -+ * Identifier option containing the server's DUID, the Client Identifier -+ * option from the client message, and no other options. -+ * -+ * Section 18.2.3 (Renew): -+ * -+ * When the server receives a Renew message via unicast from a client to -+ * which the server has not sent a unicast option, the server discards -+ * the Renew message and responds with a Reply message containing a -+ * Status Code option with the value UseMulticast, a Server Identifier -+ * option containing the server's DUID, the Client Identifier option -+ * from the client message, and no other options. -+ */ -+ { -+ /* Set the UseMulticast status code. */ -+ if (!set_status_code(STATUS_UseMulticast, -+ "Unicast not allowed by server.", -+ reply.opt_state)) { -+ log_error("lease_to_client: Unable to set " -+ "UseMulticast status code."); -+ goto exit; -+ } -+ -+ /* Rewind the cursor to the start. */ -+ reply.cursor = REPLY_OPTIONS_INDEX; -+ -+ /* -+ * Produce an reply that includes only: -+ * -+ * Status code. -+ * Server DUID. -+ * Client DUID. -+ */ -+ 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 if (no_resources_avail && (reply.ia_count != 0) && -+ (reply.packet->dhcpv6_msg_type == DHCPV6_SOLICIT)) - /* - * RFC3315 section 17.2.2 (Solicit): - * -@@ -1422,8 +1514,6 @@ lease_to_client(struct data_string *repl - * the server. - * Sends a Renew/Rebind if the IA is not in the Reply message. - */ -- 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, -@@ -4097,7 +4187,6 @@ dhcpv6_solicit(struct data_string *reply - * Very similar to Solicit handling, except the server DUID is required. - */ - --/* TODO: reject unicast messages, unless we set unicast option */ - static void - dhcpv6_request(struct data_string *reply_ret, struct packet *packet) { - struct data_string client_id; -@@ -4412,7 +4501,6 @@ exit: - * except for the error code of when addresses don't match. - */ - --/* TODO: reject unicast messages, unless we set unicast option */ - static void - dhcpv6_renew(struct data_string *reply, struct packet *packet) { - struct data_string client_id; -@@ -4653,18 +4741,60 @@ iterate_over_ia_na(struct data_string *r - goto exit; - } - -- snprintf(status_msg, sizeof(status_msg), "%s received.", packet_type); -- if (!set_status_code(STATUS_Success, status_msg, opt_state)) { -- goto exit; -- } -+ /* reject unicast message, unless we set unicast option */ -+ if ((packet->unicast == ISC_TRUE) && !is_unicast_option_defined()) { -+ /* -+ * RFC3315 section 18.2.6 (Release): -+ * -+ * When the server receives a Release message via unicast from a client -+ * to which the server has not sent a unicast option, the server -+ * discards the Release message and responds with a Reply message -+ * containing a Status Code option with value UseMulticast, a Server -+ * Identifier option containing the server's DUID, the Client Identifier -+ * option from the client message, and no other options. -+ * -+ * Section 18.2.7 (Decline): -+ * -+ * When the server receives a Decline message via unicast from a client -+ * to which the server has not sent a unicast option, the server -+ * discards the Decline message and responds with a Reply message -+ * containing a Status Code option with the value UseMulticast, a Server -+ * Identifier option containing the server's DUID, the Client Identifier -+ * option from the client message, and no other options. -+ */ -+ snprintf(status_msg, sizeof(status_msg), -+ "%s received unicast.", packet_type); -+ if (!set_status_code(STATUS_UseMulticast, status_msg, opt_state)) { -+ goto exit; -+ } - -- /* -- * Add our options that are not associated with any IA_NA or IA_TA. -- */ -- reply_ofs += store_options6(reply_data+reply_ofs, -- sizeof(reply_data)-reply_ofs, -+ /* -+ * Produce an reply that includes only: -+ * -+ * Status code. -+ * Server DUID. -+ * Client DUID. -+ */ -+ reply_ofs += store_options6(reply_data+reply_ofs, -+ sizeof(reply_data)-reply_ofs, - opt_state, packet, -- required_opts, NULL); -+ required_opts_NAA, NULL); -+ -+ goto return_reply; -+ } else { -+ snprintf(status_msg, sizeof(status_msg), "%s received.", packet_type); -+ if (!set_status_code(STATUS_Success, status_msg, opt_state)) { -+ goto exit; -+ } -+ -+ /* -+ * Add our options that are not associated with any IA_NA or IA_TA. -+ */ -+ reply_ofs += store_options6(reply_data+reply_ofs, -+ sizeof(reply_data)-reply_ofs, -+ opt_state, packet, -+ required_opts, NULL); -+ } - - /* - * Loop through the IA_NA reported by the client, and deal with -@@ -4802,6 +4932,7 @@ iterate_over_ia_na(struct data_string *r - /* - * Return our reply to the caller. - */ -+return_reply: - reply_ret->len = reply_ofs; - reply_ret->buffer = NULL; - if (!buffer_allocate(&reply_ret->buffer, reply_ofs, MDL)) { -@@ -4847,7 +4978,6 @@ exit: - * we still need to be aware of this possibility. - */ - --/* TODO: reject unicast messages, unless we set unicast option */ - /* TODO: IA_TA */ - static void - dhcpv6_decline(struct data_string *reply, struct packet *packet) { -@@ -5314,7 +5444,6 @@ exit: - * Release means a client is done with the leases. - */ - --/* TODO: reject unicast messages, unless we set unicast option */ - static void - dhcpv6_release(struct data_string *reply, struct packet *packet) { - struct data_string client_id; diff --git a/dhcp-4.1.1-add_timeout_when_NULL.patch b/dhcp-4.1.1-add_timeout_when_NULL.patch deleted file mode 100644 index eb5ba8c..0000000 --- a/dhcp-4.1.1-add_timeout_when_NULL.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff -up dhcp-4.1.1/common/dispatch.c.dracut dhcp-4.1.1/common/dispatch.c ---- dhcp-4.1.1/common/dispatch.c.dracut 2009-07-25 00:04:52.000000000 +0200 -+++ dhcp-4.1.1/common/dispatch.c 2010-01-20 17:37:18.000000000 +0100 -@@ -104,6 +104,10 @@ void add_timeout (when, where, what, ref - { - struct timeout *t, *q; - -+ if (when == NULL) { -+ return; -+ } -+ - /* See if this timeout supersedes an existing timeout. */ - t = (struct timeout *)0; - for (q = timeouts; q; q = q -> next) { diff --git a/dhcp-4.1.1-capability.patch b/dhcp-4.1.1-capability.patch deleted file mode 100644 index 1a20736..0000000 --- a/dhcp-4.1.1-capability.patch +++ /dev/null @@ -1,177 +0,0 @@ -diff -up dhcp-4.1.1/client/dhclient.8.capability dhcp-4.1.1/client/dhclient.8 ---- dhcp-4.1.1/client/dhclient.8.capability 2010-02-03 11:19:39.854958099 -0500 -+++ dhcp-4.1.1/client/dhclient.8 2010-02-03 11:44:57.949895909 -0500 -@@ -105,6 +105,9 @@ relay - .B -n - ] - [ -+.B -nc -+] -+[ - .B -nw - ] - [ -@@ -381,6 +384,32 @@ Do not configure any interfaces. Most u - option. - - .TP -+.BI \-nc -+Do not drop capabilities. -+ -+Normally, if -+.B dhclient -+was compiled with libcap-ng support, -+.B dhclient -+drops most capabilities immediately upon startup. While more secure, -+this greatly restricts the additional actions that hooks in -+.B dhclient-script (8) -+can take. (For example, any daemons that -+.B dhclient-script (8) -+starts or restarts will inherit the restricted capabilities as well, -+which may interfere with their correct operation.) Thus, the -+.BI \-nc -+option can be used to prevent -+.B dhclient -+from dropping capabilities. -+ -+The -+.BI \-nc -+option is ignored if -+.B dhclient -+was not compiled with libcap-ng support. -+ -+.TP - .BI \-nw - Become a daemon process immediately (nowait) rather than waiting until an IP - address has been acquired. -diff -up dhcp-4.1.1/client/dhclient.c.capability dhcp-4.1.1/client/dhclient.c ---- dhcp-4.1.1/client/dhclient.c.capability 2010-02-03 11:19:39.876957973 -0500 -+++ dhcp-4.1.1/client/dhclient.c 2010-02-03 11:46:14.665957658 -0500 -@@ -37,6 +37,9 @@ - #include - #include - #include -+#ifdef HAVE_LIBCAP_NG -+#include -+#endif - - /* - * Defined in stdio.h when _GNU_SOURCE is set, but we don't want to define -@@ -89,6 +92,9 @@ int wanted_ia_ta = 0; - int wanted_ia_pd = 0; - char *mockup_relay = NULL; - int bootp_broadcast_always = 0; -+#ifdef HAVE_LIBCAP_NG -+static int keep_capabilities = 0; -+#endif - - extern u_int32_t default_requested_options[]; - -@@ -376,6 +382,10 @@ main(int argc, char **argv) { - } - - dhclient_request_options = argv[i]; -+ } else if (!strcmp(argv[i], "-nc")) { -+#ifdef HAVE_LIBCAP_NG -+ keep_capabilities = 1; -+#endif - } else if (argv[i][0] == '-') { - usage(); - } else if (interfaces_requested < 0) { -@@ -424,6 +434,19 @@ main(int argc, char **argv) { - path_dhclient_script = s; - } - -+#ifdef HAVE_LIBCAP_NG -+ /* Drop capabilities */ -+ if (!keep_capabilities) { -+ capng_clear(CAPNG_SELECT_CAPS); -+ capng_update(CAPNG_ADD, CAPNG_EFFECTIVE|CAPNG_PERMITTED, -+ CAP_DAC_OVERRIDE); // Drop this someday -+ capng_updatev(CAPNG_ADD, CAPNG_EFFECTIVE|CAPNG_PERMITTED, -+ CAP_NET_ADMIN, CAP_NET_RAW, -+ CAP_NET_BIND_SERVICE, CAP_SYS_ADMIN, -1); -+ capng_apply(CAPNG_SELECT_CAPS); -+ } -+#endif -+ - /* Set up the initial dhcp option universe. */ - initialize_common_option_spaces(); - -diff -up dhcp-4.1.1/client/dhclient-script.8.capability dhcp-4.1.1/client/dhclient-script.8 ---- dhcp-4.1.1/client/dhclient-script.8.capability 2010-05-28 15:47:36.000000000 +0200 -+++ dhcp-4.1.1/client/dhclient-script.8 2010-05-28 15:53:21.000000000 +0200 -@@ -239,6 +239,16 @@ repeatedly initialized to the values pro - the other. Assuming the information provided by both servers is - valid, this shouldn't cause any real problems, but it could be - confusing. -+.PP -+Normally, if dhclient was compiled with libcap-ng support, -+dhclient drops most capabilities immediately upon startup. -+While more secure, this greatly restricts the additional actions that -+hooks in dhclient-script can take. For example, any daemons that -+dhclient-script starts or restarts will inherit the restricted -+capabilities as well, which may interfere with their correct operation. -+Thus, the -+.BI \-nc -+option can be used to prevent dhclient from dropping capabilities. - .SH SEE ALSO - dhclient(8), dhcpd(8), dhcrelay(8), dhclient.conf(5) and - dhclient.leases(5). -diff -up dhcp-4.1.1/client/Makefile.am.capability dhcp-4.1.1/client/Makefile.am ---- dhcp-4.1.1/client/Makefile.am.capability 2008-11-18 17:33:22.000000000 -0500 -+++ dhcp-4.1.1/client/Makefile.am 2010-02-03 11:19:39.895958083 -0500 -@@ -5,7 +5,7 @@ dhclient_SOURCES = clparse.c dhclient.c - scripts/netbsd scripts/nextstep scripts/openbsd \ - scripts/solaris scripts/openwrt - dhclient_LDADD = ../common/libdhcp.a ../minires/libres.a \ -- ../omapip/libomapi.a ../dst/libdst.a -+ ../omapip/libomapi.a ../dst/libdst.a $(CAPNG_LDADD) - man_MANS = dhclient.8 dhclient-script.8 dhclient.conf.5 dhclient.leases.5 - EXTRA_DIST = $(man_MANS) - -diff -up dhcp-4.1.1/configure.ac.capability dhcp-4.1.1/configure.ac ---- dhcp-4.1.1/configure.ac.capability 2010-02-03 11:19:39.806895971 -0500 -+++ dhcp-4.1.1/configure.ac 2010-02-03 11:19:39.895958083 -0500 -@@ -419,6 +419,41 @@ AC_TRY_LINK( - # Look for optional headers. - AC_CHECK_HEADERS(sys/socket.h net/if_dl.h net/if6.h regex.h) - -+# look for capabilities library -+AC_ARG_WITH(libcap-ng, -+ [ --with-libcap-ng=[auto/yes/no] Add Libcap-ng support [default=auto]],, -+ with_libcap_ng=auto) -+ -+# Check for Libcap-ng API -+# -+# libcap-ng detection -+if test x$with_libcap_ng = xno ; then -+ have_libcap_ng=no; -+else -+ # Start by checking for header file -+ AC_CHECK_HEADER(cap-ng.h, capng_headers=yes, capng_headers=no) -+ -+ # See if we have libcap-ng library -+ AC_CHECK_LIB(cap-ng, capng_clear, -+ CAPNG_LDADD=-lcap-ng,) -+ -+ # Check results are usable -+ if test x$with_libcap_ng = xyes -a x$CAPNG_LDADD = x ; then -+ AC_MSG_ERROR(libcap-ng support was requested and the library was not found) -+ fi -+ if test x$CAPNG_LDADD != x -a $capng_headers = no ; then -+ AC_MSG_ERROR(libcap-ng libraries found but headers are missing) -+ fi -+fi -+AC_SUBST(CAPNG_LDADD) -+AC_MSG_CHECKING(whether to use libcap-ng) -+if test x$CAPNG_LDADD != x ; then -+ AC_DEFINE(HAVE_LIBCAP_NG,1,[libcap-ng support]) -+ AC_MSG_RESULT(yes) -+else -+ AC_MSG_RESULT(no) -+fi -+ - # find an MD5 library - AC_SEARCH_LIBS(MD5_Init, [crypto]) - AC_SEARCH_LIBS(MD5Init, [crypto]) diff --git a/dhcp-4.1.1-default-requested-options.patch b/dhcp-4.1.1-default-requested-options.patch deleted file mode 100644 index f05bcdd..0000000 --- a/dhcp-4.1.1-default-requested-options.patch +++ /dev/null @@ -1,44 +0,0 @@ -diff -up dhcp-4.1.1/client/clparse.c.requested dhcp-4.1.1/client/clparse.c ---- dhcp-4.1.1/client/clparse.c.requested 2010-04-28 15:20:43.000000000 +0200 -+++ dhcp-4.1.1/client/clparse.c 2010-04-28 15:21:49.000000000 +0200 -@@ -37,7 +37,7 @@ - - struct client_config top_level_config; - --#define NUM_DEFAULT_REQUESTED_OPTS 9 -+#define NUM_DEFAULT_REQUESTED_OPTS 14 - struct option *default_requested_options[NUM_DEFAULT_REQUESTED_OPTS + 1]; - - static void parse_client_default_duid(struct parse *cfile); -@@ -111,6 +111,31 @@ isc_result_t read_client_conf () - option_code_hash_lookup(&default_requested_options[8], - dhcpv6_universe.code_hash, &code, 0, MDL); - -+ /* 10 */ -+ code = DHO_NIS_DOMAIN; -+ option_code_hash_lookup(&default_requested_options[9], -+ dhcp_universe.code_hash, &code, 0, MDL); -+ -+ /* 11 */ -+ code = DHO_NIS_SERVERS; -+ option_code_hash_lookup(&default_requested_options[10], -+ dhcp_universe.code_hash, &code, 0, MDL); -+ -+ /* 12 */ -+ code = DHO_NTP_SERVERS; -+ option_code_hash_lookup(&default_requested_options[11], -+ dhcp_universe.code_hash, &code, 0, MDL); -+ -+ /* 13 */ -+ code = DHO_INTERFACE_MTU; -+ option_code_hash_lookup(&default_requested_options[12], -+ dhcp_universe.code_hash, &code, 0, MDL); -+ -+ /* 14 */ -+ code = DHO_DOMAIN_SEARCH; -+ 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 --git a/dhcp-4.1.1-dhclient-anycast.patch b/dhcp-4.1.1-dhclient-anycast.patch deleted file mode 100644 index bd2ee4f..0000000 --- a/dhcp-4.1.1-dhclient-anycast.patch +++ /dev/null @@ -1,70 +0,0 @@ -diff -up dhcp-4.1.1/client/clparse.c.anycast dhcp-4.1.1/client/clparse.c ---- dhcp-4.1.1/client/clparse.c.anycast 2010-01-20 17:19:37.000000000 +0100 -+++ dhcp-4.1.1/client/clparse.c 2010-01-20 17:19:37.000000000 +0100 -@@ -571,6 +571,17 @@ void parse_client_statement (cfile, ip, - } - return; - -+ case ANYCAST_MAC: -+ token = next_token (&val, (unsigned *)0, cfile); -+ if (ip) { -+ parse_hardware_param (cfile, &ip -> anycast_mac_addr); -+ } else { -+ parse_warn (cfile, "anycast mac address parameter %s", -+ "not allowed here."); -+ skip_to_semi (cfile); -+ } -+ return; -+ - case REQUEST: - token = next_token (&val, (unsigned *)0, cfile); - if (config -> requested_options == default_requested_options) -diff -up dhcp-4.1.1/common/conflex.c.anycast dhcp-4.1.1/common/conflex.c ---- dhcp-4.1.1/common/conflex.c.anycast 2010-01-20 17:19:37.000000000 +0100 -+++ dhcp-4.1.1/common/conflex.c 2010-01-20 17:19:37.000000000 +0100 -@@ -729,6 +729,8 @@ intern(char *atom, enum dhcp_token dfv) - } - if (!strcasecmp (atom + 1, "nd")) - return AND; -+ if (!strcasecmp (atom + 1, "nycast-mac")) -+ return ANYCAST_MAC; - if (!strcasecmp (atom + 1, "ppend")) - return APPEND; - if (!strcasecmp (atom + 1, "llow")) -diff -up dhcp-4.1.1/common/lpf.c.anycast dhcp-4.1.1/common/lpf.c ---- dhcp-4.1.1/common/lpf.c.anycast 2010-01-20 17:19:37.000000000 +0100 -+++ dhcp-4.1.1/common/lpf.c 2010-01-20 17:19:37.000000000 +0100 -@@ -334,6 +334,9 @@ 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; -+ - /* Assemble the headers... */ - assemble_hw_header (interface, (unsigned char *)hh, &hbufp, hto); - fudge = hbufp % 4; /* IP header must be word-aligned. */ -diff -up dhcp-4.1.1/includes/dhcpd.h.anycast dhcp-4.1.1/includes/dhcpd.h ---- dhcp-4.1.1/includes/dhcpd.h.anycast 2010-01-20 17:19:37.000000000 +0100 -+++ dhcp-4.1.1/includes/dhcpd.h 2010-01-20 17:19:37.000000000 +0100 -@@ -1217,6 +1217,7 @@ struct interface_info { - int dlpi_sap_length; - struct hardware dlpi_broadcast_addr; - # endif /* DLPI_SEND || DLPI_RECEIVE */ -+ struct hardware anycast_mac_addr; - }; - - struct hardware_link { -diff -up dhcp-4.1.1/includes/dhctoken.h.anycast dhcp-4.1.1/includes/dhctoken.h ---- dhcp-4.1.1/includes/dhctoken.h.anycast 2010-01-20 17:19:37.000000000 +0100 -+++ dhcp-4.1.1/includes/dhctoken.h 2010-01-20 17:19:37.000000000 +0100 -@@ -354,7 +354,8 @@ enum dhcp_token { - PREFIX6 = 657, - FIXED_PREFIX6 = 658, - BOOTP_BROADCAST_ALWAYS = 659, -- CONFLICT_DONE = 660 -+ CONFLICT_DONE = 660, -+ ANYCAST_MAC = 661 - }; - - #define is_identifier(x) ((x) >= FIRST_TOKEN && \ diff --git a/dhcp-4.1.1-dhclient-decline-backoff.patch b/dhcp-4.1.1-dhclient-decline-backoff.patch deleted file mode 100644 index 3b8789f..0000000 --- a/dhcp-4.1.1-dhclient-decline-backoff.patch +++ /dev/null @@ -1,63 +0,0 @@ -diff -up dhcp-4.1.1/client/dhclient.c.backoff dhcp-4.1.1/client/dhclient.c ---- dhcp-4.1.1/client/dhclient.c.backoff 2010-02-08 16:41:52.000000000 +0100 -+++ dhcp-4.1.1/client/dhclient.c 2010-02-08 16:43:56.000000000 +0100 -@@ -1187,6 +1187,8 @@ void state_init (cpp) - void *cpp; - { - struct client_state *client = cpp; -+ enum dhcp_state init_state = client->state; -+ struct timeval tv; - - ASSERT_STATE(state, S_INIT); - -@@ -1199,9 +1201,18 @@ void state_init (cpp) - client -> first_sending = cur_time; - client -> interval = client -> config -> initial_interval; - -- /* Add an immediate timeout to cause the first DHCPDISCOVER packet -- to go out. */ -- send_discover (client); -+ if (init_state != S_DECLINED) { -+ /* Add an immediate timeout to cause the first DHCPDISCOVER packet -+ to go out. */ -+ send_discover(client); -+ } else { -+ /* We've received an OFFER and it has been DECLINEd by dhclient-script. -+ * wait for a random time between 1 and backoff_cutoff seconds before -+ * trying again. */ -+ tv . tv_sec = cur_time + ((1 + (random() >> 2)) % client->config->backoff_cutoff); -+ tv . tv_usec = 0; -+ add_timeout(&tv, send_discover, client, 0, 0); -+ } - } - - /* -@@ -1480,6 +1491,7 @@ void bind_lease (client) - send_decline (client); - destroy_client_lease (client -> new); - client -> new = (struct client_lease *)0; -+ client -> state = S_DECLINED; - state_init (client); - return; - } -@@ -3689,6 +3701,7 @@ void client_location_changed () - case S_INIT: - case S_REBINDING: - case S_STOPPED: -+ case S_DECLINED: - break; - } - client -> state = S_INIT; -diff -up dhcp-4.1.1/includes/dhcpd.h.backoff dhcp-4.1.1/includes/dhcpd.h ---- dhcp-4.1.1/includes/dhcpd.h.backoff 2010-02-08 16:41:52.000000000 +0100 -+++ dhcp-4.1.1/includes/dhcpd.h 2010-02-08 16:41:52.000000000 +0100 -@@ -1017,7 +1017,8 @@ enum dhcp_state { - S_BOUND = 5, - S_RENEWING = 6, - S_REBINDING = 7, -- S_STOPPED = 8 -+ S_STOPPED = 8, -+ S_DECLINED = 9 - }; - - /* Authentication and BOOTP policy possibilities (not all values work diff --git a/dhcp-4.1.1-dhclient-usage.patch b/dhcp-4.1.1-dhclient-usage.patch deleted file mode 100644 index 78d5cfa..0000000 --- a/dhcp-4.1.1-dhclient-usage.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff -up dhcp-4.1.1/client/dhclient.c.usage dhcp-4.1.1/client/dhclient.c ---- dhcp-4.1.1/client/dhclient.c.usage 2010-01-20 17:17:18.000000000 +0100 -+++ dhcp-4.1.1/client/dhclient.c 2010-01-20 17:17:18.000000000 +0100 -@@ -992,6 +992,10 @@ static void usage() - "[-s server]"); - log_error(" [-cf config-file] [-lf lease-file]%s", - "[-pf pid-file] [-e VAR=val]"); -+ log_error(" [-I ] [-B]"); -+ log_error(" [-H | -F ] [-timeout ]"); -+ log_error(" [-V ]"); -+ log_error(" [-R ]"); - log_fatal(" [-sf script-file] [interface]"); - } - diff --git a/dhcp-4.1.1-errwarn-message.patch b/dhcp-4.1.1-errwarn-message.patch deleted file mode 100644 index 52908e2..0000000 --- a/dhcp-4.1.1-errwarn-message.patch +++ /dev/null @@ -1,30 +0,0 @@ -diff -up dhcp-4.1.1/omapip/errwarn.c.errwarn dhcp-4.1.1/omapip/errwarn.c ---- dhcp-4.1.1/omapip/errwarn.c.errwarn 2009-07-23 21:02:10.000000000 +0200 -+++ dhcp-4.1.1/omapip/errwarn.c 2010-01-20 17:08:13.000000000 +0100 -@@ -76,20 +76,13 @@ void log_fatal (const char * fmt, ... ) - - #if !defined (NOMINUM) - log_error ("%s", ""); -- log_error ("If you did not get this software from ftp.isc.org, please"); -- log_error ("get the latest from ftp.isc.org and install that before"); -- log_error ("requesting help."); -+ log_error ("This version of ISC DHCP is based on the release available"); -+ log_error ("on ftp.isc.org. Features have been added and other changes"); -+ log_error ("have been made to the base software release in order to make"); -+ log_error ("it work better with this distribution."); - log_error ("%s", ""); -- log_error ("If you did get this software from ftp.isc.org and have not"); -- log_error ("yet read the README, please read it before requesting help."); -- log_error ("If you intend to request help from the dhcp-server@isc.org"); -- log_error ("mailing list, please read the section on the README about"); -- log_error ("submitting bug reports and requests for help."); -- log_error ("%s", ""); -- log_error ("Please do not under any circumstances send requests for"); -- log_error ("help directly to the authors of this software - please"); -- log_error ("send them to the appropriate mailing list as described in"); -- log_error ("the README file."); -+ log_error ("Please report for this software via the Red Hat Bugzilla site:"); -+ log_error (" http://bugzilla.redhat.com"); - log_error ("%s", ""); - log_error ("exiting."); - #endif diff --git a/dhcp-4.1.1-failover-ports.patch b/dhcp-4.1.1-failover-ports.patch deleted file mode 100644 index 2b16167..0000000 --- a/dhcp-4.1.1-failover-ports.patch +++ /dev/null @@ -1,23 +0,0 @@ -diff -up dhcp-4.1.1/server/confpars.c.failover-ports dhcp-4.1.1/server/confpars.c ---- dhcp-4.1.1/server/confpars.c.failover-ports 2010-01-20 17:16:18.000000000 +0100 -+++ dhcp-4.1.1/server/confpars.c 2010-01-20 17:16:18.000000000 +0100 -@@ -1156,10 +1156,17 @@ void parse_failover_peer (cfile, group, - parse_warn (cfile, "peer address may not be omitted"); - - /* XXX - when/if we get a port number assigned, just set as default */ -+ /* See Red Hat Bugzilla 167292: -+ * we do now: dhcp-failover 647/tcp -+ * dhcp-failover 647/udp -+ * dhcp-failover 847/tcp -+ * dhcp-failover 847/udp -+ * IANA registration by Bernard Volz -+ */ - if (!peer -> me.port) -- parse_warn (cfile, "local port may not be omitted"); -+ peer -> me.port = 647; - if (!peer -> partner.port) -- parse_warn (cfile, "peer port may not be omitted"); -+ peer -> partner.port = 847; - - if (peer -> i_am == primary) { - if (!peer -> hba) { diff --git a/dhcp-4.1.1-garbage-chars.patch b/dhcp-4.1.1-garbage-chars.patch deleted file mode 100644 index 8cfb7dd..0000000 --- a/dhcp-4.1.1-garbage-chars.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up dhcp-4.1.1/common/tables.c.garbage dhcp-4.1.1/common/tables.c ---- dhcp-4.1.1/common/tables.c.garbage 2009-07-25 00:04:52.000000000 +0200 -+++ dhcp-4.1.1/common/tables.c 2010-01-20 17:23:10.000000000 +0100 -@@ -207,7 +207,7 @@ static struct option dhcp_options[] = { - { "netinfo-server-tag", "t", &dhcp_universe, 113, 1 }, - { "default-url", "t", &dhcp_universe, 114, 1 }, - { "subnet-selection", "I", &dhcp_universe, 118, 1 }, -- { "domain-search", "Dc", &dhcp_universe, 119, 1 }, -+ { "domain-search", "D", &dhcp_universe, 119, 1 }, - { "vivco", "Evendor-class.", &dhcp_universe, 124, 1 }, - { "vivso", "Evendor.", &dhcp_universe, 125, 1 }, - #if 0 diff --git a/dhcp-4.1.1-inherit-leases.patch b/dhcp-4.1.1-inherit-leases.patch deleted file mode 100644 index fbc9ff7..0000000 --- a/dhcp-4.1.1-inherit-leases.patch +++ /dev/null @@ -1,34 +0,0 @@ -diff -up dhcp-4.1.1/client/dhclient.c.inherit dhcp-4.1.1/client/dhclient.c ---- dhcp-4.1.1/client/dhclient.c.inherit 2010-01-20 17:22:34.000000000 +0100 -+++ dhcp-4.1.1/client/dhclient.c 2010-01-20 17:22:34.000000000 +0100 -@@ -2301,6 +2301,7 @@ void send_request (cpp) - { - struct client_state *client = cpp; - -+ int i; - int result; - int interval; - struct sockaddr_in destination; -@@ -2360,6 +2361,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); diff --git a/dhcp-4.1.1-initialization-delay.patch b/dhcp-4.1.1-initialization-delay.patch deleted file mode 100644 index e8abb0e..0000000 --- a/dhcp-4.1.1-initialization-delay.patch +++ /dev/null @@ -1,45 +0,0 @@ -diff -up dhcp-4.1.1/client/dhclient.c.initialization-delay dhcp-4.1.1/client/dhclient.c ---- dhcp-4.1.1/client/dhclient.c.initialization-delay 2010-05-03 15:16:43.000000000 +0200 -+++ dhcp-4.1.1/client/dhclient.c 2010-05-03 15:23:05.000000000 +0200 -@@ -927,11 +927,16 @@ main(int argc, char **argv) { - do_release(client); - else { - client->state = S_INIT; -- /* Set up a timeout to start the -- * initialization process. -+ /* Set up a timeout (0-1 second) to -+ * start the initialization process. - */ -- tv.tv_sec = cur_time + random() % 5; -- tv.tv_usec = 0; -+ tv.tv_sec = cur_tv.tv_sec; -+ tv.tv_usec = cur_tv.tv_usec; -+ tv.tv_usec += (random() % 100) * 10000; -+ if (tv.tv_usec >= 1000000) { -+ tv.tv_sec += 1; -+ tv.tv_usec -= 1000000; -+ } - add_timeout(&tv, state_reboot, - client, 0, 0); - } -@@ -3911,10 +3916,16 @@ isc_result_t dhclient_interface_startup_ - ip -> flags |= INTERFACE_RUNNING; - for (client = ip -> client; client; client = client -> next) { - client -> state = S_INIT; -- /* Set up a timeout to start the initialization -- process. */ -- tv . tv_sec = cur_time + random () % 5; -- tv . tv_usec = 0; -+ /* Set up a timeout (0-1 second) to -+ * start the initialization process. -+ */ -+ tv.tv_sec = cur_tv.tv_sec; -+ tv.tv_usec = cur_tv.tv_usec; -+ tv.tv_usec += (random() % 100) * 10000; -+ if (tv.tv_usec >= 1000000) { -+ tv.tv_sec += 1; -+ tv.tv_usec -= 1000000; -+ } - add_timeout (&tv, state_reboot, client, 0, 0); - } - } diff --git a/dhcp-4.1.1-invalid-dhclient-conf.patch b/dhcp-4.1.1-invalid-dhclient-conf.patch deleted file mode 100644 index 579d7f0..0000000 --- a/dhcp-4.1.1-invalid-dhclient-conf.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff -up dhcp-4.1.1/client/dhclient.conf.supersede dhcp-4.1.1/client/dhclient.conf ---- dhcp-4.1.1/client/dhclient.conf.supersede 1997-06-03 00:50:44.000000000 +0200 -+++ dhcp-4.1.1/client/dhclient.conf 2010-01-20 17:24:00.000000000 +0100 -@@ -1,10 +1,10 @@ - send host-name "andare.fugue.com"; - send dhcp-client-identifier 1:0:a0:24:ab:fb:9c; - send dhcp-lease-time 3600; --supersede domain-name "fugue.com home.vix.com"; -+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, domain-name-servers, host-name; - require subnet-mask, domain-name-servers; - timeout 60; - retry 60; diff --git a/dhcp-4.1.1-logpid.patch b/dhcp-4.1.1-logpid.patch deleted file mode 100644 index f7002a7..0000000 --- a/dhcp-4.1.1-logpid.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up dhcp-4.1.1/client/dhclient.c.logpid dhcp-4.1.1/client/dhclient.c ---- dhcp-4.1.1/client/dhclient.c.logpid 2010-01-20 17:39:50.000000000 +0100 -+++ dhcp-4.1.1/client/dhclient.c 2010-01-20 17:39:50.000000000 +0100 -@@ -150,7 +150,7 @@ main(int argc, char **argv) { - else if (fd != -1) - close(fd); - -- openlog("dhclient", LOG_NDELAY, LOG_DAEMON); -+ openlog("dhclient", LOG_NDELAY | LOG_PID, LOG_DAEMON); - - #if !(defined(DEBUG) || defined(__CYGWIN32__)) - setlogmask(LOG_UPTO(LOG_INFO)); diff --git a/dhcp-4.1.1-manpages.patch b/dhcp-4.1.1-manpages.patch deleted file mode 100644 index f19e669..0000000 --- a/dhcp-4.1.1-manpages.patch +++ /dev/null @@ -1,676 +0,0 @@ -diff -up dhcp-4.1.1/client/dhclient.8.man dhcp-4.1.1/client/dhclient.8 ---- dhcp-4.1.1/client/dhclient.8.man 2009-07-25 00:04:51.000000000 +0200 -+++ dhcp-4.1.1/client/dhclient.8 2010-02-25 17:41:36.000000000 +0100 -@@ -111,6 +111,33 @@ relay - .B -w - ] - [ -+.B -B -+] -+[ -+.B -I -+.I dhcp-client-identifier -+] -+[ -+.B -H -+.I host-name -+] -+[ -+.B -F -+.I fqdn.fqdn -+] -+[ -+.B -V -+.I vendor-class-identifier -+] -+[ -+.B -R -+.I request-option-list -+] -+[ -+.B -timeout -+.I timeout -+] -+[ - .B -v - ] - [ -@@ -138,32 +165,6 @@ important details about the network to w - the location of a default router, the location of a name server, and - so on. - .PP --If given the -4 command line argument (default), dhclient will use the --DHCPv4 protocol to obtain an IPv4 address and configuration parameters. --.PP --If given the -6 command line argument, dhclient will use the DHCPv6 --protocol to obtain whatever IPv6 addresses are available along with --configuration parameters. But with --.B -S --it uses Information-request to get only (i.e., without address) --stateless configuration parameters. --.PP --The default DHCPv6 behavior is modified too with --.B -T --which asks for IPv6 temporary addresses, one set per --.B -T --flag. --.B -P --enables the IPv6 prefix delegation. --As temporary addresses or prefix delegation disables the normal --address query, --.B -N --restores it. Note it is not recommended to mix queries of different types --together, or even to share the lease file between them. --.PP --If given the --version command line argument, dhclient will print its --version number and exit. --.PP - On startup, dhclient reads the - .IR dhclient.conf - for configuration instructions. It then gets a list of all the -@@ -217,141 +218,259 @@ file. If interfaces are specified in t - only configure interfaces that are either specified in the - configuration file or on the command line, and will ignore all other - interfaces. --.PP --If the DHCP client should listen and transmit on a port other than the --standard (port 68), the --.B -p --flag may used. It should be followed by the udp port number that --dhclient should use. This is mostly useful for debugging purposes. --If a different port is specified for the client to listen on and --transmit on, the client will also use a different destination port - --one less than the specified port. --.PP --The DHCP client normally transmits any protocol messages it sends --before acquiring an IP address to, 255.255.255.255, the IP limited --broadcast address. For debugging purposes, it may be useful to have --the server transmit these messages to some other address. This can --be specified with the --.B -s --flag, followed by the IP address or domain name of the destination. --This feature is not supported by DHCPv6. --.PP --For testing purposes, the giaddr field of all packets that the client --sends can be set using the --.B -g --flag, followed by the IP address to send. This is only useful for testing, --and should not be expected to work in any consistent or useful way. --.PP --The DHCP client will normally run in the foreground until it has --configured an interface, and then will revert to running in the --background. To run force dhclient to always run as a foreground --process, the --.B -d --flag should be specified. This is useful when running the client --under a debugger, or when running it out of inittab on System V --systems. --.PP --The dhclient daemon creates its own environment when executing the --dhclient-script to do the grunt work of interface configuration. --To define extra environment variables and their values, use the --.B -e --flag, followed by the environment variable name and value assignment, --just as one would assign a variable in a shell. Eg: --.B -e --.I IF_METRIC=1 --.PP --The client normally prints no output during its startup sequence. It --can be made to emit verbose messages displaying the startup sequence events --until it has acquired an address by supplying the --.B -v --command line argument. In either case, the client logs messages using --the --.B syslog (3) --facility. A --.B -q --command line argument is provided for backwards compatibility, but since --dhclient is quiet by default, it has no effect. --.PP --The client normally doesn't release the current lease as it is not --required by the DHCP protocol. Some cable ISPs require their clients --to notify the server if they wish to release an assigned IP address. --The --.B -r --flag explicitly releases the current lease, and once the lease has been --released, the client exits. --.PP -+.SH OPTIONS -+.TP -+.BI \-4 -+Use the DHCPv4 protocol to obtain an IPv4 address and configuration -+parameters (default). -+ -+.TP -+.BI \-6 -+Use the DHCPv6 protocol to obtain whatever IPv6 addresses are available -+along with configuration parameters. The functionality of DHCPv6 mode -+may be modified with the -+.BI \-S -+, -+.BI \-T -+, and -+.BI \-N -+options. -+ -+.TP -+.BI \-S -+Perform an information-only request over DHCPv6 to get stateless -+configuration parameters. It is not recommended to combine this option -+with the -+.BI \-N -+, -+.BI \-P -+, or -+.BI \-T -+options or to share lease files between different modes of operation. Only -+valid with the -+.BI \-6 -+option. -+ -+.TP -+.BI \-N -+Perform a normal (IA_NA) address query over DHCPv6. It is not recommended -+to combine this option with the -+.BI \-P -+, -+.BI \-S -+, or -+.BI \-T -+options or to share lease files between different modes of operation. Only -+valid with the -+.BI \-6 -+option. -+ -+.TP -+.BI \-T -+Perform a temporary (IA_TA) address query over DHCPv6 (disables normal address -+query). It is not recommended to combine this option with the -+.BI \-N -+, -+.BI \-P -+, or -+.BI \-S -+options or to share lease files between different modes of operation. Only -+valid with the -+.BI \-6 -+option. -+ -+.TP -+.BI \-P -+Enable IPv6 prefix delegation (disables normal address query). It is not -+not recommended to combine this option with the -+.BI \-N -+, -+.BI \-S -+, or -+.BI \-T -+options or to share lease files between different modes of operation. Only -+valid with the -+.BI \-6 -+option. -+ -+.TP -+.BI \-p\ -+The UDP port number the DHCP client should listen and transmit on. If -+unspecified, -+.B dhclient -+uses the default port 68. This option is mostly useful for debugging -+purposes. If a different port is specified for the client to listen and -+transmit on, the client will also use a different destination port - one -+less than the specified port. -+ -+.TP -+.BI \-d -+Force -+.B dhclient -+to run as a foreground process. This is useful when running the client -+under a debugger, or when running it out of inittab on System V systems. -+ -+.TP -+.BI \-e\ VAR=value -+Define additional environment variables for the environment where -+dhclient-script executes. You may specify multiplate -+.B \-e -+options on the command line. For example: -+.B \-e IF_METRIC=1 -+ -+.TP -+.BI \-q -+Suppress all terminal and log output except error messages. -+ -+.TP -+.BI \-1 -+Try once to get a lease. One failure, exit with code 2. -+ -+.TP -+.BI \-r -+Tell -+.B dhclient -+to release the current lease it has from the server. This is not required -+by the DHCP protocol, but some ISPs require their clients to notify the -+server if they wish to release an assigned IP address. -+ -+.TP -+.BI \-lf\ -+Path to the lease database file. If unspecified, the default -+.B DBDIR/dhclient.leases -+is used. -+ -+.TP -+.BI \-pf\ -+Path to the process ID file. If unspecified, the default -+.B RUNDIR/dhclient.pid -+is used. -+ -+.TP -+.BI \-cf\ -+Path to the client configuration file. If unspecified, the default -+.B ETCDIR/dhclient.conf -+is used. -+ -+.TP -+.BI \-sf\ -+Path to the network configuration script invoked by -+.B dhclient -+when it gets a lease. If unspecified, the default -+.B CLIENTBINDIR/dhclient-script -+is used. -+ -+.TP -+.BI \-s\ -+Specifiy the server IP address or fully qualified domain name to transmit -+DHCP protocol messages to. Normally, -+.B dhclient -+transmits these messages to 255.255.255.255 (the IP limited broadcast -+address). Overriding this is mostly useful for debugging purposes. -+ -+.TP -+.BI \-g\ -+Only for debugging. Set the giaddr field of all packets the client -+sends to the IP address specified. This should not be expected to work -+in any consistent or useful way. -+ -+.TP -+.BI \-n -+Do not configure any interfaces. Most useful combined with the -+.B -w -+option. -+ -+.TP -+.BI \-nw -+Become a daemon process immediately (nowait) rather than waiting until an IP -+address has been acquired. -+ -+.TP -+.BI \-w -+Keep running even if no network interfaces are found. The -+.B omshell -+program can be used to notify the client when a network interface has been -+added or removed so it can attempt to configure an IP address on that -+interface. -+ -+.TP -+.BI \-B -+Set the BOOTP broadcast flag in request packets so servers will always -+broadcast replies. -+ -+.TP -+.BI \-I\ -+Specify the dhcp-client-identifier option to send to the DHCP server. -+ -+.TP -+.BI \-H\ -+Specify the host-name option to send to the DHCP server. The host-name -+string only contains the client's hostname prefix, to which the server will -+append the ddns-domainname or domain-name options, if any, to derive the -+fully qualified domain name of the client. The -+.B -H -+option cannot be used with the -+.B -F -+option. -+ -+.TP -+.BI \-F\ -+Specify the fqdn.fqdn option to send to the DHCP server. This option cannot -+be used with the -+.B -H -+option. The fqdn.fqdn option must specify the complete domain name of the -+client host, which the server may use for dynamic DNS updates. -+ -+.TP -+.BI \-V\ -+Specify the vendor-class-identifier option to send to the DHCP server. -+ -+.TP -+.BI \-R\