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

bug: DHCPv6 does not respect prefix assigned to interface (<=/64) #199

Open xvzf opened 1 year ago

xvzf commented 1 year ago

When odhcpd hands out IPv6 leases on an interface with a prefix <=/64 (e.g. /96), leases can (and often are) outside of the allocated /96 on the interface. I've looked a bit at the code and it seems the host_id calculation always infers 64bit, thus a /64 prefix. I would've expected odhcpd in DHCPv6 server mode, to actually respect the assigned prefix.

Are you open PR to fix this?

dguglielmi commented 2 months ago

Same issue for me with a /96. @xvzf I saw you close your PR, but your patch work great for me (Except for a typo "return return 0;". Is it safe to use it ?

xvzf commented 2 months ago

yeah, I've been using it since a while - I'll fix the upstream PR and will re-open it 🤞

xvzf commented 2 months ago

@dguglielmi feel free to upvote the PR/ comment you tested it - might help getting this upstream