projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Enable and fix many extra warnings supported by GCC and Clang.
[tinc]
/
src
/
protocol.c
diff --git
a/src/protocol.c
b/src/protocol.c
index
7de75b9
..
3539ca7
100644
(file)
--- a/
src/protocol.c
+++ b/
src/protocol.c
@@
-1,7
+1,7
@@
/*
protocol.c -- handle the meta-protocol, basic functions
Copyright (C) 1999-2005 Ivo Timmermans,
/*
protocol.c -- handle the meta-protocol, basic functions
Copyright (C) 1999-2005 Ivo Timmermans,
- 2000-20
13
Guus Sliepen <guus@tinc-vpn.org>
+ 2000-20
22
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
@@
-22,9
+22,11
@@
#include "conf.h"
#include "connection.h"
#include "conf.h"
#include "connection.h"
+#include "crypto.h"
#include "logger.h"
#include "meta.h"
#include "protocol.h"
#include "logger.h"
#include "meta.h"
#include "protocol.h"
+#include "utils.h"
#include "xalloc.h"
bool tunnelserver = false;
#include "xalloc.h"
bool tunnelserver = false;
@@
-47,7
+49,7
@@
static bool (*request_handlers[])(connection_t *, const char *) = {
/* Request names */
/* Request names */
-static char (*request_name[]) = {
+static c
onst c
har (*request_name[]) = {
"ID", "METAKEY", "CHALLENGE", "CHAL_REPLY", "ACK",
"STATUS", "ERROR", "TERMREQ",
"PING", "PONG",
"ID", "METAKEY", "CHALLENGE", "CHAL_REPLY", "ACK",
"STATUS", "ERROR", "TERMREQ",
"PING", "PONG",
@@
-191,7
+193,7
@@
static void age_past_requests(void *data) {
if(left)
timeout_set(&past_request_timeout, &(struct timeval) {
if(left)
timeout_set(&past_request_timeout, &(struct timeval) {
- 10,
rand() % 100000
+ 10,
jitter()
});
}
});
}
@@
-209,7
+211,7
@@
bool seen_request(const char *request) {
new->firstseen = now.tv_sec;
splay_insert(&past_request_tree, new);
timeout_add(&past_request_timeout, age_past_requests, NULL, &(struct timeval) {
new->firstseen = now.tv_sec;
splay_insert(&past_request_tree, new);
timeout_add(&past_request_timeout, age_past_requests, NULL, &(struct timeval) {
- 10,
rand() % 100000
+ 10,
jitter()
});
return false;
}
});
return false;
}