Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

- made consist between tcp and udp in using mappedaddr

- setsockopt(BIND_IPV6ONLY) now works
  • Loading branch information...
commit ee3515397a768a731b0707847536f62e6773a674 1 parent 5a1660b
sumikawa authored
View
10 freebsd4/sys/netinet/in_pcb.c
@@ -152,6 +152,10 @@ in_pcballoc(so, pcbinfo, p)
inp->inp_gencnt = ++pcbinfo->ipi_gencnt;
inp->inp_pcbinfo = pcbinfo;
inp->inp_socket = so;
+#if defined(INET6)
+ if (INP_SOCKAF(so) == AF_INET6 && !ip6_mapped_addr_on)
+ inp->inp_flags |= IN6P_BINDV6ONLY;
+#endif
LIST_INSERT_HEAD(pcbinfo->listhead, inp, inp_list);
pcbinfo->ipi_count++;
so->so_pcb = (caddr_t)inp;
@@ -230,8 +234,7 @@ in_pcbbind(inp, nam, p)
(so->so_cred->cr_uid !=
t->inp_socket->so_cred->cr_uid)) {
#if defined(INET6)
- if (ip6_mapped_addr_on == 0 ||
- ntohl(sin->sin_addr.s_addr) !=
+ if (ntohl(sin->sin_addr.s_addr) !=
INADDR_ANY ||
ntohl(t->inp_laddr.s_addr) !=
INADDR_ANY ||
@@ -246,8 +249,7 @@ in_pcbbind(inp, nam, p)
if (t &&
(reuseport & t->inp_socket->so_options) == 0) {
#if defined(INET6)
- if (ip6_mapped_addr_on == 0 ||
- ntohl(sin->sin_addr.s_addr) !=
+ if (ntohl(sin->sin_addr.s_addr) !=
INADDR_ANY ||
ntohl(t->inp_laddr.s_addr) !=
INADDR_ANY ||
View
6 freebsd4/sys/netinet/tcp_input.c
@@ -737,10 +737,8 @@ tcp_input(m, off0, proto)
if (isipv6)
inp->in6p_laddr = ip6->ip6_dst;
else {
- if (ip6_mapped_addr_on) {
- inp->inp_vflag &= ~INP_IPV6;
- inp->inp_vflag |= INP_IPV4;
- }
+ inp->inp_vflag &= ~INP_IPV6;
+ inp->inp_vflag |= INP_IPV4;
#endif /* INET6 */
inp->inp_laddr = ip->ip_dst;
#ifdef INET6
View
6 freebsd4/sys/netinet6/in6_pcb.c
@@ -1,5 +1,5 @@
/* $FreeBSD: src/sys/netinet6/in6_pcb.c,v 1.10.2.2 2000/07/15 07:14:33 kris Exp $ */
-/* $KAME: in6_pcb.c,v 1.16 2000/08/06 13:11:18 kjc Exp $ */
+/* $KAME: in6_pcb.c,v 1.17 2000/10/03 16:19:31 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -195,7 +195,7 @@ in6_pcbbind(inp, nam, p)
(so->so_cred->cr_uid !=
t->inp_socket->so_cred->cr_uid))
return (EADDRINUSE);
- if (ip6_mapped_addr_on != 0 &&
+ if ((inp->inp_flags & IN6P_BINDV6ONLY) == 0 &&
IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) {
struct sockaddr_in sin;
@@ -217,7 +217,7 @@ in6_pcbbind(inp, nam, p)
lport, wild);
if (t && (reuseport & t->inp_socket->so_options) == 0)
return(EADDRINUSE);
- if (ip6_mapped_addr_on != 0 &&
+ if ((inp->inp_flags & IN6P_BINDV6ONLY) == 0 &&
IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) {
struct sockaddr_in sin;
Please sign in to comment.
Something went wrong with that request. Please try again.