Only unmap IPv6 addresses.

This commit is contained in:
Guus Sliepen 2002-03-17 16:08:39 +00:00
parent 8b84c44175
commit b2579385de

View file

@ -17,7 +17,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
$Id: netutl.c,v 1.12.4.29 2002/03/17 15:59:29 guus Exp $
$Id: netutl.c,v 1.12.4.30 2002/03/17 16:08:39 guus Exp $
*/
#include "config.h"
@ -173,7 +173,7 @@ cp
void sockaddrunmap(sockaddr_t *sa)
{
if(IN6_IS_ADDR_V4MAPPED(&sa->in6.sin6_addr))
if(sa->sa.sa_family == AF_INET6 && IN6_IS_ADDR_V4MAPPED(&sa->in6.sin6_addr))
{
sa->in.sin_addr.s_addr = sa->in6.sin6_addr.s6_addr32[3];
sa->in.sin_family = AF_INET;