Bugfix - get correct parent MTU

This commit is contained in:
Pim van Pelt
2022-03-13 17:42:16 +00:00
parent 95c8be553f
commit cc0ec92638

View File

@ -251,6 +251,7 @@ def get_mtu(yaml, ifname):
return 1500 if no MTU was set on the sub-int or the parent.""" return 1500 if no MTU was set on the sub-int or the parent."""
iface = get_by_name(yaml, ifname) iface = get_by_name(yaml, ifname)
parent_iface = get_parent_by_name(yaml, ifname) parent_iface = get_parent_by_name(yaml, ifname)
try: try:
return iface['mtu'] return iface['mtu']
return parent_iface['mtu'] return parent_iface['mtu']
@ -274,7 +275,7 @@ def validate_interfaces(yaml):
msgs.append("interface %s does not exist in bondethernets" % ifname) msgs.append("interface %s does not exist in bondethernets" % ifname)
result = False result = False
iface_mtu = get_mtu(yaml, iface) iface_mtu = get_mtu(yaml, ifname)
iface_lcp = has_lcp(yaml, ifname) iface_lcp = has_lcp(yaml, ifname)
iface_address = has_address(yaml, ifname) iface_address = has_address(yaml, ifname)