Bug 19501 - [PATCH] pump only attempts renew once
[PATCH] pump only attempts renew once
Product: Red Hat Linux
Classification: Retired
Component: pump (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Elliot Lee
David Lawrence
Depends On:
  Show dependency treegraph
Reported: 2000-10-21 02:06 EDT by Scott Renfro
Modified: 2007-04-18 12:29 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2001-07-20 01:08:22 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
patch to correct pump only trying renew once (661 bytes, patch)
2000-10-21 02:42 EDT, Scott Renfro
no flags Details | Diff

  None (edit)
Description Scott Renfro 2000-10-21 02:06:10 EDT
A simple typo in pump.c causes pump to only attempt a single renew.
If the renew fails, we intend to try again in 30 seconds, but the
use of += instead of = causes the value of renewAt to be too large
and almost always exceed leaseExpiration. Found this in code review
following the incident described below the patch.

--- patch file ---

diff -urN pump-0.8.2.orig/pump.c pump-0.8.2/pump.c
--- pump-0.8.2.orig/pump.c      Tue Aug  8 06:25:43 2000
+++ pump-0.8.2/pump.c   Fri Oct 20 19:55:53 2000
@@ -365,7 +365,12 @@
                                "failed to renew lease for device %s",
-                       if ((intf[closest].renewAt += pumpUptime() + 30) >
+                       /* if the renewal failed, then set renewAt to
+                        * try again in 30 seconds AND then if renewAt's
+                        * value is after the lease expiration then
+                        * try to get a fresh lease for the interface
+                        */
+                       if ((intf[closest].renewAt = pumpUptime() + 30) >
                            intf[closest].leaseExpiration) {
                            o = overrides;
                            while (*o->intf.device &&

--- further info ---

Long story short. Had a IP address conflicts on local segment.
Tracked down to rh6.2 box configured for dhcp with pump. Pump
had tried to renew the lease and failed on first try. Pump then
immediately exited (based on syslog).  Source code analysis
reveals several problems in pump.c in lines 368-390.

First: this bug (in this report) causes pump to only attempt renew
once (in nearly all cases).

Second: that once a lease has expired, pump only tries once to get
a new lease and does so immediately after a renew fails.  In nearly
all cases, the new lease request will fail for the same reason the
renewal fails (assuming even very short network problems). Reporting
this in a separate bug report. Am submitting a separate bug report
with untested patch for this.

Third: When a lease expires and pump gives up trying to get a new
lease, it doesn't actually call pumpDisableInterface or otherwise
take the IP address from the interface before calling exit(1).  As
a result, the interface remains up and configured for an IP address
that it no longer ''owns.''  This causes IP address conflicts on
DHCP networks. I don't run RH and have only looked at the code
in passing so don't know whether or not you want to solve this
by calling pumpDisableInterface() or do something else.

Fourth: when we first calculate renewAt value at dhcp.c:1109,
we set it to 7/8 the duration of the lease. For short leases,
this doesn't give much time to renew if a problem occurs.
isc and ms both use 1/2 for this factor. This is something
of an opinion issue, so I won't submit a separate report on
this issue.

Comment 1 Scott Renfro 2000-10-21 02:42:18 EDT
Created attachment 4490 [details]
patch to correct pump only trying renew once
Comment 2 Erik Troan 2000-10-23 10:52:34 EDT
This bug is fixed in 7.0 already -- thanks. The 7/8 bit is specified by the dhcp
RFC. I think that's pushing it as well,but...
Comment 3 Erik Troan 2000-10-23 11:26:19 EDT
I misinterpreted the 7/8 bit, actually. That's the time to move to the
REBINDING state (which pump doesn't implement), not the time to begin
RENEWAL (which should be at 1/2 the existing lease), where you put it. I'm not
going to change this until I implement REBINDING properly though (which is your
second patch, plus a new internal state).
Comment 4 Scott Renfro 2000-10-23 15:58:43 EDT
Are you sure this bug is corrected? I've reviewed the source code
included with both pump-0.8.3-2.src.rpm and pump-0.8.4.src.rpm and
in both cases, the following line is present in pump.c:

0.8.4   pump.c:377   if ((intf[closest].renewAt += pumpUptime() + 30) >
0.8.3-2 pump.c:370   if ((intf[closest].renewAt += pumpUptime() + 30) >

I'm proposing that the += above should actually be simply =

Is there a more up to date src rpm I should be reviewing instead?


Comment 5 Erik Troan 2000-10-24 09:52:24 EDT
I misread your patch -- your fix is correct.
Comment 6 Scott Renfro 2000-10-24 11:19:51 EDT
cool; thanks.
Comment 7 Elliot Lee 2001-07-20 01:08:08 EDT
Has this since been fixed?

Apologies for unresponsiveness of previous pump maintainer...
Comment 8 Elliot Lee 2001-07-20 10:06:47 EDT
Patch wasn't applied, done.
Comment 9 Scott Renfro 2001-07-20 11:03:17 EDT
thanks for finally closing this out and improving pump's behavior on dhcp networks

Note You need to log in before you can comment on or make changes to this bug.