NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bin/57956: dhcpcd -k ifN consistently fails to release lease, dhcpcd -U ifN sometimes fails to dump lease



>Number:         57956
>Category:       bin
>Synopsis:       dhcpcd -k ifN consistently fails to release lease, dhcpcd -U ifN sometimes fails to dump lease
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Feb 23 21:40:00 +0000 2024
>Originator:     Taylor R Campbell
>Release:        netbsd-10
>Organization:
The NetBSDCHCPCD Foundation
>Environment:
NetBSD nanocons.local 10.0_RC3 NetBSD 10.0_RC3 (GENERIC64) #15: Wed Jan 17 05:31:14 UTC 2024  root@manticore.local:/usr/obj/10/evbarm64/sys/arch/evbarm/compile/GENERIC64 evbarm
>Description:
nanocons# dhcpcd -k ure0
dhcpcd not running
nanocons# dhcpcd -k urtwn0
dhcpcd not running

But dhcpcd is definitely running and configuring these interfaces:

<daemon.info>Feb 23 21:28:33 nanocons dhcpcd[8543]: ure0: renew in 16971, rebind in 29931, expire in 4294967295 seconds
...
<daemon.info>Feb 23 21:28:33 nanocons dhcpcd[8543]: urtwn0: renew in 16971, rebind in 29931, expire in 4294967295 seconds
<daemon.err>Feb 23 21:29:54 nanocons dhcpcd[11503]: dhcpcd not running

ktrace reveals that it's just checking for a nonexistent pid file before giving up:

 27625  27625 dhcpcd   CALL  open(0xffffffc3cc88,0x400004,0x2f)
 27625  27625 dhcpcd   NAMI  "/var/run/dhcpcd/ure0.pid"
 27625  27625 dhcpcd   RET   open -1 errno 2 No such file or directory
 27625  27625 dhcpcd   CALL  write(2,0x2d2e510,0x13)
 27625  27625 dhcpcd   GIO   fd 2 wrote 19 bytes
       "dhcpcd not running\n"

What is actually in /var/run/dhcpcd:

nanocons# ls -l /var/run/dhcpcd
total 16
drwxr-xr-x  4 root  wheel  512 Feb 23 21:35 hook-state
-rw-r--r--  1 root  wheel    5 Feb 23 21:28 pid
srw-rw----  1 root  wheel    0 Feb 23 21:28 sock
srw-rw-rw-  1 root  wheel    0 Feb 23 21:28 unpriv.sock

Sometimes when I run dhcpcd -U it just fails entirely:

nanocons# dhcpcd -U ure0
dhcpcd_readdumptimeout
nanocons# dhcpcd -U urtwn0
dhcpcd_readdumptimeout

Sometimes it prints some information first before reporting a timeout:

nanocons# dhcpcd -U ure0
reason=CARRIER
interface=ure0
protocol=link
if_configured=true
...
reason=REBOOT
interface=ure0
protocol=dhcp
...
reason=ROUTERADVERT
interface=ure0
protocol=ra

dhcpcd_readdumptimeout
>How-To-Repeat:
I have three interfaces: emac0, ure0, and urtwn0.  emac0 is statically configured, so I asked dhcpcd not to configure it with -Z in rc.conf:

dhcpcd=YES
dhcpcd_flags="${dhcpcd_flags} -Z emac0"

The only changes from the default 10.0_RC3 dhcpcd.conf I have are:

-option rapid_commit
+#option rapid_commit
...
+nooption dhcp6_reconfigure_accept

(Perhaps I should get rid of these, from trying to diagnose some problem several years ago, but I don't think they should cause dhcpcd -k or -U to malfunction in any case.)
>Fix:
Yes, please!



Home | Main Index | Thread Index | Old Index