X-Git-Url: https://tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Fnetutl.c;h=d39640891ccdf1bb812c095350c31fd772e0bbf5;hp=a5886fc16ec04f077ed164baa59545574ab7b395;hb=813c369a8faca94fc38bc66afafad063fa00f928;hpb=2ac7be0d51a112108dc6c2b1c6f46da022f72f40 diff --git a/src/netutl.c b/src/netutl.c index a5886fc1..d3964089 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.31 2002/03/18 14:19:02 guus Exp $ */ #include "config.h" @@ -43,6 +43,10 @@ #include "system.h" +#ifndef s6_addr32 +#define s6_addr32 in6_u.u6_addr32 +#endif + int hostnames = 0; /* @@ -171,6 +175,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 = sa->in6.sin6_addr.s6_addr32[3]; + sa->in.sin_family = AF_INET; + } +} + /* Subnet mask handling */ int maskcmp(char *a, char *b, int masklen, int len)