Public bug reported:

OS version: Ubuntu MATE 16.04 armhf
HW: raspberry pi 3B WITHOUT a battery backed up RTC
package verison: isc-dhcp-client 4.3.3-5ubuntu12.6

How to reproduce this bug: Power off a raspberry pi machine (without a battery 
backed up RTC: this is default)
longer than DCHP lease time. Then power it on. Then, DHCP lease is not renewed.

Work around: After correct date is set (by NTP or manually), reboot
again.

Cause of the bug: Right after boot, Rapsberry pi (without a battery
backed up RTC) uses the last shutdown time as a current time. When
dhclient obtains a DHCP lease, it sets a renewal time to the incorrect
current time plus renewal time and set an interval timer (which is
maintained by relative time). Sooner or later, the system gets correct
time from NTP and the system current time jumps. When the interval timer
expires, dhclient first compares current time (which is now correct) and
the lease expire time (which is computed based on incrrect time) and
shifts to the state EXPIRED. Cf. functions bind_lease() and
state_bound() in dhclient.c

Somehow, I cannot build dhclient from the source code obtained by apt-get 
source.
However, I could build dhclient (4.3.5) from a tarball from ISC website and the 
same problem occurred.
I modified some source files:
   use clock_gettime(CLOCK_BOOTTIME, *) instead of gettimeofday in appropriate 
places
   modify lease file read/write functions to convert time from boot to 
(possibly incorrect) time in GMT.
With the modifed dhclient, dhcp leases are correctly renewed on my machines, so 
far.
I use IPV4 over ethernet only and I have no idea what to do with tr.c 
(functions for token ring) which calls gettimeofday.
But if I understand correctly, I believe mixture use of absolute times and 
relative times is responsible for the bug.

** Affects: isc-dhcp (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to isc-dhcp in Ubuntu.
https://bugs.launchpad.net/bugs/1695702

Title:
  dhclient doen't renew a lease on raspberry pi

Status in isc-dhcp package in Ubuntu:
  New

Bug description:
  OS version: Ubuntu MATE 16.04 armhf
  HW: raspberry pi 3B WITHOUT a battery backed up RTC
  package verison: isc-dhcp-client 4.3.3-5ubuntu12.6

  How to reproduce this bug: Power off a raspberry pi machine (without a 
battery backed up RTC: this is default)
  longer than DCHP lease time. Then power it on. Then, DHCP lease is not 
renewed.

  Work around: After correct date is set (by NTP or manually), reboot
  again.

  Cause of the bug: Right after boot, Rapsberry pi (without a battery
  backed up RTC) uses the last shutdown time as a current time. When
  dhclient obtains a DHCP lease, it sets a renewal time to the incorrect
  current time plus renewal time and set an interval timer (which is
  maintained by relative time). Sooner or later, the system gets correct
  time from NTP and the system current time jumps. When the interval
  timer expires, dhclient first compares current time (which is now
  correct) and the lease expire time (which is computed based on
  incrrect time) and shifts to the state EXPIRED. Cf. functions
  bind_lease() and state_bound() in dhclient.c

  Somehow, I cannot build dhclient from the source code obtained by apt-get 
source.
  However, I could build dhclient (4.3.5) from a tarball from ISC website and 
the same problem occurred.
  I modified some source files:
     use clock_gettime(CLOCK_BOOTTIME, *) instead of gettimeofday in 
appropriate places
     modify lease file read/write functions to convert time from boot to 
(possibly incorrect) time in GMT.
  With the modifed dhclient, dhcp leases are correctly renewed on my machines, 
so far.
  I use IPV4 over ethernet only and I have no idea what to do with tr.c 
(functions for token ring) which calls gettimeofday.
  But if I understand correctly, I believe mixture use of absolute times and 
relative times is responsible for the bug.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/isc-dhcp/+bug/1695702/+subscriptions

-- 
Mailing list: https://launchpad.net/~touch-packages
Post to     : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to