projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Disable PMTU discovery when TCPOnly is set.
[tinc]
/
src
/
tincctl.c
diff --git
a/src/tincctl.c
b/src/tincctl.c
index
a0061dc
..
4c5102b
100644
(file)
--- a/
src/tincctl.c
+++ b/
src/tincctl.c
@@
-40,7
+40,6
@@
#include "top.h"
#ifdef HAVE_MINGW
#include "top.h"
#ifdef HAVE_MINGW
-#define mkdir(a, b) mkdir(a)
#define SCRIPTEXTENSION ".bat"
#else
#define SCRIPTEXTENSION ""
#define SCRIPTEXTENSION ".bat"
#else
#define SCRIPTEXTENSION ""
@@
-117,7
+116,7
@@
static void usage(bool status) {
" del VARIABLE [VALUE] Remove VARIABLE [only ones with watching VALUE]\n"
" start [tincd options] Start tincd.\n"
" stop Stop tincd.\n"
" del VARIABLE [VALUE] Remove VARIABLE [only ones with watching VALUE]\n"
" start [tincd options] Start tincd.\n"
" stop Stop tincd.\n"
- " restart
Restart tincd.\n"
+ " restart
[tincd options]
Restart tincd.\n"
" reload Partially reload configuration of running tincd.\n"
" pid Show PID of currently running tincd.\n"
" generate-keys [bits] Generate new RSA and ECDSA public/private keypairs.\n"
" reload Partially reload configuration of running tincd.\n"
" pid Show PID of currently running tincd.\n"
" generate-keys [bits] Generate new RSA and ECDSA public/private keypairs.\n"
@@
-469,7
+468,8
@@
bool recvline(int fd, char *line, size_t len) {
char *newline = NULL;
if(!fd)
char *newline = NULL;
if(!fd)
-abort();
+ abort();
+
while(!(newline = memchr(buffer, '\n', blen))) {
int result = recv(fd, buffer + blen, sizeof buffer - blen, 0);
if(result == -1 && errno == EINTR)
while(!(newline = memchr(buffer, '\n', blen))) {
int result = recv(fd, buffer + blen, sizeof buffer - blen, 0);
if(result == -1 && errno == EINTR)
@@
-871,7
+871,7
@@
static int cmd_stop(int argc, char *argv[]) {
}
static int cmd_restart(int argc, char *argv[]) {
}
static int cmd_restart(int argc, char *argv[]) {
- cmd_stop(
argc
, argv);
+ cmd_stop(
1
, argv);
return cmd_start(argc, argv);
}
return cmd_start(argc, argv);
}
@@
-1187,6
+1187,13
@@
static int cmd_pcap(int argc, char *argv[]) {
return 0;
}
return 0;
}
+#ifdef SIGINT
+static void sigint_handler(int sig) {
+ fprintf(stderr, "\n");
+ shutdown(fd, SHUT_RDWR);
+}
+#endif
+
static int cmd_log(int argc, char *argv[]) {
if(argc > 2) {
fprintf(stderr, "Too many arguments!\n");
static int cmd_log(int argc, char *argv[]) {
if(argc > 2) {
fprintf(stderr, "Too many arguments!\n");
@@
-1196,7
+1203,18
@@
static int cmd_log(int argc, char *argv[]) {
if(!connect_tincd(true))
return 1;
if(!connect_tincd(true))
return 1;
+#ifdef SIGINT
+ signal(SIGINT, sigint_handler);
+#endif
+
logcontrol(fd, stdout, argc > 1 ? atoi(argv[1]) : -1);
logcontrol(fd, stdout, argc > 1 ? atoi(argv[1]) : -1);
+
+#ifdef SIGINT
+ signal(SIGINT, SIG_DFL);
+#endif
+
+ close(fd);
+ fd = -1;
return 0;
}
return 0;
}
@@
-1277,6
+1295,7
@@
const var_t variables[] = {
{"KeyExpire", VAR_SERVER},
{"LocalDiscovery", VAR_SERVER},
{"MACExpire", VAR_SERVER},
{"KeyExpire", VAR_SERVER},
{"LocalDiscovery", VAR_SERVER},
{"MACExpire", VAR_SERVER},
+ {"MaxConnectionBurst", VAR_SERVER},
{"MaxOutputBufferSize", VAR_SERVER},
{"MaxTimeout", VAR_SERVER},
{"Mode", VAR_SERVER | VAR_SAFE},
{"MaxOutputBufferSize", VAR_SERVER},
{"MaxTimeout", VAR_SERVER},
{"Mode", VAR_SERVER | VAR_SAFE},