Skip to content

dhcpcd fails to open address specific socket after binding #501

@dougnazar

Description

@dougnazar

It fails the check at src/dhcp.c:2384 and never calls dhcp_openudp(). Possibly due to the interface already being configured (NFS root device).

	if (ctx->options & DHCPCD_MANAGER ||
	    ifp->options->options & DHCPCD_STATIC ||
	    (state->old != NULL &&
		state->old->yiaddr == state->new->yiaddr) ||
	    (old_state & STATE_ADDED && !(old_state & STATE_FAKE)))
		return;

It'll then spin trying to renew until rebind time.

eth0: executing: /lib/dhcpcd/dhcpcd-run-hooks PREINIT
eth0: executing: /lib/dhcpcd/dhcpcd-run-hooks CARRIER
eth0: IAID b4:00:b1:b4
eth0: delaying IPv4 for 0.8 seconds
eth0: reading lease: /var/lib/dhcpcd/eth0.lease
eth0: rebinding lease of 192.168.21.242
eth0: sending REQUEST (xid 0xf7553edb), next in 3.2 seconds
eth0: acknowledged 192.168.21.242 from 192.168.21.45
eth0: leased 192.168.21.242 for 86400 seconds
eth0: renew in 43200 seconds, rebind in 75600 seconds
eth0: writing lease: /var/lib/dhcpcd/eth0.lease
eth0: executing: /lib/dhcpcd/dhcpcd-run-hooks REBOOT
received SIGUSR1, renewing
eth0: renewing lease of 192.168.21.242
eth0: sending REQUEST (xid 0x4fd6b5b7), next in 3.8 seconds
eth0: sending REQUEST (xid 0x4fd6b5b7), next in 7.3 seconds
eth0: sending REQUEST (xid 0x4fd6b5b7), next in 16.2 seconds
eth0: sending REQUEST (xid 0x4fd6b5b7), next in 32.3 seconds
eth0: sending REQUEST (xid 0x4fd6b5b7), next in 64.9 seconds

The IP is obviously the same, making me think the IP check was meant to be combined with the old_state, and that seems to work, but I don't understand the code enough to ensure that won't break something else.

ctx->options = 291186172747062285 (0)
ifp->options->options = 291467372812311561 (0)
state->old->yiaddr = 4061505728, state->new->yiaddr = 4061505728
old_state = 3 (0)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions