From: Ben Pfaff Date: Mon, 12 Mar 2012 19:59:47 +0000 (-0700) Subject: ofproto: Fix code that keeps track of MTU. X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;ds=sidebyside;h=aaaff75e5b03386581c1d89064c20d126b9141fc;p=sliver-openvswitch.git ofproto: Fix code that keeps track of MTU. ofport_install() should set the MTU that it finds into the ofport before calling set_internal_devs_mtu(), because the latter function might change the MTU and update ofport->mtu and the caller should not incorrectly overwrite its changes. Signed-off-by: Ben Pfaff --- diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c index 8ff552cf9..38a91d861 100644 --- a/ofproto/ofproto.c +++ b/ofproto/ofproto.c @@ -1301,8 +1301,8 @@ ofport_install(struct ofproto *p, shash_add(&p->port_by_name, netdev_name, ofport); if (!netdev_get_mtu(netdev, &dev_mtu)) { - set_internal_devs_mtu(p); ofport->mtu = dev_mtu; + set_internal_devs_mtu(p); } else { ofport->mtu = 0; }