rpms/dhcp/devel dhclient-script, 1.18, 1.19 dhcp-4.1.1-UseMulticast.patch, 1.1, 1.2 dhcp.spec, 1.297, 1.298

Jiří Popelka jpopelka at fedoraproject.org
Fri Mar 19 17:23:00 UTC 2010


Author: jpopelka

Update of /cvs/pkgs/rpms/dhcp/devel
In directory cvs01.phx2.fedoraproject.org:/tmp/cvs-serv20951

Modified Files:
	dhclient-script dhcp-4.1.1-UseMulticast.patch dhcp.spec 
Log Message:
* Fri Mar 19 2010 Jiri Popelka <jpopelka at redhat.com> - 12:4.1.1-14
- Fix UseMulticast.patch to not repeatedly parse dhcpd.conf for unicast option
- Fix dhclient-script to set interface MTU only when it's greater than 576 (#574629)



Index: dhclient-script
===================================================================
RCS file: /cvs/pkgs/rpms/dhcp/devel/dhclient-script,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -p -r1.18 -r1.19
--- dhclient-script	19 Feb 2010 11:37:25 -0000	1.18
+++ dhclient-script	19 Mar 2010 17:22:59 -0000	1.19
@@ -262,7 +262,12 @@ dhconfig() {
         ip -4 addr add ${new_ip_address}/${new_prefix} broadcast ${new_broadcast_address} dev ${interface}
         ip link set dev ${interface} up
 
-        if [ -n "${new_interface_mtu}" ]; then
+        # The 576 MTU is only used for X.25 and dialup connections
+        # where the admin wants low latency.  Such a low MTU can cause
+        # problems with UDP traffic, among other things.  As such,
+        # disallow MTUs from 576 and below by default, so that broken
+        # MTUs are ignored, but higher stuff is allowed (1492, 1500, etc).
+        if [ -n "${new_interface_mtu}" ] && [ ${new_interface_mtu} -gt 576 ]; then
             ip link set ${interface} mtu ${new_interface_mtu}
         fi
 

dhcp-4.1.1-UseMulticast.patch:
 dhcpv6.c |  161 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------
 1 file changed, 145 insertions(+), 16 deletions(-)

Index: dhcp-4.1.1-UseMulticast.patch
===================================================================
RCS file: /cvs/pkgs/rpms/dhcp/devel/dhcp-4.1.1-UseMulticast.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- dhcp-4.1.1-UseMulticast.patch	12 Mar 2010 20:18:59 -0000	1.1
+++ dhcp-4.1.1-UseMulticast.patch	19 Mar 2010 17:22:59 -0000	1.2
@@ -1,37 +1,56 @@
 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-12 19:59:50.000000000 +0100
-@@ -1206,6 +1206,29 @@ pick_v6_prefix(struct iasubopt **pref, i
++++ 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 file.
++ * 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;
 +
-+	opt_state = NULL;
-+	if (!option_state_allocate(&opt_state, MDL)) {
-+		log_fatal("No memory for unicast option.");
-+	}
++	/*
++	 * 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);
++		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);
++		oc = lookup_option(&dhcpv6_universe, opt_state, D6O_UNICAST);
++		unicast_option_defined = (oc != NULL);
 +
-+	option_state_dereference(&opt_state, MDL);
++		option_state_dereference(&opt_state, MDL);
++	}
 +
-+	return (oc != NULL);
++	return (unicast_option_defined);
 +}
 +
 +/*
-  * lease_to_client() is called from several messages to construct a
-  * reply that contains all that we know about the client's correct lease
-  * (or projected lease).
-@@ -1398,6 +1421,56 @@ lease_to_client(struct data_string *repl
+  * Get the client identifier from the packet.
+  */
+ isc_result_t
+@@ -1398,6 +1440,56 @@ lease_to_client(struct data_string *repl
  						    reply.shared->group);
  	}
  
@@ -88,7 +107,7 @@ diff -up dhcp-4.1.1/server/dhcpv6.c.UseM
  	/*
  	 * RFC3315 section 17.2.2 (Solicit):
  	 *
-@@ -1422,8 +1495,6 @@ lease_to_client(struct data_string *repl
+@@ -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.
  	 */
@@ -97,7 +116,7 @@ diff -up dhcp-4.1.1/server/dhcpv6.c.UseM
  	{
  		/* Set the NoAddrsAvail status code. */
  		if (!set_status_code(STATUS_NoAddrsAvail,
-@@ -4097,7 +4168,6 @@ dhcpv6_solicit(struct data_string *reply
+@@ -4097,7 +4187,6 @@ dhcpv6_solicit(struct data_string *reply
   * Very similar to Solicit handling, except the server DUID is required.
   */
  
@@ -105,7 +124,7 @@ diff -up dhcp-4.1.1/server/dhcpv6.c.UseM
  static void
  dhcpv6_request(struct data_string *reply_ret, struct packet *packet) {
  	struct data_string client_id;
-@@ -4412,7 +4482,6 @@ exit:
+@@ -4412,7 +4501,6 @@ exit:
   * except for the error code of when addresses don't match.
   */
  
@@ -113,7 +132,7 @@ diff -up dhcp-4.1.1/server/dhcpv6.c.UseM
  static void
  dhcpv6_renew(struct data_string *reply, struct packet *packet) {
  	struct data_string client_id;
-@@ -4653,18 +4722,60 @@ iterate_over_ia_na(struct data_string *r
+@@ -4653,18 +4741,60 @@ iterate_over_ia_na(struct data_string *r
  		goto exit;
  	}
  
@@ -184,7 +203,7 @@ diff -up dhcp-4.1.1/server/dhcpv6.c.UseM
  
  	/*
  	 * Loop through the IA_NA reported by the client, and deal with
-@@ -4802,6 +4913,7 @@ iterate_over_ia_na(struct data_string *r
+@@ -4802,6 +4932,7 @@ iterate_over_ia_na(struct data_string *r
  	/* 
  	 * Return our reply to the caller.
  	 */
@@ -192,7 +211,7 @@ diff -up dhcp-4.1.1/server/dhcpv6.c.UseM
  	reply_ret->len = reply_ofs;
  	reply_ret->buffer = NULL;
  	if (!buffer_allocate(&reply_ret->buffer, reply_ofs, MDL)) {
-@@ -4847,7 +4959,6 @@ exit:
+@@ -4847,7 +4978,6 @@ exit:
   * we still need to be aware of this possibility.
   */
  
@@ -200,7 +219,7 @@ diff -up dhcp-4.1.1/server/dhcpv6.c.UseM
  /* TODO: IA_TA */
  static void
  dhcpv6_decline(struct data_string *reply, struct packet *packet) {
-@@ -5314,7 +5425,6 @@ exit:
+@@ -5314,7 +5444,6 @@ exit:
   * Release means a client is done with the leases.
   */
  


Index: dhcp.spec
===================================================================
RCS file: /cvs/pkgs/rpms/dhcp/devel/dhcp.spec,v
retrieving revision 1.297
retrieving revision 1.298
diff -u -p -r1.297 -r1.298
--- dhcp.spec	12 Mar 2010 20:18:59 -0000	1.297
+++ dhcp.spec	19 Mar 2010 17:22:59 -0000	1.298
@@ -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.
@@ -495,6 +495,10 @@ fi
 %attr(0644,root,root) %{_mandir}/man3/omapi.3.gz
 
 %changelog
+* Fri Mar 19 2010 Jiri Popelka <jpopelka at redhat.com> - 12:4.1.1-14
+- Fix UseMulticast.patch to not repeatedly parse dhcpd.conf for unicast option
+- Fix dhclient-script to set interface MTU only when it's greater than 576 (#574629)
+
 * Fri Mar 12 2010 Jiri Popelka <jpopelka at redhat.com> - 12:4.1.1-13
 - Discard unicast Request/Renew/Release/Decline message
   (unless we set unicast option) and respond with Reply



More information about the scm-commits mailing list