DHCP server crashes on networks where IPv6 addresses were supplied unshortened
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
neutron |
Fix Released
|
Undecided
|
Xu Han Peng |
Bug Description
Added a subnet as shown below.
neutron subnet-create HA1 fd5f:5d21:
I wasn't necessarily expecting DHCP to work for IPv6, but it stopped working for IPv4. In the log, I saw that the DHCP server had begun failing with the error:
http://
After a little digging in the code, I realised the DHCP agent was trying to re-add an address (for the DHCP server) that already existed. I'm pretty sure the problem happens in init_l3 in interface.py, where desired addresses are compared with existing addresses returned by "ip addr show". Since "show" returns IPv6 addresses in shortened form (i.e. with unnecessary 0s removed), and the starting address I specified when creating the subnet is unshortened, the comparison fails and the agent tries to add the address again, which fails and causes the DHCP agent to abort startup.
Of course, it's possible the failure to convert IPv6 addresses into shortened form (or enforce entry only in shortened form) could have other effects that I haven't observed.
Workaround: Specify all IPv6 addresses in shortened form when setting up subnets. The given Exception stops happening. (Though I've subsequently run into Bug 1257446 which also prevents dual-stack operation.)
tags: | added: ipv6 |
Changed in neutron: | |
milestone: | none → juno-1 |
status: | Fix Committed → Fix Released |
Changed in neutron: | |
milestone: | juno-1 → 2014.2 |
We can shorten the IPv6 address before comparing it with existing addresses by "netaddr. strategy. ipv6.int_ to_str( ip.value) "
I will try to submit a change soon.