Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 11 Jul 2012 14:57:27 -0700
From:      Navdeep Parhar <np@FreeBSD.org>
To:        gnn@freebsd.org
Cc:        net@freebsd.org
Subject:   Re: Interface MTU question...
Message-ID:  <4FFDF6C7.3030301@FreeBSD.org>
In-Reply-To: <86liiqrnnq.wl%gnn@neville-neil.com>
References:  <86liiqrnnq.wl%gnn@neville-neil.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 07/11/12 14:30, gnn@freebsd.org wrote:
> 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.

I believe rmx_mtu could be low due to some intermediate node between 
this host and the final destination.  An increase in the MTU of the 
local interface should not increase the path MTU if the limit was due to 
someone else along the route.

Regards,
Navdeep

>
> 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
> _______________________________________________
> freebsd-net@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-net
> To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"
>





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4FFDF6C7.3030301>