Bug 33740 - If pump (0.8.3) fails to renew lease then the interface may fail to be set up when a lease is obtained
If pump (0.8.3) fails to renew lease then the interface may fail to be set up...
Status: CLOSED CURRENTRELEASE
Product: Red Hat Linux
Classification: Retired
Component: pump (Show other bugs)
7.0
i386 Linux
medium Severity high
: ---
: ---
Assigned To: Elliot Lee
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-03-28 23:59 EST by Jonathan Peatfield
Modified: 2007-04-18 12:32 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-06-28 12:32:06 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jonathan Peatfield 2001-03-28 23:59:49 EST
From Bugzilla Helper:
User-Agent: Mozilla/4.76 [en] (X11; U; Linux 2.2.18 i686)


If the dhcp server doesn't give pump a renewal on the lease then pump will
attempt to
obtain a new one (only once in the current code but see bug-19502 about
that), however even if it does get a lease it doesn't seem to set the
interface back up correctly.  pumpDhcpRun() calls pumpPrepareInterface()
which zaps the current address so we need to call pumpSetupInterface() and
since the address/routing may be different we should probably also call the
code to setup the default gateway, dns etc.

Reproducible: Always
Steps to Reproduce:
1. Make a dhcp server refuse to renew lease
2. wait for pump to try to renew
3. when it fails and does a fresh dhcpdiscover it seems to leave the
   interface with no IP address (though marked up).
	

Actual Results:  n/a

Expected Results:  working interface

here is a patch which I think does the right thing, but I'm waiting for a
dhcp server timeout to be sure. Note that this includes (since I'm lazy)
the one char typo mentioned in 19501 (+= should be =) since I think that
logic sounds correct.  Also this moves the callscript in the 'case
CMD_STARTIFACE' to only happen if we obtained a lease, since calling it if
we didn't get a lease seems weird.

*** pump.c.orig Mon Aug 14 13:51:20 2000
--- pump.c      Thu Mar 29 05:42:46 2001
***************
*** 368,372 ****
                                intf[closest].device);
  
!                       if ((intf[closest].renewAt += pumpUptime() + 30) >
                            intf[closest].leaseExpiration) {
                            o = overrides;
--- 368,372 ----
                                intf[closest].device);
  
!                       if ((intf[closest].renewAt = pumpUptime() + 30) >
                            intf[closest].leaseExpiration) {
                            o = overrides;
***************
*** 396,401 ****
                                numInterfaces--;
                            } else {
!                               callScript(o->script, PUMP_SCRIPT_NEWLEASE,
!                                          &intf[closest]);
                              }
                        }
--- 396,414 ----
                                numInterfaces--;
                            } else {
!                             /* add code to bring interface back up
!                                  since pumpDhcpRun may have called
!                                  pumpDisableInterface 2001-03-29 JSP */
! 
!                             pumpSetupInterface(intf + closest);
!                             syslog(LOG_INFO, "re-configured interface
%s", intf[closest].device);
! 
!                             if (intf[closest].set &
PUMP_NETINFO_HAS_GATEWAY)
!                              
pumpSetupDefaultGateway(&intf[closest].gateway);
! 
!                             setupDns(intf + closest, o);
!                             setupDomain(intf + closest, o);
!                             
!                             callScript(o->script, PUMP_SCRIPT_NEWLEASE,
!                                        &intf[closest]);
                              }
                        }
***************
*** 461,467 ****
                    cmd.u.result = 0;
                    numInterfaces++;
                }
  
-                 callScript(o->script, PUMP_SCRIPT_NEWLEASE, intf);
                break;
  
--- 474,482 ----
                    cmd.u.result = 0;
                    numInterfaces++;
+ 
+                   /* Only call on sucess!  2001-03-29 JSP */
+                   callScript(o->script, PUMP_SCRIPT_NEWLEASE, intf);
                }
  
                break;
Comment 1 Elliot Lee 2001-08-26 17:58:39 EDT
Sorry for the long reply delay...

Does this bug still exist in the pump from rawhide?

Also, I hate to be picky, but please resend the patch in unified (diff -u)
format so I can read and merge it more easily.

Thanks.

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