Current-Users archive

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

Re: Problems with dhcpcd





On 7/10/23 05:01, Roy Marples wrote:
So it took 12 seconds to complete the DHCP transaction and validate the addresses are good before applying the DHCP lease.
Without -B, dhcpcd will fork to the background right away so any assignments from the DHCP lease won't apply right away.

Is this what you are seeing?

Partly, yes. I am confident that when I was testing "dhcpcd -d", that I can't have been waiting long enough for the hostname to be set.

Is the hostname even there?

Yes. I checked the dhcpcd.leases file by hand as well as using tcpdump. While I couldn't read the binary contents of dhcpcd.leases, the hostname was pretty obvious.

You can examine the contents of your leases with `dhcpcd -U`.

Thank you. That has given me more information.

The hostname is never set when I reboot the Raspberry Pi and in that case the output from "dhcpcd -U" is

reason=BOUND
interface=usmsc0
protocol=dhcp
ip_address=10.0.1.54
subnet_cidr=24
network_number=10.0.1.0
subnet_mask=255.255.255.0
routers=10.0.1.1
domain_name_servers=10.0.1.42 10.0.1.40
host_name=rpi3-1
domain_name=must-have-coffee.gen.nz
broadcast_address=10.0.1.255
dhcp_lease_time=86400
dhcp_message_type=5
dhcp_server_identifier=10.0.1.9
domain_search=must-have-coffee.gen.nz

If I simply run "/etc/rc.d/dhcpcd restart" any time after the Raspberry Pi has booted, then I get a hostname. At this time the output from "dhcpcd -U" is

reason=REBOOT
interface=usmsc0
protocol=dhcp
ip_address=10.0.1.54
subnet_cidr=24
network_number=10.0.1.0
subnet_mask=255.255.255.0
routers=10.0.1.1
domain_name_servers=10.0.1.42 10.0.1.40
host_name=rpi3-1
domain_name=must-have-coffee.gen.nz
broadcast_address=10.0.1.255
dhcp_lease_time=86400
dhcp_message_type=5
dhcp_server_identifier=10.0.1.9
domain_search=must-have-coffee.gen.nz

Running diff shows that the only difference is the "reason=" field.

That was all with dhcpcd 10.0.3. I'll try and look into the source code and see why the reason field might make a difference. It could just be something causing trouble in the early boot and the reason is just a coincidence.

Cheers,
Lloyd


Home | Main Index | Thread Index | Old Index