On IPv6 overlay networks linuxbridge vxlans are created always on loopback device

Bug #1953139 reported by Tamas Gergely Peter
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
High
Tamas Gergely Peter

Bug Description

Neutron looks up for vxlan parent devices by IFA_LABEL attribute returned from pyroute2.
If I set up IPv4 overlay network, this works without issues.

But when I setup an IPv6 overlay, always the device with index 0 (usually "lo") is being returned by get_devices_with_ip because the device structure returned for IPv6 addresses doesn't contain IFA_LABEL.

If IFA_LABEL is not found, neutron ip_lib.py tries to find the name of the 'owner' of the address by device index (index is already known here):
for ip_address in ip_addresses:
        index = ip_address['index']
        name = get_attr(ip_address, 'IFA_LABEL') or devices.get(index)
        if not name:
            device = get_devices_info(namespace, index=index)
            if not device:
                continue
            name = device[0]['name']

However priviliged/agent/linux/ip_lib.py get_link_devices() doesn't use the index kwarg correctly, and returns all devices in the system, and the code above always returns the first device in the list.

My solution is now to transform get_link_devices() to pass arguments to ip.get_links() correctly:

--- ip_lib.py.orig 2021-12-03 10:28:40.312266929 +0000
+++ ip_lib.py 2021-12-03 10:26:33.337486559 +0000
@@ -564,7 +564,10 @@
     """
     try:
         with get_iproute(namespace) as ip:
- return make_serializable(ip.get_links(**kwargs))
+ if "index" in kwargs:
+ return make_serializable(ip.get_links(kwargs['index']))
+ else:
+ return make_serializable(ip.get_links(**kwargs))
     except OSError as e:
         if e.errno == errno.ENOENT:
             raise NetworkNamespaceNotFound(netns_name=namespace)

tags: added: ipv6 linuxbridge
Revision history for this message
Lajos Katona (lajos-katona) wrote :

Thanks for the bug report and the detailed analysis.

Changed in neutron:
status: New → Confirmed
importance: Undecided → High
Changed in neutron:
assignee: nobody → Tamas Gergely Peter (tamasgp)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/neutron/+/820484

Changed in neutron:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.opendev.org/c/openstack/neutron/+/820484
Committed: https://opendev.org/openstack/neutron/commit/3727103ce7c691793a0b02c0870ebb41c95f0cfd
Submitter: "Zuul (22348)"
Branch: master

commit 3727103ce7c691793a0b02c0870ebb41c95f0cfd
Author: Tamas Gergely Peter <email address hidden>
Date: Mon Dec 6 09:39:55 2021 +0000

    Fix get_link_devices() with index argument

    If get_link_devices() is called with 'index' in kwargs, pass the
    argument to ip.get_links() correctly

    Closes-Bug: #1953139
    Change-Id: I6ae2d8c2a27aef548dd186e495c8998bf4086a20

Changed in neutron:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 22.0.0.0rc1

This issue was fixed in the openstack/neutron 22.0.0.0rc1 release candidate.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.