summaryrefslogtreecommitdiffstats
path: root/sys/netinet/ip_output.c
diff options
context:
space:
mode:
authorwollman <wollman@FreeBSD.org>1995-10-16 18:21:26 +0000
committerwollman <wollman@FreeBSD.org>1995-10-16 18:21:26 +0000
commite52c654ee229f069ca2d720167cb753d60fac19b (patch)
tree7e34325964e07f2b5a18be08e2d8e025855344e1 /sys/netinet/ip_output.c
parent1c55fdbaae54fa424f0c2cd826657d24bab0cbab (diff)
downloadFreeBSD-src-e52c654ee229f069ca2d720167cb753d60fac19b.zip
FreeBSD-src-e52c654ee229f069ca2d720167cb753d60fac19b.tar.gz
The ability to administratively change the MTU of an interface presents
a few new wrinkles for MTU discovery which tcp_output() had better be prepared to handle. ip_output() is also modified to do something helpful in this case, since it has already calculated the information we need.
Diffstat (limited to 'sys/netinet/ip_output.c')
-rw-r--r--sys/netinet/ip_output.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c
index 83e7382..d536a83 100644
--- a/sys/netinet/ip_output.c
+++ b/sys/netinet/ip_output.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)ip_output.c 8.3 (Berkeley) 1/21/94
- * $Id: ip_output.c,v 1.22 1995/07/02 16:45:07 joerg Exp $
+ * $Id: ip_output.c,v 1.23 1995/07/26 18:05:13 wollman Exp $
*/
#include <sys/param.h>
@@ -331,6 +331,20 @@ sendit:
*/
if (ip->ip_off & IP_DF) {
error = EMSGSIZE;
+#ifdef MTUDISC
+ /*
+ * 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 ((ro->ro_rt->rt_flags & (RTF_UP | RTF_HOST))
+ && !(ro->ro_rt->rt_rmx.rmx_locks & RTV_MTU)
+ && (ro->ro_rt->rt_rmx.rmx_mtu > ifp->if_mtu)) {
+ ro->ro_rt->rt_rmx.rmx_mtu = ifp->if_mtu;
+ }
+#endif /* MTUDISC */
ipstat.ips_cantfrag++;
goto bad;
}
OpenPOWER on IntegriCloud