X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fnetutl.c;h=c59a34b8161abf0ad771e482ebd83700e0b7d5c2;hb=cbd8133ab4a2ea8a0c46224a5f1ae79e92819e5f;hp=a5886fc16ec04f077ed164baa59545574ab7b395;hpb=2ac7be0d51a112108dc6c2b1c6f46da022f72f40;p=tinc diff --git a/src/netutl.c b/src/netutl.c index a5886fc1..c59a34b8 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.28 2002/02/26 22:47:51 guus Exp $ + $Id: netutl.c,v 1.12.4.33 2002/03/19 00:08:23 guus Exp $ */ #include "config.h" @@ -171,6 +171,15 @@ cp cp } +void sockaddrunmap(sockaddr_t *sa) +{ + if(sa->sa.sa_family == AF_INET6 && IN6_IS_ADDR_V4MAPPED(&sa->in6.sin6_addr)) + { + sa->in.sin_addr.s_addr = ((uint32_t *)&sa->in6.sin6_addr)[3]; + sa->in.sin_family = AF_INET; + } +} + /* Subnet mask handling */ int maskcmp(char *a, char *b, int masklen, int len)