From 2bf145c8c3f7af98e3ee845d0dd84cfc7e7ab4dc Mon Sep 17 00:00:00 2001 From: Jiří Popelka Date: Mar 25 2010 18:46:19 +0000 Subject: - In client initiated message exchanges stop retransmission upon reaching the MRD rather than at some point after it (#559153) --- diff --git a/dhcp-4.1.1-retransmission.patch b/dhcp-4.1.1-retransmission.patch new file mode 100644 index 0000000..2e448d5 --- /dev/null +++ b/dhcp-4.1.1-retransmission.patch @@ -0,0 +1,75 @@ +diff -up dhcp-4.1.1/client/dhc6.c.retransmission dhcp-4.1.1/client/dhc6.c +--- dhcp-4.1.1/client/dhc6.c.retransmission 2010-03-25 18:32:17.000000000 +0100 ++++ dhcp-4.1.1/client/dhc6.c 2010-03-25 18:33:54.000000000 +0100 +@@ -354,7 +354,7 @@ dhc6_retrans_init(struct client_state *c + static void + dhc6_retrans_advance(struct client_state *client) + { +- struct timeval elapsed; ++ struct timeval elapsed, elapsed_after_RT; + + /* elapsed = cur - start */ + elapsed.tv_sec = cur_tv.tv_sec - client->start_time.tv_sec; +@@ -371,6 +371,8 @@ dhc6_retrans_advance(struct client_state + elapsed.tv_sec += 1; + elapsed.tv_usec -= 1000000; + } ++ elapsed_after_RT.tv_sec = elapsed.tv_sec; ++ elapsed_after_RT.tv_usec = elapsed.tv_usec; + + /* + * RT for each subsequent message transmission is based on the previous +@@ -408,13 +410,10 @@ dhc6_retrans_advance(struct client_state + elapsed.tv_usec -= 1000000; + } + if (elapsed.tv_sec >= client->MRD) { +- /* +- * wake at RT + cur = start + MRD +- */ +- client->RT = client->MRD + +- (client->start_time.tv_sec - cur_tv.tv_sec); +- client->RT = client->RT * 100 + +- (client->start_time.tv_usec - cur_tv.tv_usec) / 10000; ++ client->RT = client->MRD - elapsed_after_RT.tv_sec; ++ client->RT = client->RT * 100 - elapsed_after_RT.tv_usec / 10000; ++ if (client->RT < 0) ++ client->RT = 0; + } + client->txcount++; + } +@@ -1502,7 +1501,7 @@ do_init6(void *input) + elapsed.tv_usec += 1000000; + } + /* Check if finished (-1 argument). */ +- if ((client->MRD != 0) && (elapsed.tv_sec > client->MRD)) { ++ if ((client->MRD != 0) && (elapsed.tv_sec >= client->MRD)) { + log_info("Max retransmission duration exceeded."); + client->state = S_STOPPED; + if (client->active_lease != NULL) { +@@ -1922,7 +1921,7 @@ do_info_request6(void *input) + elapsed.tv_usec += 1000000; + } + /* Check if finished (-1 argument). */ +- if ((client->MRD != 0) && (elapsed.tv_sec > client->MRD)) { ++ if ((client->MRD != 0) && (elapsed.tv_sec >= client->MRD)) { + log_info("Max retransmission duration exceeded."); + exit(2); + } +@@ -2043,7 +2042,7 @@ do_confirm6(void *input) + elapsed.tv_sec -= 1; + elapsed.tv_usec += 1000000; + } +- if ((client->MRD != 0) && (elapsed.tv_sec > client->MRD)) { ++ if ((client->MRD != 0) && (elapsed.tv_sec >= client->MRD)) { + log_info("Max retransmission duration exceeded."); + start_bound(client); + return; +@@ -3290,7 +3289,7 @@ do_select6(void *input) + elapsed.tv_sec -= 1; + elapsed.tv_usec += 1000000; + } +- if ((client->MRD != 0) && (elapsed.tv_sec > client->MRD)) { ++ if ((client->MRD != 0) && (elapsed.tv_sec >= client->MRD)) { + log_info("Max retransmission duration exceeded."); + abort = ISC_TRUE; + } diff --git a/dhcp.spec b/dhcp.spec index 191009b..40bab26 100644 --- a/dhcp.spec +++ b/dhcp.spec @@ -13,7 +13,7 @@ Summary: Dynamic host configuration protocol software Name: dhcp Version: %{basever} -Release: 14%{?dist} +Release: 15%{?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. @@ -56,6 +56,7 @@ Patch20: %{name}-4.1.1-capability.patch 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 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: autoconf @@ -219,6 +220,10 @@ libdhcpctl and libomapi static libraries are also included in this package. # as described in section 18.1.7 of RFC-3315 (#559147) %patch23 -p1 -b .sendDecline +# In client initiated message exchanges stop retransmission +# upon reaching the MRD rather than at some point after it (#559153) +%patch24 -p1 -b .retransmission + # Copy in documentation and example scripts for LDAP patch to dhcpd %{__install} -p -m 0755 ldap-for-dhcp-%{ldappatchver}/dhcpd-conf-to-ldap contrib/ @@ -501,6 +506,10 @@ fi %attr(0644,root,root) %{_mandir}/man3/omapi.3.gz %changelog +* Thu Mar 25 2010 Jiri Popelka - 12:4.1.1-15 +- In client initiated message exchanges stop retransmission + upon reaching the MRD rather than at some point after it (#559153) + * Wed Mar 24 2010 Jiri Popelka - 12:4.1.1-14 - In dhclient-script check whether bound address passed duplicate address detection (DAD) (#559147) @@ -515,7 +524,6 @@ fi - use ip command options '-4' or '-6' as shortcuts for '-f[amily] inet' resp. '-f[amily] inet6' - do not use IP protocol family identifier with 'ip link' - * Fri Mar 12 2010 Jiri Popelka - 12:4.1.1-12 - Discard unicast Request/Renew/Release/Decline message (unless we set unicast option) and respond with Reply