summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2010-06-07 13:08:44 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2010-06-07 13:08:44 +0000
commit37b7fe5a53c211dd6f0c2c53b162de8984a4909f (patch)
tree4ae0158370c5d2421874b3e8fbe874c5bec4d9af
parent77959b9f2e6c673067b6c72542e91ba61317742b (diff)
There is no reason to allow unicast IPv4 mapped IPv6 addresses in tcp
connect() calls. Our network stack does not allow any v4 mapped addresses so there is no need to allow them in connect(). Found after discussion with Henning. OK deraadt@
-rw-r--r--sys/netinet/tcp_usrreq.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c
index e177c75373f..6c09f5b896d 100644
--- a/sys/netinet/tcp_usrreq.c
+++ b/sys/netinet/tcp_usrreq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcp_usrreq.c,v 1.101 2010/04/20 22:05:43 tedu Exp $ */
+/* $OpenBSD: tcp_usrreq.c,v 1.102 2010/06/07 13:08:43 claudio Exp $ */
/* $NetBSD: tcp_usrreq.c,v 1.20 1996/02/13 23:44:16 christos Exp $ */
/*
@@ -271,10 +271,7 @@ tcp_usrreq(so, req, m, nam, control, p)
if (IN6_IS_ADDR_UNSPECIFIED(in6_addr) ||
IN6_IS_ADDR_MULTICAST(in6_addr) ||
- (IN6_IS_ADDR_V4MAPPED(in6_addr) &&
- ((in6_addr->s6_addr32[3] == INADDR_ANY) ||
- IN_MULTICAST(in6_addr->s6_addr32[3]) ||
- in_broadcast(sin->sin_addr, NULL)))) {
+ IN6_IS_ADDR_V4MAPPED(in6_addr)) {
error = EINVAL;
break;
}