projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix "void function should not return void expression" warning.
[tinc]
/
src
/
net_packet.c
diff --git
a/src/net_packet.c
b/src/net_packet.c
index
ce2361c
..
9c913ca
100644
(file)
--- a/
src/net_packet.c
+++ b/
src/net_packet.c
@@
-30,6
+30,7
@@
#include LZO1X_H
#endif
#include LZO1X_H
#endif
+#include "address_cache.h"
#include "cipher.h"
#include "conf.h"
#include "connection.h"
#include "cipher.h"
#include "conf.h"
#include "connection.h"
@@
-138,7
+139,8
@@
static void send_udp_probe_reply(node_t *n, vpn_packet_t *packet, length_t len)
static void udp_probe_h(node_t *n, vpn_packet_t *packet, length_t len) {
if(!DATA(packet)[0]) {
logger(DEBUG_TRAFFIC, LOG_INFO, "Got UDP probe request %d from %s (%s)", packet->len, n->name, n->hostname);
static void udp_probe_h(node_t *n, vpn_packet_t *packet, length_t len) {
if(!DATA(packet)[0]) {
logger(DEBUG_TRAFFIC, LOG_INFO, "Got UDP probe request %d from %s (%s)", packet->len, n->name, n->hostname);
- return send_udp_probe_reply(n, packet, len);
+ send_udp_probe_reply(n, packet, len);
+ return;
}
if(DATA(packet)[0] == 2) {
}
if(DATA(packet)[0] == 2) {
@@
-153,7
+155,13
@@
static void udp_probe_h(node_t *n, vpn_packet_t *packet, length_t len) {
/* It's a valid reply: now we know bidirectional communication
is possible using the address and socket that the reply
packet used. */
/* It's a valid reply: now we know bidirectional communication
is possible using the address and socket that the reply
packet used. */
- n->status.udp_confirmed = true;
+ if(!n->status.udp_confirmed) {
+ n->status.udp_confirmed = true;
+ fprintf(stderr, "Updating address cache...\n");
+ if (!n->address_cache)
+ n->address_cache = open_address_cache(n);
+ reset_address_cache(n->address_cache, &n->address);
+ }
// Reset the UDP ping timer.
n->udp_ping_sent = now;
// Reset the UDP ping timer.
n->udp_ping_sent = now;
@@
-680,7
+688,8
@@
static void send_udppacket(node_t *n, vpn_packet_t *origpkt) {
}
if(n->status.sptps) {
}
if(n->status.sptps) {
- return send_sptps_packet(n, origpkt);
+ send_sptps_packet(n, origpkt);
+ return;
}
#ifdef DISABLE_LEGACY
}
#ifdef DISABLE_LEGACY
@@
-929,7
+938,7
@@
bool receive_sptps_record(void *handle, uint8_t type, const void *data, uint16_t
if(!from->status.validkey) {
from->status.validkey = true;
from->status.waitingforkey = false;
if(!from->status.validkey) {
from->status.validkey = true;
from->status.waitingforkey = false;
- logger(DEBUG_META, LOG_INFO, "SPTPS key exchange with %s (%s) succesful", from->name, from->hostname);
+ logger(DEBUG_META, LOG_INFO, "SPTPS key exchange with %s (%s) succes
s
ful", from->name, from->hostname);
}
return true;
}
return true;
@@
-1347,7
+1356,8
@@
static void try_tx_sptps(node_t *n, bool mtu) {
return;
}
return;
}
- return try_tx(via, mtu);
+ try_tx(via, mtu);
+ return;
}
/* Otherwise, try to establish UDP connectivity. */
}
/* Otherwise, try to establish UDP connectivity. */