From a48a902f6fb84764c5f082cfbf9d5a5f2d805113 Mon Sep 17 00:00:00 2001 From: ume Date: Sat, 10 Jan 2004 08:11:51 +0000 Subject: in set{peer, sock}addr, do not convert the unspecified address (::) to the mapped address form. PR: kern/22868 Obtained from: KAME MFC after: 3 days --- sys/netinet6/in6_pcb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netinet6/in6_pcb.c b/sys/netinet6/in6_pcb.c index b3d58e8..6b3f91b 100644 --- a/sys/netinet6/in6_pcb.c +++ b/sys/netinet6/in6_pcb.c @@ -561,7 +561,7 @@ in6_mapped_sockaddr(struct socket *so, struct sockaddr **nam) if (inp == NULL) return EINVAL; - if (inp->inp_vflag & INP_IPV4) { + if ((inp->inp_vflag & (INP_IPV4 | INP_IPV6)) == INP_IPV4) { error = in_setsockaddr(so, nam, &tcbinfo); if (error == 0) in6_sin_2_v4mapsin6_in_sock(nam); @@ -581,7 +581,7 @@ in6_mapped_peeraddr(struct socket *so, struct sockaddr **nam) if (inp == NULL) return EINVAL; - if (inp->inp_vflag & INP_IPV4) { + if ((inp->inp_vflag & (INP_IPV4 | INP_IPV6)) == INP_IPV4) { error = in_setpeeraddr(so, nam, &tcbinfo); if (error == 0) in6_sin_2_v4mapsin6_in_sock(nam); -- cgit v1.1