projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use a splay tree for node UDP addresses in order to avoid collisions.
[tinc]
/
src
/
multicast_device.c
diff --git
a/src/multicast_device.c
b/src/multicast_device.c
index
ba272eb
..
931a8d0
100644
(file)
--- a/
src/multicast_device.c
+++ b/
src/multicast_device.c
@@
-129,7
+129,7
@@
static bool setup_device(void) {
#endif
default:
#endif
default:
- logger(DEBUG_ALWAYS, LOG_ERR, "Multicast for address family %
h
x unsupported", ai->ai_family);
+ logger(DEBUG_ALWAYS, LOG_ERR, "Multicast for address family %x unsupported", ai->ai_family);
goto error;
}
goto error;
}
@@
-162,13
+162,13
@@
static void close_device(void) {
static bool read_packet(vpn_packet_t *packet) {
int lenin;
static bool read_packet(vpn_packet_t *packet) {
int lenin;
- if((lenin = recv(device_fd,
(void *)packet->data
, MTU, 0)) <= 0) {
+ if((lenin = recv(device_fd,
DATA(packet)
, MTU, 0)) <= 0) {
logger(DEBUG_ALWAYS, LOG_ERR, "Error while reading from %s %s: %s", device_info,
logger(DEBUG_ALWAYS, LOG_ERR, "Error while reading from %s %s: %s", device_info,
- device, s
trerror(
errno));
+ device, s
ockstrerror(sock
errno));
return false;
}
return false;
}
- if(!memcmp(&ignore_src,
packet->data
+ 6, sizeof ignore_src)) {
+ if(!memcmp(&ignore_src,
DATA(packet)
+ 6, sizeof ignore_src)) {
logger(DEBUG_SCARY_THINGS, LOG_DEBUG, "Ignoring loopback packet of %d bytes from %s", lenin, device_info);
return false;
}
logger(DEBUG_SCARY_THINGS, LOG_DEBUG, "Ignoring loopback packet of %d bytes from %s", lenin, device_info);
return false;
}
@@
-185,13
+185,13
@@
static bool write_packet(vpn_packet_t *packet) {
logger(DEBUG_TRAFFIC, LOG_DEBUG, "Writing packet of %d bytes to %s",
packet->len, device_info);
logger(DEBUG_TRAFFIC, LOG_DEBUG, "Writing packet of %d bytes to %s",
packet->len, device_info);
- if(sendto(device_fd,
(void *)packet->data
, packet->len, 0, ai->ai_addr, ai->ai_addrlen) < 0) {
+ if(sendto(device_fd,
DATA(packet)
, packet->len, 0, ai->ai_addr, ai->ai_addrlen) < 0) {
logger(DEBUG_ALWAYS, LOG_ERR, "Can't write to %s %s: %s", device_info, device,
logger(DEBUG_ALWAYS, LOG_ERR, "Can't write to %s %s: %s", device_info, device,
- s
trerror(
errno));
+ s
ockstrerror(sock
errno));
return false;
}
return false;
}
- memcpy(&ignore_src,
packet->data
+ 6, sizeof ignore_src);
+ memcpy(&ignore_src,
DATA(packet)
+ 6, sizeof ignore_src);
return true;
}
return true;
}