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.
This commit is contained in:
parent
1c55fdbaae
commit
e52c654ee2
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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));
|
||||
|
Loading…
x
Reference in New Issue
Block a user