← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 2120758] [NEW] Dual-stack networks are not handled correct by OVS DHCP plugin

 

Public bug reported:

There is no guarantee in order of fixed IPs in case of dual-stack
network in OpenStack.

```
2025-08-14 15:15:54.419 7 ERROR os_ken.base.app_manager [None req-8c76fa94-0bc9-457b-958c-0a367b9eabb8 - - - - - -] DHCPv6Responder: Exception occurred during handler processing. Backtrace from offending handler [packet_in_handler] servicing event [EventOFPPacketIn] follows.: netaddr.core.AddrFormatError: invalid partial IPv4 address: 'ffff:ffff:ffff:ffff::'!
2025-08-14 15:15:54.419 7 ERROR os_ken.base.app_manager netaddr.core.AddrFormatError: 'ffff:ffff:ffff:ffff::' is not a valid IPv4 address string!
2025-08-14 15:15:54.419 7 ERROR os_ken.base.app_manager netaddr.core.AddrFormatError: base address 'ffff:ffff:ffff:ffff::' is not IPv4
2025-08-14 15:15:54.419 7 ERROR os_ken.base.app_manager netaddr.core.AddrFormatError: 'ffff:ffff:ffff:ffff::' is not a valid IPv4 address string!
2025-08-14 15:15:54.419 7 ERROR os_ken.base.app_manager netaddr.core.AddrFormatError: base address 'ffff:ffff:ffff:ffff::' is not IPv4
2025-08-14 15:15:54.419 7 ERROR os_ken.base.app_manager netaddr.core.AddrFormatError: invalid partial IPv4 address: 'ffff:ffff:ffff:ffff::'!
```

Since that there is rare chance that neutron-openvswitch-agent's DHCP plugin will offer wrong ipv6 address in reply for DHCP operation. 
Reason is that get_dhcp_options in ipv4 DHCP handler is sure that first item of fixed IPs is ipv4 but there is no guarantee. Probably a typo.

```
def get_dhcp_options(self, port_info, is_ack=False):
        fixed_ips = port_info['fixed_ips']
        net = netaddr.IPNetwork(fixed_ips[0]['cidr'])
        dns_nameservers = fixed_ips[0]['dns_nameservers']
        host_routes = fixed_ips[0]['host_routes']
        gateway_ip = fixed_ips[0]['gateway_ip']

```

** Affects: neutron
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/2120758

Title:
  Dual-stack networks are not handled correct by OVS DHCP plugin

Status in neutron:
  New

Bug description:
  There is no guarantee in order of fixed IPs in case of dual-stack
  network in OpenStack.

  ```
  2025-08-14 15:15:54.419 7 ERROR os_ken.base.app_manager [None req-8c76fa94-0bc9-457b-958c-0a367b9eabb8 - - - - - -] DHCPv6Responder: Exception occurred during handler processing. Backtrace from offending handler [packet_in_handler] servicing event [EventOFPPacketIn] follows.: netaddr.core.AddrFormatError: invalid partial IPv4 address: 'ffff:ffff:ffff:ffff::'!
  2025-08-14 15:15:54.419 7 ERROR os_ken.base.app_manager netaddr.core.AddrFormatError: 'ffff:ffff:ffff:ffff::' is not a valid IPv4 address string!
  2025-08-14 15:15:54.419 7 ERROR os_ken.base.app_manager netaddr.core.AddrFormatError: base address 'ffff:ffff:ffff:ffff::' is not IPv4
  2025-08-14 15:15:54.419 7 ERROR os_ken.base.app_manager netaddr.core.AddrFormatError: 'ffff:ffff:ffff:ffff::' is not a valid IPv4 address string!
  2025-08-14 15:15:54.419 7 ERROR os_ken.base.app_manager netaddr.core.AddrFormatError: base address 'ffff:ffff:ffff:ffff::' is not IPv4
  2025-08-14 15:15:54.419 7 ERROR os_ken.base.app_manager netaddr.core.AddrFormatError: invalid partial IPv4 address: 'ffff:ffff:ffff:ffff::'!
  ```

  Since that there is rare chance that neutron-openvswitch-agent's DHCP plugin will offer wrong ipv6 address in reply for DHCP operation. 
  Reason is that get_dhcp_options in ipv4 DHCP handler is sure that first item of fixed IPs is ipv4 but there is no guarantee. Probably a typo.

  ```
  def get_dhcp_options(self, port_info, is_ack=False):
          fixed_ips = port_info['fixed_ips']
          net = netaddr.IPNetwork(fixed_ips[0]['cidr'])
          dns_nameservers = fixed_ips[0]['dns_nameservers']
          host_routes = fixed_ips[0]['host_routes']
          gateway_ip = fixed_ips[0]['gateway_ip']

  ```

To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/2120758/+subscriptions