From 5fac41781b59cd10ae969adeab25869bfa25ef16 Mon Sep 17 00:00:00 2001 From: Hajimu UMEMOTO Date: Sat, 10 Jan 2004 08:11:51 +0000 Subject: [PATCH] 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 b3d58e8acb2..6b3f91b0355 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);