summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJun-ichiro itojun Hagino <itojun@cvs.openbsd.org>2004-06-11 08:09:30 +0000
committerJun-ichiro itojun Hagino <itojun@cvs.openbsd.org>2004-06-11 08:09:30 +0000
commit9c67a15961d03f93ac1d8bf9ea871085cd42d2cc (patch)
treecf5b1ea8a8221654b353eef2df1c22aa44834b31
parent714fee3501ee7cbced6e0e29770690aa720f4325 (diff)
support IPV6_USE_MIN_MTU, which is needed to run BIND9 well. from kame
markus ok
-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 e99d5edaac1..ec4f23dcc67 100644
--- a/sys/netinet6/in6.h
+++ b/sys/netinet6/in6.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: in6.h,v 1.32 2004/02/15 11:16:08 markus Exp $ */
+/* $OpenBSD: in6.h,v 1.33 2004/06/11 08:09:29 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 d832bfdc08f..434bc41a7ca 100644
--- a/sys/netinet6/ip6_output.c
+++ b/sys/netinet6/ip6_output.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip6_output.c,v 1.82 2004/02/04 08:47:41 itojun Exp $ */
+/* $OpenBSD: ip6_output.c,v 1.83 2004/06/11 08:09:29 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 607f921ae81..14e3598250a 100644
--- a/sys/netinet6/raw_ip6.c
+++ b/sys/netinet6/raw_ip6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: raw_ip6.c,v 1.24 2004/04/22 18:01:15 itojun Exp $ */
+/* $OpenBSD: raw_ip6.c,v 1.25 2004/06/11 08:09:29 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 36712f6e264..ff60e554d45 100644
--- a/sys/netinet6/udp6_output.c
+++ b/sys/netinet6/udp6_output.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: udp6_output.c,v 1.9 2003/06/02 23:28:16 millert Exp $ */
+/* $OpenBSD: udp6_output.c,v 1.10 2004/06/11 08:09:29 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,