-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DHCPv6 Rebind with expired lease Reply "invalid state" #437
Comments
From some debug I added, looks like after the Rebind is sent, dhcpcd drops into INIT state, which is an invalid state to be processing a Reply in. I will start with examining the state machine logic. I think this might be due to my router, I bet the lack of RA is messing with things. RSs time out, maybe that drops it back into INIT state? A --renew attempt prints out "no IPv6 Routers Available" and then it doesn't try anything else. |
Looks like the lack of IPv6 router info prevents the renew from occurring, even though the lease was successfully bound. Couple of changes might help:
|
I cannot replicate this.
|
Maybe the expired lease message is a clue? It shouldn't be expired, it was given an initial pltime of 604800, an the post-rebind reply had the same. That might be why I'm not sending out a CONFIRM? |
I think the expired lease is the key, I was just able to reproduce your log if I did a rebind shortly after an ia_na request.
|
Does it use monotonic time to determine lease expired? The only thing I can think of is that the original lease was prior to TimeOfDay being updated from epoch. |
I think I have a cause. DHCPv4 drops into EXPIRE. DHCPv6 is supposed to drop into dhpc6_startdiscoinform() But for whatever reason it's not. I think when it discards the lease and sets the bytes to zero, it's not returning an error on the lease, which makes dhcp6 think it can try the rebind again, but the state has been reset to "INIT". So a Reply without a Solicit is invalid. |
Couple of notes for patch I'm going to work on.
The other is expired lease file handling in dhcpv6. We should be triggering a discovery if the lease file is expired, and I don't think it's currently correctly doing that, because the RA isn't there and it's not aware that the user requested it after initial bootup. Not sure how best to handle that, maybe flag it so when we check for FORCED_IA it could also trigger init? Something for me to work on on Monday. |
If I fix the lease file time to be compared to monotonic, then it bypasses this whole issue and works the same way your log does. Renews, and exit-hooks with REBOOT6. I may split this into two issues, as the timing one is a simple fix, the other will require more thought, maybe set a flag that the system had previously had a successful IA_NA without RA, so try it again. |
I disagree. File time is based on the wall clock, not the monotonic clock. |
Good point. Ok, I'll look into the state further. I think it's checking for FORCED_IA, and not seeing it, nor RA, so it's dropping back into rebind attempt. So maybe "user previously requested IA and it was successful" could be used as a flag to at least attempt DISCOVER state again. |
I don't suppose this patch fixes the issue?
|
Yes, now rebind just triggers a reconfigure, expires the ipv6 lease, then tries the RS cycle and times out after no RA. I will look into a different way to deal with the forced IA_NA situation. |
dhcpcd 10.1.10 on linux
dhcpcd --rebind on DHCPv6, server responds with valid Reply, but dhcpcd rejects it.
dhcpcd[3644]: eth0: invalid state for DHCP6 type REPLY6 (7)
https://support.huawei.com/enterprise/en/doc/EDOC1100306163/d427e938/introduction-to-dhcpv6-messages
In response to a Solicit, Request, Renew, or Rebind message received from a DHCPv6 client. In this situation, the Reply message contains IPv6 addresses and configuration parameters.
Reply is a valid response to a Rebind request, so I will investigate further to see what specifically it didn't like.
EDIT: Setup is when RA was not seen, so we used --rebind --ia_na to request an address. This succeeded, we got a lease, but then when it comes to renew, the lack of RA seems to prevent dhcp6 from attempting a renew, and rebind attempts fail.
The text was updated successfully, but these errors were encountered: