Path MTU Discovery is now standard.

This commit is contained in:
Garrett Wollman 1995-12-05 17:46:50 +00:00
parent 21864bc400
commit b7a44e3486
8 changed files with 37 additions and 41 deletions

View File

@ -26,7 +26,7 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: in_rmx.c,v 1.19 1995/11/14 20:34:06 phk Exp $
* $Id: in_rmx.c,v 1.20 1995/12/02 19:37:56 bde Exp $
*/
/*
@ -65,9 +65,9 @@
#include <netinet/tcp_seq.h>
#include <netinet/tcp_timer.h>
#include <netinet/tcp_var.h>
#ifndef MTUDISC
#if 0
#include <netinet/tcpip.h>
#endif /* not MTUDISC */
#endif
extern int in_inithead __P((void **head, int off));
extern void in_rtqdrain __P((void));
@ -110,22 +110,22 @@ in_addroute(void *v_arg, void *n_arg, struct radix_node_head *head,
if (!rt->rt_rmx.rmx_recvpipe && !(rt->rt_rmx.rmx_locks & RTV_RPIPE))
rt->rt_rmx.rmx_recvpipe = tcp_recvspace;
#ifndef MTUDISC
#if 0
/*
* Finally, set an MTU, again duplicating logic in TCP.
* The in_localaddr() business will go away when we have
* proper PMTU discovery.
*/
#endif /* not MTUDISC */
#endif
if (!rt->rt_rmx.rmx_mtu && !(rt->rt_rmx.rmx_locks & RTV_MTU)
&& rt->rt_ifp)
#ifndef MTUDISC
#if 0
rt->rt_rmx.rmx_mtu = (in_localaddr(sin->sin_addr)
? rt->rt_ifp->if_mtu
: tcp_mssdflt + sizeof(struct tcpiphdr));
#else /* MTUDISC */
#else
rt->rt_rmx.rmx_mtu = rt->rt_ifp->if_mtu;
#endif /* MTUDISC */
#endif
return rn_addroute(v_arg, n_arg, head, treenodes);
}

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)ip_icmp.c 8.2 (Berkeley) 1/4/94
* $Id: ip_icmp.c,v 1.11 1995/11/14 20:34:12 phk Exp $
* $Id: ip_icmp.c,v 1.12 1995/11/18 13:25:41 bde Exp $
*/
#include <sys/param.h>
@ -310,7 +310,7 @@ icmp_input(m, hlen)
printf("deliver to protocol %d\n", icp->icmp_ip.ip_p);
#endif
icmpsrc.sin_addr = icp->icmp_ip.ip_dst;
#ifdef MTUDISC
#if 1
/*
* MTU discovery:
* If we got a needfrag and there is a host route to the
@ -338,8 +338,8 @@ icmp_input(m, hlen)
mtu = ip_next_mtu(rt->rt_rmx.rmx_mtu,
1);
if (!mtu || mtu < 296) {
rt->rt_rmx.rmx_mtu =
rt->rt_ifp->if_mtu;
/* rt->rt_rmx.rmx_mtu =
rt->rt_ifp->if_mtu; */
rt->rt_rmx.rmx_locks |= RTV_MTU;
} else if (rt->rt_rmx.rmx_mtu > mtu) {
rt->rt_rmx.rmx_mtu = mtu;
@ -349,7 +349,7 @@ icmp_input(m, hlen)
RTFREE(rt);
}
#endif /* MTUDISC */
#endif
ctlfunc = inetsw[ip_protox[icp->icmp_ip.ip_p]].pr_ctlinput;
if (ctlfunc)
(*ctlfunc)(code, (struct sockaddr *)&icmpsrc,
@ -636,7 +636,7 @@ iptime()
return (htonl(t));
}
#ifdef MTUDISC
#if 1
/*
* Return the next larger or smaller MTU plateau (table from RFC 1191)
* given current value MTU. If DIR is less than zero, a larger plateau
@ -674,4 +674,4 @@ ip_next_mtu(mtu, dir)
}
}
}
#endif /* MTUDISC */
#endif

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)ip_output.c 8.3 (Berkeley) 1/21/94
* $Id: ip_output.c,v 1.24 1995/10/16 18:21:09 wollman Exp $
* $Id: ip_output.c,v 1.25 1995/11/14 20:34:19 phk Exp $
*/
#include <sys/param.h>
@ -337,7 +337,7 @@ sendit:
*/
if (ip->ip_off & IP_DF) {
error = EMSGSIZE;
#ifdef MTUDISC
#if 1
/*
* This case can happen if the user changed the MTU
* of an interface after enabling IP on it. Because
@ -350,7 +350,7 @@ sendit:
&& (ro->ro_rt->rt_rmx.rmx_mtu > ifp->if_mtu)) {
ro->ro_rt->rt_rmx.rmx_mtu = ifp->if_mtu;
}
#endif /* MTUDISC */
#endif
ipstat.ips_cantfrag++;
goto bad;
}

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)ip_var.h 8.2 (Berkeley) 1/9/95
* $Id: ip_var.h,v 1.15 1995/09/21 18:04:43 wollman Exp $
* $Id: ip_var.h,v 1.16 1995/11/14 20:34:21 phk Exp $
*/
#ifndef _NETINET_IP_VAR_H_
@ -169,9 +169,7 @@ void ip_freemoptions __P((struct ip_moptions *));
void ip_init __P((void));
extern int (*ip_mforward) __P((struct ip *, struct ifnet *, struct mbuf *,
struct ip_moptions *));
#ifdef MTUDISC
int ip_next_mtu __P((int, int));
#endif /* MTUDISC */
int ip_output __P((struct mbuf *,
struct mbuf *, struct route *, int, struct ip_moptions *));
void ip_slowtimo __P((void));

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)tcp_output.c 8.4 (Berkeley) 5/24/95
* $Id: tcp_output.c,v 1.15 1995/10/16 18:21:12 wollman Exp $
* $Id: tcp_output.c,v 1.16 1995/11/03 22:08:08 olah Exp $
*/
#include <sys/param.h>
@ -653,13 +653,13 @@ send:
else
#endif
{
#ifdef MTUDISC
#if 1
struct rtentry *rt;
#endif
((struct ip *)ti)->ip_len = m->m_pkthdr.len;
((struct ip *)ti)->ip_ttl = tp->t_inpcb->inp_ip.ip_ttl; /* XXX */
((struct ip *)ti)->ip_tos = tp->t_inpcb->inp_ip.ip_tos; /* XXX */
#ifdef MTUDISC
#if 1
/*
* See if we should do MTU discovery. We do it only if the following
* are true:
@ -672,7 +672,7 @@ send:
&& !(rt->rt_rmx.rmx_locks & RTV_MTU)) {
((struct ip *)ti)->ip_off |= IP_DF;
}
#endif /* MTUDISC */
#endif
error = ip_output(m, tp->t_inpcb->inp_options, &tp->t_inpcb->inp_route,
so->so_options & SO_DONTROUTE, 0);
}
@ -682,7 +682,7 @@ out:
tcp_quench(tp->t_inpcb, 0);
return (0);
}
#ifdef MTUDISC
#if 1
if (error == EMSGSIZE) {
/*
* ip_output() will have already fixed the route
@ -693,7 +693,7 @@ out:
tcp_mtudisc(tp->t_inpcb, 0);
return 0;
}
#endif /* MTUDISC */.
#endif
if ((error == EHOSTUNREACH || error == ENETDOWN)
&& TCPS_HAVERCVDSYN(tp->t_state)) {
tp->t_softerror = error;

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)tcp_subr.c 8.2 (Berkeley) 5/24/95
* $Id: tcp_subr.c,v 1.21 1995/11/09 20:23:05 phk Exp $
* $Id: tcp_subr.c,v 1.22 1995/11/14 20:34:41 phk Exp $
*/
#include <sys/param.h>
@ -454,10 +454,10 @@ tcp_ctlinput(cmd, sa, ip)
if (cmd == PRC_QUENCH)
notify = tcp_quench;
#ifdef MTUDISC
#if 1
else if (cmd == PRC_MSGSIZE)
notify = tcp_mtudisc;
#endif /* MTUDISC */
#endif
else if (!PRC_IS_REDIRECT(cmd) &&
((unsigned)cmd > PRC_NCMDS || inetctlerrmap[cmd] == 0))
return;
@ -484,7 +484,7 @@ tcp_quench(inp, errno)
tp->snd_cwnd = tp->t_maxseg;
}
#ifdef MTUDISC
#if 1
/*
* When `need fragmentation' ICMP is received, update our idea of the MSS
* based on the new value in the route. Also nudge TCP to send something,
@ -541,7 +541,7 @@ tcp_mtudisc(inp, errno)
tcp_output(tp);
}
}
#endif /* MTUDISC */
#endif
/*
* Look-up the routing entry to the peer of this inpcb. If no route

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)tcp_subr.c 8.2 (Berkeley) 5/24/95
* $Id: tcp_subr.c,v 1.21 1995/11/09 20:23:05 phk Exp $
* $Id: tcp_subr.c,v 1.22 1995/11/14 20:34:41 phk Exp $
*/
#include <sys/param.h>
@ -454,10 +454,10 @@ tcp_ctlinput(cmd, sa, ip)
if (cmd == PRC_QUENCH)
notify = tcp_quench;
#ifdef MTUDISC
#if 1
else if (cmd == PRC_MSGSIZE)
notify = tcp_mtudisc;
#endif /* MTUDISC */
#endif
else if (!PRC_IS_REDIRECT(cmd) &&
((unsigned)cmd > PRC_NCMDS || inetctlerrmap[cmd] == 0))
return;
@ -484,7 +484,7 @@ tcp_quench(inp, errno)
tp->snd_cwnd = tp->t_maxseg;
}
#ifdef MTUDISC
#if 1
/*
* When `need fragmentation' ICMP is received, update our idea of the MSS
* based on the new value in the route. Also nudge TCP to send something,
@ -541,7 +541,7 @@ tcp_mtudisc(inp, errno)
tcp_output(tp);
}
}
#endif /* MTUDISC */
#endif
/*
* Look-up the routing entry to the peer of this inpcb. If no route

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)tcp_var.h 8.4 (Berkeley) 5/24/95
* $Id: tcp_var.h,v 1.22 1995/11/03 22:08:13 olah Exp $
* $Id: tcp_var.h,v 1.23 1995/11/14 20:34:50 phk Exp $
*/
#ifndef _NETINET_TCP_VAR_H_
@ -344,9 +344,7 @@ 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 */
void tcp_mtudisc __P((struct inpcb *, int));
struct tcpcb *
tcp_newtcpcb __P((struct inpcb *));
int tcp_output __P((struct tcpcb *));