OpenWrt/LEDE Project

  • Status Unconfirmed
  • Percent Complete
    0%
  • Task Type Bug Report
  • Category Base system
  • Assigned To No-one
  • Operating System All
  • Severity Low
  • Priority Very Low
  • Reported Version openwrt-21.02
  • Due in Version Undecided
  • Due Date Undecided
  • Private
Attached to Project: OpenWrt/LEDE Project
Opened by overnight_spaghetti - 05.07.2021

FS#3915 - Expiration time for leases populated incorrectly in dhcp.leases

 
I’m running 21.02 on a FriendlyArm R4S. Noticed that all dhcp leases in Luci show as expired. Checking dhcp.leases, it shows:
43200 dc:xx:xx:xx:xx:xx 192.168.1.52 octopi *

According to dnsmasq, the first column should be the timestamp of when the lease is expiring (so either ‘now + leasetime’ or ‘uptime + leasetime’). In this case, it is just ‘0 + leasetime’.

Not sure if this is an issue with dnsmasq or openwrt itself. Happy to add more info if needed!


overnight_spaghetti commented on 06.07.2021 22:27

This turns out to be an effect of HAVE_BROKEN_RTC flag in dnsmasq. However, ubus still returns expiration time of 0 for all IPv4 leases → listing as expired in Luci

Admin
Jo-Philipp Wich commented on 07.07.2021 07:57

Did you build yourself? The HAVE_BROKEN_RTC build option should be disabled by default in official builds. LuCI currently expects UNIX timestamps in the expiration time column and not relative remaining validity times.

I am considering adding some heuristics to workaround the problem. Basically if the expire value is smaller than a specific cutoff date (say 2020-01-01, 1577833200) then treat it as relative, else as absolute expiration value, then act accordingly.

However it is low priority since the broken RTC flag is not a default configuration. If you want to give it a stab yourself, then the relevant code would be here: https://github.com/openwrt/luci/blob/master/libs/rpcd-mod-luci/src/luci.c#L534

overnight_spaghetti commented on 07.07.2021 17:09

You are indeed correct, it's homemade and the flag is set. I'll build it again without and see if that helps (which I now expect :) )

overnight_spaghetti commented on 07.07.2021 18:43

Setting

CONFIG_PACKAGE_dnsmasq_full_broken_rtc=n

fixed it.

Handling the other mode seems quite difficult, as the first column will only statically show the lease time. I am actually not sure if there is a way to calculate the remaining time, unless it is possible to find out when the lease was handed out and calculate from there.

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing