Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-6]: src/sys/netinet Pull up revision 1.80 (requested by tls in ...



details:   https://anonhg.NetBSD.org/src/rev/38a89e891a7a
branches:  netbsd-1-6
changeset: 530646:38a89e891a7a
user:      tron <tron%NetBSD.org@localhost>
date:      Fri Sep 05 13:42:39 2003 +0000

description:
Pull up revision 1.80 (requested by tls in ticket #1445):
path MTU discovery blackhole detection.
PR 12790 (sorry for not committing it for a long time)

diffstat:

 sys/netinet/tcp_output.c |  15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diffs (61 lines):

diff -r 91fcaaa378bb -r 38a89e891a7a sys/netinet/tcp_output.c
--- a/sys/netinet/tcp_output.c  Fri Sep 05 13:42:31 2003 +0000
+++ b/sys/netinet/tcp_output.c  Fri Sep 05 13:42:39 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tcp_output.c,v 1.79.4.3 2002/11/30 14:31:59 he Exp $   */
+/*     $NetBSD: tcp_output.c,v 1.79.4.4 2003/09/05 13:42:39 tron Exp $ */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -142,7 +142,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tcp_output.c,v 1.79.4.3 2002/11/30 14:31:59 he Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tcp_output.c,v 1.79.4.4 2003/09/05 13:42:39 tron Exp $");
 
 #include "opt_inet.h"
 #include "opt_ipsec.h"
@@ -276,12 +276,12 @@
        ifp = rt->rt_ifp;
 
        size = tcp_mssdflt;
-       if (rt->rt_rmx.rmx_mtu != 0)
+       if (tp->t_mtudisc && rt->rt_rmx.rmx_mtu != 0)
                size = rt->rt_rmx.rmx_mtu - iphlen - sizeof(struct tcphdr);
        else if (ifp->if_flags & IFF_LOOPBACK)
                size = ifp->if_mtu - iphlen - sizeof(struct tcphdr);
 #ifdef INET
-       else if (inp && ip_mtudisc)
+       else if (inp && tp->t_mtudisc)
                size = ifp->if_mtu - iphlen - sizeof(struct tcphdr);
        else if (inp && in_localaddr(inp->inp_faddr))
                size = ifp->if_mtu - iphlen - sizeof(struct tcphdr);
@@ -293,7 +293,7 @@
                        /* mapped addr case */
                        struct in_addr d;
                        bcopy(&in6p->in6p_faddr.s6_addr32[3], &d, sizeof(d));
-                       if (ip_mtudisc || in_localaddr(d))
+                       if (tp->t_mtudisc || in_localaddr(d))
                                size = ifp->if_mtu - iphlen - sizeof(struct tcphdr);
                } else
 #endif
@@ -302,7 +302,8 @@
                         * for IPv6, path MTU discovery is always turned on,
                         * or the node must use packet size <= 1280.
                         */
-                       size = ifp->if_mtu - iphlen - sizeof(struct tcphdr);
+                       size = tp->t_mtudisc ? ifp->if_mtu : IPV6_MMTU;
+                       size -= (iphlen + sizeof(struct tcphdr));
                }
        }
 #endif
@@ -1134,7 +1135,7 @@
                else
                        opts = NULL;
                error = ip_output(m, opts, ro,
-                       (ip_mtudisc ? IP_MTUDISC : 0) |
+                       (tp->t_mtudisc ? IP_MTUDISC : 0) |
                        (so->so_options & SO_DONTROUTE),
                        0);
                break;



Home | Main Index | Thread Index | Old Index