Skip to content
Snippets Groups Projects
Commit be7f54f5 authored by Zuul's avatar Zuul Committed by Gerrit Code Review
Browse files

Merge "Fix MTU of NetworkManager bridge VLAN interfaces"

parents cf640396 ee63b325
No related branches found
No related tags found
No related merge requests found
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
interfaces_ether_interfaces: > interfaces_ether_interfaces: >
{{ network_interfaces | {{ network_interfaces |
net_select_ethers | net_select_ethers |
map('net_interface_obj') | map('net_interface_obj', names=network_interfaces) |
list }} list }}
interfaces_bridge_interfaces: > interfaces_bridge_interfaces: >
{{ network_interfaces | {{ network_interfaces |
......
...@@ -374,7 +374,7 @@ def _validate_rules(rules): ...@@ -374,7 +374,7 @@ def _validate_rules(rules):
@jinja2.pass_context @jinja2.pass_context
def net_interface_obj(context, name, inventory_hostname=None): def net_interface_obj(context, name, inventory_hostname=None, names=None):
"""Return a dict representation of a network interface. """Return a dict representation of a network interface.
The returned dict is compatible with the interfaces_ether_interfaces The returned dict is compatible with the interfaces_ether_interfaces
...@@ -394,6 +394,27 @@ def net_interface_obj(context, name, inventory_hostname=None): ...@@ -394,6 +394,27 @@ def net_interface_obj(context, name, inventory_hostname=None):
netmask = None netmask = None
vlan = net_vlan(context, name, inventory_hostname) vlan = net_vlan(context, name, inventory_hostname)
mtu = net_mtu(context, name, inventory_hostname) mtu = net_mtu(context, name, inventory_hostname)
# NOTE(priteau): do not pass MTU for VLAN interfaces on bridges when it is
# identical to the parent bridge, to work around a NetworkManager bug.
if names is not None and net_is_vlan_interface(context, name,
inventory_hostname):
# Make a mapping of bridge interfaces and their MTUs
bridge_mtus = {}
for bridge in net_select_bridges(context, names, inventory_hostname):
bridge_interface = net_interface(context, bridge,
inventory_hostname)
bridge_mtus[bridge_interface] = net_mtu(context, bridge,
inventory_hostname)
# Get parent and check for its MTU if it is a bridge
parent_or_device = get_vlan_parent(
context, name, device, vlan, inventory_hostname)
if parent_or_device in bridge_mtus:
parent_mtu = bridge_mtus[parent_or_device]
if mtu == parent_mtu:
mtu = None
routes = net_routes(context, name, inventory_hostname) routes = net_routes(context, name, inventory_hostname)
if routes: if routes:
routes = [_route_obj(route) for route in routes] routes = [_route_obj(route) for route in routes]
......
---
fixes:
- |
Adds a workaround to avoid NetworkManager setting the MTU of bridge VLAN
interfaces to an incorrect value.
`LP#2039947 <https://bugs.launchpad.net/kayobe/+bug/2039947>`__
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment