rpms/dhcp/F-12 dhcp-4.1.1-release6-elapsed.patch, NONE, 1.1 dhcp-4.1.1-manpages.patch, 1.4, 1.5 dhcp-4.1.1-sendDecline.patch, 1.2, 1.3 dhcp.spec, 1.295, 1.296

Jiří Popelka jpopelka at fedoraproject.org
Mon Apr 19 10:33:30 UTC 2010


Author: jpopelka

Update of /cvs/pkgs/rpms/dhcp/F-12
In directory cvs01.phx2.fedoraproject.org:/tmp/cvs-serv25365

Modified Files:
	dhcp-4.1.1-manpages.patch dhcp-4.1.1-sendDecline.patch 
	dhcp.spec 
Added Files:
	dhcp-4.1.1-release6-elapsed.patch 
Log Message:
* Mon Apr 19 2010 Jiri Popelka <jpopelka at redhat.com> - 12:4.1.1-14
- Fill in Elapsed Time Option in Release/Decline messages (#582939)


dhcp-4.1.1-release6-elapsed.patch:
 dhc6.c |   22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

--- NEW FILE dhcp-4.1.1-release6-elapsed.patch ---
diff -up dhcp-4.1.1/client/dhc6.c.release6-elapsed dhcp-4.1.1/client/dhc6.c
--- dhcp-4.1.1/client/dhc6.c.release6-elapsed	2010-04-19 11:55:59.000000000 +0200
+++ dhcp-4.1.1/client/dhc6.c	2010-04-19 12:00:00.000000000 +0200
@@ -2174,7 +2174,7 @@ do_release6(void *input)
 	struct client_state *client;
 	struct data_string ds;
 	int send_ret;
-	struct timeval tv;
+	struct timeval elapsed, tv;
 
 	client = input;
 
@@ -2194,6 +2194,14 @@ do_release6(void *input)
 		client->start_time.tv_usec = cur_tv.tv_usec;
 	}
 
+	/* elapsed = cur - start */
+	elapsed.tv_sec = cur_tv.tv_sec - client->start_time.tv_sec;
+	elapsed.tv_usec = cur_tv.tv_usec - client->start_time.tv_usec;
+	if (elapsed.tv_usec < 0) {
+		elapsed.tv_sec -= 1;
+		elapsed.tv_usec += 1000000;
+	}
+
 	/*
 	 * Don't use unicast as we don't know if we still have an
 	 * available address with enough scope.
@@ -2210,6 +2218,18 @@ do_release6(void *input)
 	ds.buffer->data[0] = DHCPV6_RELEASE;
 	memcpy(ds.buffer->data + 1, client->dhcpv6_transaction_id, 3);
 
+	/* Form an elapsed option. */
+	/* Maximum value is 65535 1/100s coded as 0xffff. */
+	if ((elapsed.tv_sec < 0) || (elapsed.tv_sec > 655) ||
+	    ((elapsed.tv_sec == 655) && (elapsed.tv_usec > 350000))) {
+		client->elapsed = 0xffff;
+	} else {
+		client->elapsed = elapsed.tv_sec * 100;
+		client->elapsed += elapsed.tv_usec / 10000;
+	}
+
+	client->elapsed = htons(client->elapsed);
+
 	log_debug("XMT: Forming Release.");
 	make_client6_options(client, &client->sent_options,
 			     client->active_lease, DHCPV6_RELEASE);

dhcp-4.1.1-manpages.patch:
 client/dhclient-script.8 |   22 ++
 client/dhclient.8        |  429 ++++++++++++++++++++++++++++++-----------------
 client/dhclient.conf.5   |   36 ++-
 common/dhcp-options.5    |   15 +
 server/dhcpd.conf.5      |   24 +-
 5 files changed, 341 insertions(+), 185 deletions(-)

Index: dhcp-4.1.1-manpages.patch
===================================================================
RCS file: /cvs/pkgs/rpms/dhcp/F-12/dhcp-4.1.1-manpages.patch,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -p -r1.4 -r1.5
--- dhcp-4.1.1-manpages.patch	12 Mar 2010 20:17:40 -0000	1.4
+++ dhcp-4.1.1-manpages.patch	19 Apr 2010 10:33:29 -0000	1.5
@@ -460,20 +460,24 @@ diff -up dhcp-4.1.1/client/dhclient.8.ma
 diff -up dhcp-4.1.1/client/dhclient.conf.5.man dhcp-4.1.1/client/dhclient.conf.5
 --- dhcp-4.1.1/client/dhclient.conf.5.man	2009-07-23 21:02:09.000000000 +0200
 +++ dhcp-4.1.1/client/dhclient.conf.5	2010-02-25 17:43:16.000000000 +0100
-@@ -186,9 +186,9 @@ responding to the client send the client
+@@ -184,11 +184,12 @@ are called \fIDHCP Options\fR.  DHCP Opt
+ The request statement causes the client to request that any server
+ responding to the client send the client its values for the specified
  options.   Only the option names should be specified in the request
- statement - not option parameters.   By default, the DHCP server
+-statement - not option parameters.   By default, the DHCP server
++statement - not option parameters.   By default, the DHCPv4 client
  requests the subnet-mask, broadcast-address, time-offset, routers,
 -domain-name, domain-name-servers and host-name options.  Note that if
 -you enter a 'request' statement, you over-ride this default and these
 -options will not be requested.
-+domain-name, domain-name-servers, host-name, nis-domain, nis-servers, ntp-servers,
-+and interface-mtu options.  Note that if you enter a 'request' statement,
++domain-name, domain-name-servers, host-name, nis-domain, nis-servers,
++ntp-servers and interface-mtu options. The DHCPv6 client requests by default
++name-servers and domain-search. Note that if you enter a 'request' statement,
 +you over-ride this default and these options will not be requested.
  .PP
  In some cases, it may be desirable to send no parameter request list
  at all.   To do this, simply write the request statement but specify
-@@ -239,17 +239,6 @@ than the default requested lease time, w
+@@ -239,17 +240,6 @@ than the default requested lease time, w
  obvious use for this statement is to send information to the server
  that will allow it to differentiate between this client and other
  clients or kinds of clients.
@@ -491,7 +495,7 @@ diff -up dhcp-4.1.1/client/dhclient.conf
  .SH DYNAMIC DNS
  The client now has some very limited support for doing DNS updates
  when a lease is acquired.   This is prototypical, and probably doesn't
-@@ -659,6 +659,18 @@ database and will record the media type 
+@@ -659,6 +649,18 @@ database and will record the media type 
  Whenever the client tries to renew the lease, it will use that same
  media type.   The lease must expire before the client will go back to
  cycling through media types.
@@ -510,7 +514,7 @@ diff -up dhcp-4.1.1/client/dhclient.conf
  .SH SAMPLE
  The following configuration file is used on a laptop running NetBSD
  1.3.   The laptop has an IP alias of 192.5.5.213, and has one
-@@ -680,10 +692,10 @@ interface "ep0" {
+@@ -680,10 +682,10 @@ interface "ep0" {
      send host-name "andare.fugue.com";
      send dhcp-client-identifier 1:0:a0:24:ab:fb:9c;
      send dhcp-lease-time 3600;

dhcp-4.1.1-sendDecline.patch:
 dhc6.c |  178 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----
 1 file changed, 169 insertions(+), 9 deletions(-)

Index: dhcp-4.1.1-sendDecline.patch
===================================================================
RCS file: /cvs/pkgs/rpms/dhcp/F-12/dhcp-4.1.1-sendDecline.patch,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -p -r1.2 -r1.3
--- dhcp-4.1.1-sendDecline.patch	25 Mar 2010 18:39:02 -0000	1.2
+++ dhcp-4.1.1-sendDecline.patch	19 Apr 2010 10:33:30 -0000	1.3
@@ -1,6 +1,6 @@
 diff -up dhcp-4.1.1/client/dhc6.c.sendDecline dhcp-4.1.1/client/dhc6.c
 --- dhcp-4.1.1/client/dhc6.c.sendDecline	2009-07-25 00:04:51.000000000 +0200
-+++ dhcp-4.1.1/client/dhc6.c	2010-03-24 10:41:31.000000000 +0100
++++ dhcp-4.1.1/client/dhc6.c	2010-04-19 11:42:42.000000000 +0200
 @@ -95,6 +95,8 @@ void do_select6(void *input);
  void do_refresh6(void *input);
  static void do_release6(void *input);
@@ -45,7 +45,7 @@ diff -up dhcp-4.1.1/client/dhc6.c.sendDe
 -		if (client->active_lease == NULL)
 -			return;
 +	if ((client->state == S_STOPPED) ||
-+		(client->state == S_DECLINED)) {
++	    (client->state == S_DECLINED)) {
 +
 +		if (client->active_lease != NULL) {
 +			dhc6_lease_destroy(&client->active_lease, MDL);
@@ -79,7 +79,7 @@ diff -up dhcp-4.1.1/client/dhc6.c.sendDe
  		}
  
  		/* XXX: maybe we should loop on the old values instead? */
-@@ -4509,6 +4524,134 @@ start_bound(struct client_state *client)
+@@ -4509,6 +4524,151 @@ start_bound(struct client_state *client)
  	dhc6_check_times(client);
  }
  
@@ -122,7 +122,7 @@ diff -up dhcp-4.1.1/client/dhc6.c.sendDe
 +	struct client_state *client;
 +	struct data_string ds;
 +	int send_ret;
-+	struct timeval tv;
++	struct timeval elapsed, tv;
 +
 +	client = input;
 +
@@ -142,6 +142,14 @@ diff -up dhcp-4.1.1/client/dhc6.c.sendDe
 +		client->start_time.tv_usec = cur_tv.tv_usec;
 +	}
 +
++	/* elapsed = cur - start */
++	elapsed.tv_sec = cur_tv.tv_sec - client->start_time.tv_sec;
++	elapsed.tv_usec = cur_tv.tv_usec - client->start_time.tv_usec;
++	if (elapsed.tv_usec < 0) {
++		elapsed.tv_sec -= 1;
++		elapsed.tv_usec += 1000000;
++	}
++
 +	memset(&ds, 0, sizeof(ds));
 +	if (!buffer_allocate(&ds.buffer, 4, MDL)) {
 +		log_error("Unable to allocate memory for Decline.");
@@ -153,6 +161,18 @@ diff -up dhcp-4.1.1/client/dhc6.c.sendDe
 +	ds.buffer->data[0] = DHCPV6_DECLINE;
 +	memcpy(ds.buffer->data + 1, client->dhcpv6_transaction_id, 3);
 +
++	/* Form an elapsed option. */
++	/* Maximum value is 65535 1/100s coded as 0xffff. */
++	if ((elapsed.tv_sec < 0) || (elapsed.tv_sec > 655) ||
++	    ((elapsed.tv_sec == 655) && (elapsed.tv_usec > 350000))) {
++		client->elapsed = 0xffff;
++	} else {
++		client->elapsed = elapsed.tv_sec * 100;
++		client->elapsed += elapsed.tv_usec / 10000;
++	}
++
++	client->elapsed = htons(client->elapsed);
++
 +	log_debug("XMT: Forming Decline.");
 +	make_client6_options(client, &client->sent_options,
 +			     client->active_lease, DHCPV6_DECLINE);
@@ -203,9 +223,6 @@ diff -up dhcp-4.1.1/client/dhc6.c.sendDe
 +	if (client->active_lease != NULL) {
 +		dhc6_lease_destroy(&client->active_lease, MDL);
 +		client->active_lease = NULL;
-+		/* We should never wait for nothing!? */
-+		if (stopping_finished())
-+			exit(0);
 +	}
 +	start_init6(client);
 +	return;


Index: dhcp.spec
===================================================================
RCS file: /cvs/pkgs/rpms/dhcp/F-12/dhcp.spec,v
retrieving revision 1.295
retrieving revision 1.296
diff -u -p -r1.295 -r1.296
--- dhcp.spec	25 Mar 2010 18:46:30 -0000	1.295
+++ dhcp.spec	19 Apr 2010 10:33:30 -0000	1.296
@@ -13,7 +13,7 @@
 Summary:  Dynamic host configuration protocol software
 Name:     dhcp
 Version:  %{basever}
-Release:  13%{?dist}
+Release:  14%{?dist}
 # NEVER CHANGE THE EPOCH on this package.  The previous maintainer (prior to
 # dcantrell maintaining the package) made incorrect use of the epoch and
 # that's why it is at 12 now.  It should have never been used, but it was.
@@ -57,6 +57,7 @@ Patch21:  %{name}-4.1.1-logpid.patch
 Patch22:  %{name}-4.1.1-UseMulticast.patch
 Patch23:  %{name}-4.1.1-sendDecline.patch
 Patch24:  %{name}-4.1.1-retransmission.patch
+Patch25:  %{name}-4.1.1-release6-elapsed.patch
 
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires: autoconf
@@ -224,6 +225,9 @@ libdhcpctl and libomapi static libraries
 # upon reaching the MRD rather than at some point after it (#559153)
 %patch24 -p1 -b .retransmission
 
+# Fill in Elapsed Time Option in Release message (#582939)
+%patch25 -p1 -b .release6-elapsed
+
 # Copy in documentation and example scripts for LDAP patch to dhcpd
 %{__install} -p -m 0755 ldap-for-dhcp-%{ldappatchver}/dhcpd-conf-to-ldap contrib/
 
@@ -506,6 +510,9 @@ fi
 %attr(0644,root,root) %{_mandir}/man3/omapi.3.gz
 
 %changelog
+* Mon Apr 19 2010 Jiri Popelka <jpopelka at redhat.com> - 12:4.1.1-14
+- Fill in Elapsed Time Option in Release/Decline messages (#582939)
+
 * Thu Mar 25 2010 Jiri Popelka <jpopelka at redhat.com> - 12:4.1.1-13
 - In client initiated message exchanges stop retransmission
   upon reaching the MRD rather than at some point after it (#559153)



More information about the scm-commits mailing list