From owner-freebsd-net@FreeBSD.ORG Wed Jul 11 21:29:08 2012 Return-Path: Delivered-To: net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE6991065674 for ; Wed, 11 Jul 2012 21:29:08 +0000 (UTC) (envelope-from gnn@neville-neil.com) Received: from vps.hungerhost.com (vps.hungerhost.com [216.38.53.176]) by mx1.freebsd.org (Postfix) with ESMTP id 8FCC18FC16 for ; Wed, 11 Jul 2012 21:29:08 +0000 (UTC) Received: from [209.249.190.124] (port=16652 helo=punk.neville-neil.com.neville-neil.com) by vps.hungerhost.com with esmtpa (Exim 4.77) (envelope-from ) id 1Sp4Sz-0000QF-HR for net@freebsd.org; Wed, 11 Jul 2012 17:29:01 -0400 Date: Wed, 11 Jul 2012 17:30:33 -0400 Message-ID: <86liiqrnnq.wl%gnn@neville-neil.com> From: gnn@freebsd.org To: net@freebsd.org User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/23.4 (amd64-portbld-freebsd10.0) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - vps.hungerhost.com X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - neville-neil.com Cc: Subject: Interface MTU question... X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jul 2012 21:29:08 -0000 Howdy, Does anyone know the reason for this particular check in ip_output.c? if (rte != NULL && (rte->rt_flags & (RTF_UP|RTF_HOST))) { /* * This case can happen if the user changed the MTU * of an interface after enabling IP on it. Because * most netifs don't keep track of routes pointing to * them, there is no way for one to update all its * routes when the MTU is changed. */ if (rte->rt_rmx.rmx_mtu > ifp->if_mtu) rte->rt_rmx.rmx_mtu = ifp->if_mtu; mtu = rte->rt_rmx.rmx_mtu; } else { mtu = ifp->if_mtu; } To my mind the > ought to be != so that any change, up or down, of the interface MTU is eventually reflected in the route. Also, this code does not check if it is both a HOST route and UP, but only if it is one other the other, so don't be fooled by that, this check happens for any route we have if it's up. My proposed change is this: Index: ip_output.c =================================================================== --- ip_output.c (revision 225561) +++ ip_output.c (working copy) @@ -320,7 +320,7 @@ * them, there is no way for one to update all its * routes when the MTU is changed. */ - if (rte->rt_rmx.rmx_mtu > ifp->if_mtu) + if (rte->rt_rmx.rmx_mtu != ifp->if_mtu) rte->rt_rmx.rmx_mtu = ifp->if_mtu; mtu = rte->rt_rmx.rmx_mtu; } else { Please let me know what y'all think. Best, George