Skip to content
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: allow creating new bindings on REBIND #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lkundrak
Copy link

@lkundrak lkundrak commented Feb 6, 2017

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.)

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.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant