← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1953139] Re: On IPv6 overlay networks linuxbridge vxlans are created always on loopback device

 

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 <tamasgp@xxxxxxxxxxxxx>
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

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

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

Status in neutron:
  Fix Released

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)

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



References