summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJun-ichiro itojun Hagino <itojun@cvs.openbsd.org>2004-06-12 04:58:49 +0000
committerJun-ichiro itojun Hagino <itojun@cvs.openbsd.org>2004-06-12 04:58:49 +0000
commit7b9b8b69874ecc34bee98405226f60eaae76fee2 (patch)
tree6811c39bac1b6f22d097264675f75cd80de658fc
parentf4c00c0ce2cc3ec3ee6dad5f9a12ed1185f3f269 (diff)
support IPV6_USE_MIN_MTU, to make BIND9 better.
(sorry about the mess yesterday)
-rw-r--r--sys/netinet6/in6.h7
-rw-r--r--sys/netinet6/ip6_output.c12
-rw-r--r--sys/netinet6/raw_ip6.c4
-rw-r--r--sys/netinet6/udp6_output.c4
4 files changed, 18 insertions, 9 deletions
diff --git a/sys/netinet6/in6.h b/sys/netinet6/in6.h
index a2b3ff3d962..00bb5043c56 100644
--- a/sys/netinet6/in6.h
+++ b/sys/netinet6/in6.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: in6.h,v 1.34 2004/06/11 14:27:13 deraadt Exp $ */
+/* $OpenBSD: in6.h,v 1.35 2004/06/12 04:58:48 itojun Exp $ */
/* $KAME: in6.h,v 1.83 2001/03/29 02:55:07 jinmei Exp $ */
/*
@@ -407,7 +407,10 @@ struct route_in6 {
#endif
#define IPV6_FAITH 29 /* bool; accept FAITH'ed connections */
-/* 30-52, 57-59: reserved */
+/* 30-41: reserved */
+#define IPV6_USE_MIN_MTU 42 /* bool; send packets at the minimum MTU */
+
+/* 43-52, 57-59: reserved */
#define IPV6_AUTH_LEVEL 53 /* int; authentication used */
#define IPV6_ESP_TRANS_LEVEL 54 /* int; transport encryption */
#define IPV6_ESP_NETWORK_LEVEL 55 /* int; full-packet encryption */
diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c
index c53ab69ab3c..7d0433b798c 100644
--- a/sys/netinet6/ip6_output.c
+++ b/sys/netinet6/ip6_output.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip6_output.c,v 1.84 2004/06/11 14:27:13 deraadt Exp $ */
+/* $OpenBSD: ip6_output.c,v 1.85 2004/06/12 04:58:48 itojun Exp $ */
/* $KAME: ip6_output.c,v 1.172 2001/03/25 09:55:56 itojun Exp $ */
/*
@@ -1318,6 +1318,7 @@ ip6_ctloutput(op, so, level, optname, mp)
case IPV6_RTHDR:
case IPV6_FAITH:
case IPV6_V6ONLY:
+ case IPV6_USE_MIN_MTU:
if (optlen != sizeof(int)) {
error = EINVAL;
break;
@@ -1376,6 +1377,10 @@ do { \
OPTSET(IN6P_FAITH);
break;
+ case IPV6_USE_MIN_MTU:
+ OPTSET(IN6P_MINMTU);
+ break;
+
case IPV6_V6ONLY:
if (!optval)
error = EINVAL;
@@ -1543,6 +1548,7 @@ do { \
case IPV6_FAITH:
case IPV6_V6ONLY:
case IPV6_PORTRANGE:
+ case IPV6_USE_MIN_MTU:
switch (optname) {
case IPV6_UNICAST_HOPS:
@@ -1604,6 +1610,10 @@ do { \
optval = 0;
break;
}
+
+ case IPV6_USE_MIN_MTU:
+ optval = OPTBIT(IN6P_MINMTU);
+ break;
}
*mp = m = m_get(M_WAIT, MT_SOOPTS);
m->m_len = sizeof(int);
diff --git a/sys/netinet6/raw_ip6.c b/sys/netinet6/raw_ip6.c
index b1d6c5e0582..f05ef964280 100644
--- a/sys/netinet6/raw_ip6.c
+++ b/sys/netinet6/raw_ip6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: raw_ip6.c,v 1.26 2004/06/11 14:27:13 deraadt Exp $ */
+/* $OpenBSD: raw_ip6.c,v 1.27 2004/06/12 04:58:48 itojun Exp $ */
/* $KAME: raw_ip6.c,v 1.69 2001/03/04 15:55:44 itojun Exp $ */
/*
@@ -480,10 +480,8 @@ rip6_output(struct mbuf *m, ...)
}
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, &oifp);
diff --git a/sys/netinet6/udp6_output.c b/sys/netinet6/udp6_output.c
index cc8ccff2e2b..18421a0d6cf 100644
--- a/sys/netinet6/udp6_output.c
+++ b/sys/netinet6/udp6_output.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: udp6_output.c,v 1.11 2004/06/11 14:27:13 deraadt Exp $ */
+/* $OpenBSD: udp6_output.c,v 1.12 2004/06/12 04:58:48 itojun Exp $ */
/* $KAME: udp6_output.c,v 1.21 2001/02/07 11:51:54 itojun Exp $ */
/*
@@ -262,10 +262,8 @@ udp6_output(in6p, m, addr6, control)
}
flags = 0;
-#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,