From: Guus Sliepen Date: Sun, 17 Mar 2002 16:08:39 +0000 (+0000) Subject: Only unmap IPv6 addresses. X-Git-Tag: import-tinc-1.1~785^2~344 X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=b2579385de427c3c03d28520d3a93bd5f9bc9488;p=meshlink Only unmap IPv6 addresses. --- diff --git a/src/netutl.c b/src/netutl.c index 95a168ca..c7c2a2d8 100644 --- a/src/netutl.c +++ b/src/netutl.c @@ -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;