From: Pravin B Shelar Date: Tue, 13 Mar 2012 18:40:58 +0000 (-0700) Subject: ofproto: Fix internal port mtu setting. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=199253134cdf556647b45bb882b4b6e8af4c1669;p=openvswitch ofproto: Fix internal port mtu setting. 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 --- diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c index b660a1bb..6ce587d6 100644 --- a/ofproto/ofproto.c +++ b/ofproto/ofproto.c @@ -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; } } }