summaryrefslogtreecommitdiffstats
path: root/sys/netinet
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
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')
-rw-r--r--sys/netinet/ip_output.c16
-rw-r--r--sys/netinet/tcp_output.c14
-rw-r--r--sys/netinet/tcp_subr.c8
-rw-r--r--sys/netinet/tcp_timewait.c8
-rw-r--r--sys/netinet/tcp_var.h5
5 files changed, 36 insertions, 15 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;
}
diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c
index b14d645..9afaf97 100644
--- a/sys/netinet/tcp_output.c
+++ b/sys/netinet/tcp_output.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)tcp_output.c 8.4 (Berkeley) 5/24/95
- * $Id: tcp_output.c,v 1.13 1995/09/20 21:00:58 wollman Exp $
+ * $Id: tcp_output.c,v 1.14 1995/09/22 20:05:58 wollman Exp $
*/
#include <sys/param.h>
@@ -689,6 +689,18 @@ out:
tcp_quench(tp->t_inpcb, 0);
return (0);
}
+#ifdef MTUDISC
+ if (error == EMSGSIZE) {
+ /*
+ * ip_output() will have already fixed the route
+ * for us. tcp_mtudisc() will, as its last action,
+ * initiate retransmission, so it is important to
+ * not do so here.
+ */
+ tcp_mtudisc(tp->t_inpcb, 0);
+ return 0;
+ }
+#endif /* MTUDISC */.
if ((error == EHOSTUNREACH || error == ENETDOWN)
&& TCPS_HAVERCVDSYN(tp->t_state)) {
tp->t_softerror = error;
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c
index 4042083..b0b75b8 100644
--- a/sys/netinet/tcp_subr.c
+++ b/sys/netinet/tcp_subr.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)tcp_subr.c 8.2 (Berkeley) 5/24/95
- * $Id: tcp_subr.c,v 1.18 1995/10/10 17:45:40 wollman Exp $
+ * $Id: tcp_subr.c,v 1.19 1995/10/12 17:37:24 wollman Exp $
*/
#include <sys/param.h>
@@ -429,10 +429,6 @@ tcp_notify(inp, error)
sowwakeup(so);
}
-#ifdef MTUDISC
-static void tcp_mtudisc __P((struct inpcb *, int));
-#endif /* MTUDISC */
-
void
tcp_ctlinput(cmd, sa, ip)
int cmd;
@@ -481,7 +477,7 @@ tcp_quench(inp, errno)
* since we know the packet we just sent was dropped.
* This duplicates some code in the tcp_mss() function in tcp_input.c.
*/
-static void
+void
tcp_mtudisc(inp, errno)
struct inpcb *inp;
int errno;
diff --git a/sys/netinet/tcp_timewait.c b/sys/netinet/tcp_timewait.c
index 4042083..b0b75b8 100644
--- a/sys/netinet/tcp_timewait.c
+++ b/sys/netinet/tcp_timewait.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)tcp_subr.c 8.2 (Berkeley) 5/24/95
- * $Id: tcp_subr.c,v 1.18 1995/10/10 17:45:40 wollman Exp $
+ * $Id: tcp_subr.c,v 1.19 1995/10/12 17:37:24 wollman Exp $
*/
#include <sys/param.h>
@@ -429,10 +429,6 @@ tcp_notify(inp, error)
sowwakeup(so);
}
-#ifdef MTUDISC
-static void tcp_mtudisc __P((struct inpcb *, int));
-#endif /* MTUDISC */
-
void
tcp_ctlinput(cmd, sa, ip)
int cmd;
@@ -481,7 +477,7 @@ tcp_quench(inp, errno)
* since we know the packet we just sent was dropped.
* This duplicates some code in the tcp_mss() function in tcp_input.c.
*/
-static void
+void
tcp_mtudisc(inp, errno)
struct inpcb *inp;
int errno;
diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h
index b2703ae..0a1ce27 100644
--- a/sys/netinet/tcp_var.h
+++ b/sys/netinet/tcp_var.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)tcp_var.h 8.4 (Berkeley) 5/24/95
- * $Id: tcp_var.h,v 1.19 1995/10/10 17:45:43 wollman Exp $
+ * $Id: tcp_var.h,v 1.20 1995/10/12 17:37:25 wollman Exp $
*/
#ifndef _NETINET_TCP_VAR_H_
@@ -349,6 +349,9 @@ void tcp_init __P((void));
void tcp_input __P((struct mbuf *, int));
void tcp_mss __P((struct tcpcb *, int));
int tcp_mssopt __P((struct tcpcb *));
+#ifdef MTUDISC
+void tcp_mtudisc __P((struct inpcb *, int));
+#endif /* MTUDISC */
struct tcpcb *
tcp_newtcpcb __P((struct inpcb *));
void tcp_notify __P((struct inpcb *, int));
OpenPOWER on IntegriCloud