projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use send() when writing to sockets, and the return type is ssize_t.
[tinc]
/
src
/
node.c
diff --git
a/src/node.c
b/src/node.c
index
1f1f94d
..
dbc5a7e
100644
(file)
--- a/
src/node.c
+++ b/
src/node.c
@@
-85,7
+85,8
@@
void free_node(node_t *n) {
cipher_close(&n->outcipher);
digest_close(&n->outdigest);
cipher_close(&n->outcipher);
digest_close(&n->outdigest);
- event_del(&n->mtuevent);
+ if(timeout_initialized(&n->mtuevent))
+ event_del(&n->mtuevent);
if(n->hostname)
free(n->hostname);
if(n->hostname)
free(n->hostname);
@@
-125,7
+126,7
@@
void node_del(node_t *n) {
}
node_t *lookup_node(char *name) {
}
node_t *lookup_node(char *name) {
- node_t n = {
0
};
+ node_t n = {
NULL
};
n.name = name;
n.name = name;
@@
-133,7
+134,7
@@
node_t *lookup_node(char *name) {
}
node_t *lookup_node_udp(const sockaddr_t *sa) {
}
node_t *lookup_node_udp(const sockaddr_t *sa) {
- node_t n = {
0
};
+ node_t n = {
NULL
};
n.address = *sa;
n.name = NULL;
n.address = *sa;
n.name = NULL;
@@
-143,7
+144,7
@@
node_t *lookup_node_udp(const sockaddr_t *sa) {
void update_node_udp(node_t *n, const sockaddr_t *sa) {
if(n == myself) {
void update_node_udp(node_t *n, const sockaddr_t *sa) {
if(n == myself) {
- logger(LOG_WARNING, "Trying to update UDP address of myself!
\n
");
+ logger(LOG_WARNING, "Trying to update UDP address of myself!");
return;
}
return;
}
@@
-159,7
+160,7
@@
void update_node_udp(node_t *n, const sockaddr_t *sa) {
logger(LOG_DEBUG, "UDP address of %s set to %s", n->name, n->hostname);
} else {
memset(&n->address, 0, sizeof n->address);
logger(LOG_DEBUG, "UDP address of %s set to %s", n->name, n->hostname);
} else {
memset(&n->address, 0, sizeof n->address);
- n->hostname =
0
;
+ n->hostname =
NULL
;
ifdebug(PROTOCOL) logger(LOG_DEBUG, "UDP address of %s cleared", n->name);
}
}
ifdebug(PROTOCOL) logger(LOG_DEBUG, "UDP address of %s cleared", n->name);
}
}