projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update to make it compile again.
[tinc]
/
src
/
netutl.c
diff --git
a/src/netutl.c
b/src/netutl.c
index
1ab4c2c
..
83dbe2b
100644
(file)
--- a/
src/netutl.c
+++ b/
src/netutl.c
@@
-1,7
+1,7
@@
/*
netutl.c -- some supporting network utility code
/*
netutl.c -- some supporting network utility code
- Copyright (C) 1998-200
3 Ivo Timmermans <ivo@o2w.nl
>
- 2000-200
3 Guus Sliepen <guus@sliepen.eu
.org>
+ Copyright (C) 1998-200
4 Ivo Timmermans <ivo@tinc-vpn.org
>
+ 2000-200
4 Guus Sliepen <guus@tinc-vpn
.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@
-17,7
+17,7
@@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
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.53 2003/08/22 11:18:42 guus Exp
$
+ $Id$
*/
#include "system.h"
*/
#include "system.h"
@@
-193,6
+193,8
@@
int sockaddrcmp(const sockaddr_t *a, const sockaddr_t *b)
}
void sockaddrcpy(sockaddr_t *a, const sockaddr_t *b) {
}
void sockaddrcpy(sockaddr_t *a, const sockaddr_t *b) {
+ cp();
+
if(b->sa.sa_family != AF_UNKNOWN) {
*a = *b;
} else {
if(b->sa.sa_family != AF_UNKNOWN) {
*a = *b;
} else {
@@
-203,6
+205,8
@@
void sockaddrcpy(sockaddr_t *a, const sockaddr_t *b) {
}
void sockaddrfree(sockaddr_t *a) {
}
void sockaddrfree(sockaddr_t *a) {
+ cp();
+
if(a->sa.sa_family == AF_UNKNOWN) {
free(a->unknown.address);
free(a->unknown.port);
if(a->sa.sa_family == AF_UNKNOWN) {
free(a->unknown.address);
free(a->unknown.port);
@@
-211,6
+215,8
@@
void sockaddrfree(sockaddr_t *a) {
void sockaddrunmap(sockaddr_t *sa)
{
void sockaddrunmap(sockaddr_t *sa)
{
+ cp();
+
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;
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;