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
162 stars 98 forks source link

dhcpv6: allow creating new bindings on REBIND #102

Closed lkundrak closed 7 years ago

lkundrak commented 7 years ago

There might be unassigned IAs among the options the client sends when it issues a REBIND. In fact, that's how the ISC dhclient reqests new IA_PDs to be assigned. However, odhcpd would just return the IA_PDs back without assigning a prefix:

$ dhclient -6 -d -lf $PWD/leases eth0 -N XMT: Forming Solicit, 0 ms elapsed. XMT: X-- IA_NA 00:3b:dd:9d RCV: Advertise message on eth2 from fe80::5054:ff:feba:444e. RCV: X-- IA_NA 00:3b:dd:9d ^C $ dhclient -6 -d -lf $PWD/leases eth0 -N -P XMT: Forming Rebind, 0 ms elapsed. XMT: X-- IA_NA 00:3b:dd:9d XMT: X-- IA_PD 00:3b:dd:9d RCV: Reply message on eth2 from fe80::5054:ff:feba:444e. RCV: X-- IA_NA 00:3b:dd:9d RCV: X-- IA_PD 00:3b:dd:9d RCV: | !-- Status code of no prefix, IA_PD discarded.

That is neither too useful, nor consistent with what the ISC dhcpcd does, nor does it seem correct. Notably, it breaks NetworkManager's IPv6 connection sharing that utilizes the ISC dhclient and needs to request the prefixes as-needed on networks with OpenWRT.

The attached patch moves the REBIND handling to the branch that is able to add new bindings. It then, perhaps unnecessarily, also allows obtaining new IA_NAs this way.

(While the patch fixes the issue for me, I'm not too familiar with the odhcpd code base, so a careful review is needed.)

dedeckeh commented 7 years ago

odhcpd is now actively maintained by the Lede community and uses the git repo https://git.lede-project.org/project/odhcpd.git. Can you rebase your patch on this version and send it as a patch to the Lede devel mailing list (lede-dev@lists.infradead.org) for review ?

lkundrak commented 7 years ago

Done http://lists.infradead.org/pipermail/lede-dev/2017-April/007015.html Thank you

dedeckeh commented 7 years ago

Thx will have a look at the patch

dedeckeh commented 7 years ago

I've pushed a patch https://git.lede-project.org/?p=project/odhcpd.git;a=commit;h=adc8f6269d82f526e225fd8d4b78388fc2da0659 which fixes the issue