Merge "fix kury-cni exits unexpectedly when MTU of network is 0"

This commit is contained in:
Zuul 2018-03-26 18:51:23 +00:00 committed by Gerrit Code Review
commit 19fc0a8eae
2 changed files with 13 additions and 2 deletions

View File

@ -43,10 +43,18 @@ class BaseBridgeDriver(health.HealthHandler):
with h_ipdb.interfaces[host_ifname] as h_iface:
h_iface.remove()
if vif.network.mtu:
interface_mtu = vif.network.mtu
else:
LOG.info("Default mtu %(mtu)s is used for interface, "
"for mtu of network if configured with 0",
{"mtu": CONF.neutron_defaults.network_device_mtu})
interface_mtu = CONF.neutron_defaults.network_device_mtu
with b_base.get_ipdb(netns) as c_ipdb:
with c_ipdb.create(ifname=ifname, peer=host_ifname,
kind='veth') as c_iface:
c_iface.mtu = vif.network.mtu
c_iface.mtu = interface_mtu
c_iface.address = str(vif.address)
c_iface.up()
@ -56,7 +64,7 @@ class BaseBridgeDriver(health.HealthHandler):
with b_base.get_ipdb() as h_ipdb:
with h_ipdb.interfaces[host_ifname] as h_iface:
h_iface.mtu = vif.network.mtu
h_iface.mtu = interface_mtu
h_iface.up()
def disconnect(self, vif, ifname, netns):

View File

@ -170,6 +170,9 @@ neutron_defaults = [
cfg.StrOpt('external_svc_subnet',
help=_("Optional external subnet ID for Kubernetes services"),
default=None),
cfg.IntOpt('network_device_mtu',
help='Default MTU setting for network interface.',
default=1500,),
]
octavia_defaults = [