ofproto: Fix internal port mtu setting.
authorPravin B Shelar <pshelar@nicira.com>
Tue, 13 Mar 2012 18:40:58 +0000 (11:40 -0700)
committerPravin B Shelar <pshelar@nicira.com>
Tue, 13 Mar 2012 18:40:58 +0000 (11:40 -0700)
Update port does not check changed MTU for internal port which allows
administrator assign larger MTU compared to non-internal port.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
ofproto/ofproto.c

index b660a1bb12cb5e006feb0ca23685a1f61d570492..6ce587d6be598611648a3cc136596b039dc80283 100644 (file)
@@ -1650,13 +1650,10 @@ update_port(struct ofproto *ofproto, const char *name)
                 ofport_modified(port, &pp);
             }
 
-            /* If this is a non-internal port and the MTU changed, check
-             * if the datapath's MTU needs to be updated. */
-            if (strcmp(netdev_get_type(netdev), "internal")
-                    && !netdev_get_mtu(netdev, &dev_mtu)
-                    && port->mtu != dev_mtu) {
-                set_internal_devs_mtu(ofproto);
+            if (!netdev_get_mtu(netdev, &dev_mtu) &&
+                port->mtu != dev_mtu) {
                 port->mtu = dev_mtu;
+                set_internal_devs_mtu(ofproto);
             }
 
             /* Install the newly opened netdev in case it has changed.
@@ -1757,6 +1754,7 @@ set_internal_devs_mtu(struct ofproto *p)
 
         if (!strcmp(netdev_get_type(netdev), "internal")) {
             netdev_set_mtu(netdev, mtu);
+            ofport->mtu = mtu;
         }
     }
 }