NetworkConfiguration / dhcpcd

DHCP / IPv4LL / IPv6RA / DHCPv6 client.
https://roy.marples.name/projects/dhcpcd
BSD 2-Clause "Simplified" License
348 stars 112 forks source link

Waiting for carrier blocks timeout #276

Open holmanb opened 10 months ago

holmanb commented 10 months ago

Problem:

--timeout isn't respected when no carrier has been acquired

I see:

# dhcpcd --nobackground --ipv4only --oneshot --waitip=4 --persistent --timeout=5 --debug wlo1
dhcpcd-10.0.5 starting
DUID 00:01:00:01:2d:1e:ed:87:b6:18:32:62:ff:1a
wlo1: executing: /lib/dhcpcd/dhcpcd-run-hooks PREINIT
wlo1: executing: /lib/dhcpcd/dhcpcd-run-hooks NOCARRIER
Dropped protocol specifier '.link' from 'wlo1.link'. Using 'wlo1' (ifindex=3).
wlo1: waiting for carrier

I would expect the timeout ideally to be respected, or at the very least document this behavior.

rsmarples commented 10 months ago

I'm thinking about removing the timeout option as it becomes meaningless when #271 happens.

rsmarples commented 10 months ago

@holmanb once #271 happens the --oneshot option would be removed as well, but you used it in your example. Do you have a rationale for it?

holmanb commented 10 months ago

@rsmarples Thanks for the reply and followup.

Using --oneshot for synchronous dhcp address assignment to a single interface by other tools. For example initramfs-tools recently replaced their isc dependency with dhcpcd using --oneshot. Do you have a proposal for how one might do this that works under current and future dhcpcd plans?

rsmarples commented 10 months ago

Ok, that's a good enough reason to keep it. I'll add that the fine man page.

holmanb commented 10 months ago

Ok, that's a good enough reason to keep it. I'll add that the fine man page.

Thanks @rsmarples. I have more questions regarding #271, but will continue the conversation here.