Source-Changes-HG archive

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

[src/trunk]: src/sys/netinet6 implement IPV6_USE_MIN_MTU sockopt. needed by ...



details:   https://anonhg.NetBSD.org/src/rev/1a669c8e8137
branches:  trunk
changeset: 567368:1a669c8e8137
user:      itojun <itojun%NetBSD.org@localhost>
date:      Fri Jun 11 04:10:10 2004 +0000

description:
implement IPV6_USE_MIN_MTU sockopt.  needed by bind9 + EDNS0 + big receive buffer.

diffstat:

 sys/netinet6/in6.h         |   3 ++-
 sys/netinet6/in6_pcb.h     |   6 ++++--
 sys/netinet6/ip6_output.c  |  14 ++++++++++++--
 sys/netinet6/raw_ip6.c     |   6 ++----
 sys/netinet6/udp6_output.c |   6 ++----
 5 files changed, 22 insertions(+), 13 deletions(-)

diffs (153 lines):

diff -r dda7f071158c -r 1a669c8e8137 sys/netinet6/in6.h
--- a/sys/netinet6/in6.h        Fri Jun 11 03:52:00 2004 +0000
+++ b/sys/netinet6/in6.h        Fri Jun 11 04:10:10 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: in6.h,v 1.44 2003/11/12 15:25:19 itojun Exp $  */
+/*     $NetBSD: in6.h,v 1.45 2004/06/11 04:10:10 itojun Exp $  */
 /*     $KAME: in6.h,v 1.83 2001/03/29 02:55:07 jinmei Exp $    */
 
 /*
@@ -410,6 +410,7 @@
 #define IPV6_IPSEC_POLICY      28 /* struct; get/set security policy */
 #endif
 #define IPV6_FAITH             29 /* bool; accept FAITH'ed connections */
+#define IPV6_USE_MIN_MTU       42 /* bool; send packets at the minimum MTU */
 /* to define items, should talk with KAME guys first, for *BSD compatibility */
 
 #define IPV6_RTHDR_LOOSE     0 /* this hop need not be a neighbor. XXX old spec */
diff -r dda7f071158c -r 1a669c8e8137 sys/netinet6/in6_pcb.h
--- a/sys/netinet6/in6_pcb.h    Fri Jun 11 03:52:00 2004 +0000
+++ b/sys/netinet6/in6_pcb.h    Fri Jun 11 04:10:10 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: in6_pcb.h,v 1.24 2003/09/04 09:17:07 itojun Exp $      */
+/*     $NetBSD: in6_pcb.h,v 1.25 2004/06/11 04:10:10 itojun Exp $      */
 /*     $KAME: in6_pcb.h,v 1.45 2001/02/09 05:59:46 itojun Exp $        */
 
 /*
@@ -131,9 +131,11 @@
 #if 0 /* obsoleted */
 #define IN6P_BINDV6ONLY                0x10000000 /* do not grab IPv4 traffic */
 #endif
+#define IN6P_MINMTU            0x20000000 /* use minimum MTU */
 
 #define IN6P_CONTROLOPTS       (IN6P_PKTINFO|IN6P_HOPLIMIT|IN6P_HOPOPTS|\
-                                IN6P_DSTOPTS|IN6P_RTHDR|IN6P_RTHDRDSTOPTS)
+                                IN6P_DSTOPTS|IN6P_RTHDR|IN6P_RTHDRDSTOPTS|\
+                                IN6P_MINMTU)
 
 /* compute hash value for foreign and local in6_addr and port */
 #define IN6_HASH(faddr, fport, laddr, lport)                   \
diff -r dda7f071158c -r 1a669c8e8137 sys/netinet6/ip6_output.c
--- a/sys/netinet6/ip6_output.c Fri Jun 11 03:52:00 2004 +0000
+++ b/sys/netinet6/ip6_output.c Fri Jun 11 04:10:10 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip6_output.c,v 1.82 2004/03/23 18:21:38 martti Exp $   */
+/*     $NetBSD: ip6_output.c,v 1.83 2004/06/11 04:10:10 itojun Exp $   */
 /*     $KAME: ip6_output.c,v 1.172 2001/03/25 09:55:56 itojun Exp $    */
 
 /*
@@ -62,7 +62,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ip6_output.c,v 1.82 2004/03/23 18:21:38 martti Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip6_output.c,v 1.83 2004/06/11 04:10:10 itojun Exp $");
 
 #include "opt_inet.h"
 #include "opt_ipsec.h"
@@ -1348,6 +1348,7 @@
                        case IPV6_RTHDR:
                        case IPV6_FAITH:
                        case IPV6_V6ONLY:
+                       case IPV6_USE_MIN_MTU:
                                if (!m || m->m_len != sizeof(int)) {
                                        error = EINVAL;
                                        break;
@@ -1407,6 +1408,10 @@
                                        OPTSET(IN6P_FAITH);
                                        break;
 
+                               case IPV6_USE_MIN_MTU:
+                                       OPTSET(IN6P_MINMTU);
+                                       break;
+
                                case IPV6_V6ONLY:
                                        /*
                                         * make setsockopt(IPV6_V6ONLY)
@@ -1527,6 +1532,7 @@
                        case IPV6_RTHDR:
                        case IPV6_FAITH:
                        case IPV6_V6ONLY:
+                       case IPV6_USE_MIN_MTU:
                                *mp = m = m_get(M_WAIT, MT_SOOPTS);
                                m->m_len = sizeof(int);
                                switch (optname) {
@@ -1589,6 +1595,10 @@
                                case IPV6_V6ONLY:
                                        optval = OPTBIT(IN6P_IPV6_V6ONLY);
                                        break;
+
+                               case IPV6_USE_MIN_MTU:
+                                       optval = OPTBIT(IN6P_MINMTU);
+                                       break;
                                }
                                *mtod(m, int *) = optval;
                                break;
diff -r dda7f071158c -r 1a669c8e8137 sys/netinet6/raw_ip6.c
--- a/sys/netinet6/raw_ip6.c    Fri Jun 11 03:52:00 2004 +0000
+++ b/sys/netinet6/raw_ip6.c    Fri Jun 11 04:10:10 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: raw_ip6.c,v 1.64 2004/04/22 17:58:59 itojun Exp $      */
+/*     $NetBSD: raw_ip6.c,v 1.65 2004/06/11 04:10:10 itojun Exp $      */
 /*     $KAME: raw_ip6.c,v 1.82 2001/07/23 18:57:56 jinmei Exp $        */
 
 /*
@@ -62,7 +62,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: raw_ip6.c,v 1.64 2004/04/22 17:58:59 itojun Exp $");
+__KERNEL_RCSID(0, "$NetBSD: raw_ip6.c,v 1.65 2004/06/11 04:10:10 itojun Exp $");
 
 #include "opt_ipsec.h"
 
@@ -500,10 +500,8 @@
        }
 
        flags = 0;
-#ifdef IN6P_MINMTU
        if (in6p->in6p_flags & IN6P_MINMTU)
                flags |= IPV6_MINMTU;
-#endif
 
        error = ip6_output(m, optp, &in6p->in6p_route, flags,
            in6p->in6p_moptions, so, &oifp);
diff -r dda7f071158c -r 1a669c8e8137 sys/netinet6/udp6_output.c
--- a/sys/netinet6/udp6_output.c        Fri Jun 11 03:52:00 2004 +0000
+++ b/sys/netinet6/udp6_output.c        Fri Jun 11 04:10:10 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: udp6_output.c,v 1.17 2003/09/05 23:20:49 itojun Exp $  */
+/*     $NetBSD: udp6_output.c,v 1.18 2004/06/11 04:10:10 itojun Exp $  */
 /*     $KAME: udp6_output.c,v 1.43 2001/10/15 09:19:52 itojun Exp $    */
 
 /*
@@ -62,7 +62,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: udp6_output.c,v 1.17 2003/09/05 23:20:49 itojun Exp $");
+__KERNEL_RCSID(0, "$NetBSD: udp6_output.c,v 1.18 2004/06/11 04:10:10 itojun Exp $");
 
 #include "opt_inet.h"
 
@@ -335,10 +335,8 @@
                        udp6->uh_sum = 0xffff;
                }
 
-#ifdef IN6P_MINMTU
                if (in6p->in6p_flags & IN6P_MINMTU)
                        flags |= IPV6_MINMTU;
-#endif
 
                udp6stat.udp6s_opackets++;
                error = ip6_output(m, in6p->in6p_outputopts, &in6p->in6p_route,



Home | Main Index | Thread Index | Old Index