ofproto: Fix code that keeps track of MTU.
authorBen Pfaff <blp@nicira.com>
Mon, 12 Mar 2012 19:59:47 +0000 (12:59 -0700)
committerBen Pfaff <blp@nicira.com>
Mon, 12 Mar 2012 20:26:00 +0000 (13:26 -0700)
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 <blp@nicira.com>
ofproto/ofproto.c

index f6cb806..a77063a 100644 (file)
@@ -1357,8 +1357,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;
     }