openwrt / odhcpd

This repository is a mirror of https://git.openwrt.org/?p=project/odhcpd.git. Pull requests will be accepted which will be merged in odhcpd.git
GNU General Public License v2.0
160 stars 96 forks source link

dhcpv6: retry failed PD assignments on addrlist change #142

Closed updateing closed 4 years ago

updateing commented 4 years ago

I found that odhcpd stopped distributing prefixes to clients when IPv6 addresses on the serving interface were removed and added again. This happens pretty frequently for me, as my IPv6 addresses come solely from PD by ISP and ISP kills the PPPoE WAN session every two days. Addresses on LAN will absolutely be cleared when WAN goes down.

This change fixes the issue for me but I'm not sure whether this is the best way to do it. I've put my analysis into the commit message, please have a look. Thanks!

updateing commented 4 years ago

A simpler reproduction:

  1. Disable WAN, clear ULA prefix, set something larger than /64 on the LAN. Say 2001:db8:1000::/58.
  2. Reboot the router to make sure everything is in position.
  3. Launch a DHCPv6 client with IA_PD request from LAN. The IA_PD assignment should succeed.
  4. Remove the address from LAN.
  5. Retry the IA_PD request from the same client. No prefix could be obtained at this time.
  6. Add the same address to LAN again.
  7. Retry the IA_PD request from the same client. The request would still fail. The client is expected to obtain a prefix like in step 3.
dedeckeh commented 4 years ago

Thx for the patch; pushed to master (https://git.openwrt.org/?p=project/odhcpd.git;a=commit;h=fd93e36727bc605f6f860759d7710a43bee5215d)