dhcpcd 8.1.9 is unable to renew leases, causing network interruptions
I don't know if there are any special preconditions for this to happen. I have a very short DHCP lease time so this might've made it more visible to me.
dhcpcd is apparently unable to process DHCP Replies when it is renewing the lease. I confirmed with tcpdump that I am getting a reply, but dhcpcd goes into retry/backoff (dhcpcd -d):
Aug 6 15:24:41 jet daemon.debug [26182]: eth0: renewing lease of 10.3.1.56
Aug 6 15:24:41 jet daemon.debug [26182]: eth0: sending REQUEST (xid 0x9ce116f3), next in 3.4 seconds
Aug 6 15:24:45 jet daemon.debug [26182]: eth0: sending REQUEST (xid 0x9ce116f3), next in 8.0 seconds
Aug 6 15:24:53 jet daemon.debug [26182]: eth0: sending REQUEST (xid 0x9ce116f3), next in 15.2 seconds
Aug 6 15:25:08 jet daemon.debug [26182]: eth0: sending REQUEST (xid 0x9ce116f3), next in 31.6 seconds
Aug 6 15:25:39 jet daemon.debug [26182]: eth0: sending REQUEST (xid 0x9ce116f3), next in 63.5 seconds
Aug 6 15:26:43 jet daemon.debug [26182]: eth0: sending REQUEST (xid 0x9ce116f3), next in 64.6 seconds
It eventually gives up and rebinds. This introduces annoying network interruptions where IP/routes are lost briefly causing some TCP seesions to go bonkers.
I tested this by using (apparently undocumented) dhcpcd -N eth0
.
I bisected the problem down to:
commit e14045cae2a4b66995a87bbc40c4516a00d4c087
Author: Roy Marples <roy@marples.name>
Date: Tue Apr 21 09:55:50 2020 +0100
align CMSG buffer
This appeared first in 9.0.2 but seems to have been cherry-picked into 8.1.9. The 9.1.0 is the first release to contain a fix. On master branch the problem is solved by:
commit 29024d0ba64010eb85ad0d164898b7751d47d1cb
Author: Roy Marples <roy@marples.name>
Date: Sun Apr 26 21:05:06 2020 +0100
Align more CMSG foo.
It'd be great if dhcpcd package can be updated to at least 9.1.0, or downgraded to 8.1.8.
Alternatively we could ask upstream to hotfix this in dhcpcd-8 branch and release as 8.1.10.
The problem seems to have been reported already:
- https://roy.marples.name/archives/dhcpcd-discuss/0003431.html
- https://roy.marples.name/archives/dhcpcd-discuss/0003395.html
But the commit ids seem invalid, and links are 404. It doesn't look like the offending commit was found.
I'll reach out to Roy over github.