projects
/
tinc
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b737103
)
Use global "now" in try_udp() and try_mtu().
author
Guus Sliepen
<guus@tinc-vpn.org>
Sun, 4 Jan 2015 15:00:02 +0000
(16:00 +0100)
committer
Guus Sliepen
<guus@tinc-vpn.org>
Sun, 4 Jan 2015 15:00:02 +0000
(16:00 +0100)
src/net_packet.c
patch
|
blob
|
history
diff --git
a/src/net_packet.c
b/src/net_packet.c
index
1cd03d2
..
4719288
100644
(file)
--- a/
src/net_packet.c
+++ b/
src/net_packet.c
@@
-870,8
+870,6
@@
static void try_udp(node_t* n) {
if(!udp_discovery)
return;
if(!udp_discovery)
return;
- struct timeval now;
- gettimeofday(&now, NULL);
struct timeval ping_tx_elapsed;
timersub(&now, &n->udp_ping_sent, &ping_tx_elapsed);
struct timeval ping_tx_elapsed;
timersub(&now, &n->udp_ping_sent, &ping_tx_elapsed);
@@
-968,8
+966,6
@@
static void try_mtu(node_t *n) {
mtuprobes == 20: fix MTU, and go to -1
mtuprobes == -1: send one >maxmtu probe every pingtimeout */
mtuprobes == 20: fix MTU, and go to -1
mtuprobes == -1: send one >maxmtu probe every pingtimeout */
- struct timeval now;
- gettimeofday(&now, NULL);
struct timeval elapsed;
timersub(&now, &n->probe_sent_time, &elapsed);
if(n->mtuprobes >= 0) {
struct timeval elapsed;
timersub(&now, &n->probe_sent_time, &elapsed);
if(n->mtuprobes >= 0) {
@@
-982,7
+978,6
@@
static void try_mtu(node_t *n) {
try_fix_mtu(n);
try_fix_mtu(n);
- int timeout;
if(n->mtuprobes < 0) {
/* After the initial discovery, we only send one >maxmtu probe
to detect PMTU increases. */
if(n->mtuprobes < 0) {
/* After the initial discovery, we only send one >maxmtu probe
to detect PMTU increases. */