From 199253134cdf556647b45bb882b4b6e8af4c1669 Mon Sep 17 00:00:00 2001 From: Pravin B Shelar Date: Tue, 13 Mar 2012 11:40:58 -0700 Subject: [PATCH] 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 --- ofproto/ofproto.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) 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; } } } -- 2.30.2