diff --git a/.gitignore b/.gitignore index 75ca1bb..3992c1a 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -/dhcp-4.2.0-P2.tar.gz +/dhcp-4.2.1b1.tar.gz diff --git a/dhcp-4.2.0-P1-64_bit_lease_parse.patch b/dhcp-4.2.0-P1-64_bit_lease_parse.patch deleted file mode 100644 index 2f9ad3b..0000000 --- a/dhcp-4.2.0-P1-64_bit_lease_parse.patch +++ /dev/null @@ -1,215 +0,0 @@ -diff -up dhcp-4.2.0-P1/common/dispatch.c.64-bit_lease_parse dhcp-4.2.0-P1/common/dispatch.c ---- dhcp-4.2.0-P1/common/dispatch.c.64-bit_lease_parse 2010-12-13 11:06:36.000000000 +0100 -+++ dhcp-4.2.0-P1/common/dispatch.c 2010-12-13 10:56:59.000000000 +0100 -@@ -174,6 +174,7 @@ isclib_timer_callback(isc_task_t *taskp - - /* maximum value for usec */ - #define USEC_MAX 1000000 -+#define DHCP_SEC_MAX 0xFFFFFFFF - - void add_timeout (when, where, what, ref, unref) - struct timeval *when; -@@ -185,7 +186,8 @@ void add_timeout (when, where, what, ref - struct timeout *t, *q; - int usereset = 0; - isc_result_t status; -- int sec, usec; -+ int64_t sec; -+ int usec; - isc_interval_t interval; - isc_time_t expires; - -@@ -231,9 +233,49 @@ void add_timeout (when, where, what, ref - q->what = what; - } - -- /* We don't really need this, but keep it for now */ -- q->when.tv_sec = when->tv_sec; -- q->when.tv_usec = when->tv_usec; -+ /* -+ * The value passed in is a time from an epoch but we need a relative -+ * time so we need to do some math to try and recover the period. -+ * This is complicated by the fact that not all of the calls cared -+ * about the usec value, if it's zero we assume the caller didn't care. -+ * -+ * The ISC timer library doesn't seem to like negative values -+ * and can't accept any values above 4G-1 seconds so we limit -+ * the values to 0 <= value < 4G-1. We do it before -+ * checking the trace option so that both the trace code and -+ * the working code use the same values. -+ */ -+ -+ sec = when->tv_sec - cur_tv.tv_sec; -+ usec = when->tv_usec - cur_tv.tv_usec; -+ -+ if ((when->tv_usec != 0) && (usec < 0)) { -+ sec--; -+ usec += USEC_MAX; -+ } -+ -+ if (sec < 0) { -+ sec = 0; -+ usec = 0; -+ } else if (sec > DHCP_SEC_MAX) { -+ log_error("Timeout requested too large %lld " -+ "reducing to 2^^32-1", sec); -+ sec = DHCP_SEC_MAX; -+ usec = 0; -+ } -+ else if (usec < 0) { -+ usec = 0; -+ } else if (usec >= USEC_MAX) { -+ usec = USEC_MAX - 1; -+ } -+ -+ /* -+ * This is necessary for the tracing code but we put it -+ * here in case we want to compare timing information -+ * for some reason, like debugging. -+ */ -+ q->when.tv_sec = cur_tv.tv_sec + (sec & DHCP_SEC_MAX); -+ q->when.tv_usec = usec; - - #if defined (TRACING) - if (trace_playback()) { -@@ -283,38 +325,7 @@ void add_timeout (when, where, what, ref - q->next = timeouts; - timeouts = q; - -- /* -- * Set up the interval values - The previous timers allowed -- * negative values to be set, the ISC timer library doesn't like -- * that so we make any negative values 0 which sould amount to -- * the same thing. -- */ -- -- /* -- * The value passed in is a time from an epoch but we need a relative -- * time so we need to do some math to try and recover the period. -- * This is complicated by the fact that not all of the calls cared -- * about the usec value, if it's zero we assume the caller didn't care. -- */ -- -- sec = when->tv_sec - cur_tv.tv_sec; -- usec = when->tv_usec - cur_tv.tv_usec; -- -- if ((when->tv_usec != 0) && (usec < 0)) { -- sec--; -- usec += USEC_MAX; -- } -- -- if (sec < 0) { -- sec = 0; -- usec = 0; -- } else if (usec < 0) { -- usec = 0; -- } else if (usec >= USEC_MAX) { -- usec = USEC_MAX - 1; -- } -- -- isc_interval_set(&interval, sec, usec * 1000); -+ isc_interval_set(&interval, sec & 0xFFFFFFFF, usec * 1000); - status = isc_time_nowplusinterval(&expires, &interval); - if (status != ISC_R_SUCCESS) { - /* -diff -up dhcp-4.2.0-P1/common/parse.c.64-bit_lease_parse dhcp-4.2.0-P1/common/parse.c ---- dhcp-4.2.0-P1/common/parse.c.64-bit_lease_parse 2009-10-28 05:12:29.000000000 +0100 -+++ dhcp-4.2.0-P1/common/parse.c 2010-12-13 11:06:36.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, -@@ -931,7 +931,7 @@ parse_date_core(cfile) - return (TIME)0; - } - -- guess = atoi(val); -+ guess = atol(val); - - if (!parse_semi(cfile)) - return (TIME)0; -@@ -945,7 +945,7 @@ parse_date_core(cfile) - skip_to_semi (cfile); - return (TIME)0; - } -- wday = atoi (val); -+ wday = atol (val); - - /* Year... */ - token = next_token (&val, (unsigned *)0, cfile); -@@ -960,7 +960,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. */ -- year = atoi (val); -+ year = atol (val); - if (year > 1900) - year -= 1900; - -@@ -982,7 +982,7 @@ parse_date_core(cfile) - skip_to_semi (cfile); - return (TIME)0; - } -- mon = atoi (val) - 1; -+ mon = atol (val) - 1; - - /* Slash separating month from day... */ - token = next_token (&val, (unsigned *)0, cfile); -@@ -1002,7 +1002,7 @@ parse_date_core(cfile) - skip_to_semi (cfile); - return (TIME)0; - } -- mday = atoi (val); -+ mday = atol (val); - - /* Hour... */ - token = next_token (&val, (unsigned *)0, cfile); -@@ -1012,7 +1012,7 @@ parse_date_core(cfile) - skip_to_semi (cfile); - return (TIME)0; - } -- hour = atoi (val); -+ hour = atol (val); - - /* Colon separating hour from minute... */ - token = next_token (&val, (unsigned *)0, cfile); -@@ -1032,7 +1032,7 @@ parse_date_core(cfile) - skip_to_semi (cfile); - return (TIME)0; - } -- min = atoi (val); -+ min = atol (val); - - /* Colon separating minute from second... */ - token = next_token (&val, (unsigned *)0, cfile); -@@ -1052,12 +1052,12 @@ parse_date_core(cfile) - skip_to_semi (cfile); - return (TIME)0; - } -- sec = atoi (val); -+ sec = atol (val); - - token = peek_token (&val, (unsigned *)0, cfile); - if (token == NUMBER) { - token = next_token (&val, (unsigned *)0, cfile); -- tzoff = atoi (val); -+ tzoff = atol (val); - } else - tzoff = 0; - -@@ -1090,7 +1090,7 @@ TIME - parse_date(cfile) - struct parse *cfile; - { -- int guess; -+ TIME guess; - guess = parse_date_core(cfile); - - /* Make sure the date ends in a semicolon... */ diff --git a/dhcp-4.2.0-invalid-dhclient-conf.patch b/dhcp-4.2.0-invalid-dhclient-conf.patch deleted file mode 100644 index 3b0cd98..0000000 --- a/dhcp-4.2.0-invalid-dhclient-conf.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff -up dhcp-4.2.0/client/dhclient.conf.supersede dhcp-4.2.0/client/dhclient.conf ---- dhcp-4.2.0/client/dhclient.conf.supersede 2009-07-07 01:29:51.000000000 +0200 -+++ dhcp-4.2.0/client/dhclient.conf 2010-07-21 14:47:27.000000000 +0200 -@@ -1,10 +1,10 @@ - send host-name = pick-first-value(gethostname(), "ISC-dhclient"); - 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.2.0-manpages.patch b/dhcp-4.2.0-manpages.patch deleted file mode 100644 index 2a56165..0000000 --- a/dhcp-4.2.0-manpages.patch +++ /dev/null @@ -1,644 +0,0 @@ -diff -up dhcp-4.2.0/client/dhclient.8.man dhcp-4.2.0/client/dhclient.8 ---- dhcp-4.2.0/client/dhclient.8.man 2010-07-10 05:25:51.000000000 +0200 -+++ dhcp-4.2.0/client/dhclient.8 2010-07-21 14:27:13.000000000 +0200 -@@ -115,6 +115,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 - ] - [ -@@ -142,46 +169,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 --.B -4 --command line argument (default), dhclient will use the --DHCPv4 protocol to obtain an IPv4 address and configuration parameters. --.PP --If given the --.B -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 --By default, DHCPv6 dhclient creates an identifier based on the --link-layer address (DUID-LL) if it is running in stateless mode (with ---S, not requesting an address), or it creates an identifier based on --the link-layer address plus a timestamp (DUID-LLT) if it is running in --stateful mode (without -S, requesting an address). --.B -D --overrides this default, with a value of either "LL" or "LLT". --.PP --If given the --.B --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 -@@ -235,141 +222,269 @@ 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 \-D -+By default, DHCPv6 dhclient creates an identifier based on the -+link-layer address (DUID-LL) if it is running in stateless mode (with -+-S, not requesting an address), or it creates an identifier based on -+the link-layer address plus a timestamp (DUID-LLT) if it is running in -+stateful mode (without -S, requesting an address). -+.BI \-D -+overrides this default, with a value of either "LL" or "LLT". -+ -+.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\