summaryrefslogtreecommitdiffstats
path: root/sys/netinet6
diff options
context:
space:
mode:
Diffstat (limited to 'sys/netinet6')
-rw-r--r--sys/netinet6/ip6_output.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c
index d6a6e80..d0d072e 100644
--- a/sys/netinet6/ip6_output.c
+++ b/sys/netinet6/ip6_output.c
@@ -1366,6 +1366,17 @@ do { \
case IPV6_V6ONLY:
/*
+ * make setsockopt(IPV6_V6ONLY)
+ * available only prior to bind(2).
+ * see ipng mailing list, Jun 22 2001.
+ */
+ if (in6p->in6p_lport ||
+ !IN6_IS_ADDR_UNSPECIFIED(&in6p->in6p_laddr))
+ {
+ error = EINVAL;
+ break;
+ }
+ /*
* XXX: BINDV6ONLY should be integrated
* into V6ONLY.
*/
OpenPOWER on IntegriCloud