X-Git-Url: https://www.tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Ftincctl.c;h=ede186ad4be94c1000c300cfee183ee4f4891b71;hp=2d2e2f25431d903bc53a2d1a7bd302312daf98ad;hb=5d78e497f1c352c8d490eed1d44d128523a34572;hpb=d6c50eb73ad49bd2eac67214995dff76b7a20661 diff --git a/src/tincctl.c b/src/tincctl.c index 2d2e2f25..ede186ad 100644 --- a/src/tincctl.c +++ b/src/tincctl.c @@ -58,7 +58,7 @@ static struct option const long_options[] = { {"net", required_argument, NULL, 'n'}, {"help", no_argument, NULL, 1}, {"version", no_argument, NULL, 2}, - {"controlsocket", required_argument, NULL, 5}, + {"controlcookie", required_argument, NULL, 5}, {NULL, 0, NULL, 0} }; @@ -282,7 +282,7 @@ static void make_names(void) { #endif if(!controlcookiename) - xasprintf(&controlcookiename, "%s/run/%s.control/socket", LOCALSTATEDIR, identname); + xasprintf(&controlcookiename, "%s/run/%s.cookie", LOCALSTATEDIR, identname); if(netname) { if(!confbase) @@ -540,7 +540,7 @@ int main(int argc, char *argv[], char *envp[]) { while(recvline(fd, line, sizeof line)) { char node1[4096], node2[4096]; - int n = sscanf(line, "%d %d %s to %s", &code, &req, &node1, &node2); + int n = sscanf(line, "%d %d %s to %s", &code, &req, node1, node2); if(n == 2) { if(do_graph && req == REQ_DUMP_NODES) continue; @@ -586,7 +586,7 @@ int main(int argc, char *argv[], char *envp[]) { debuglevel = atoi(argv[optind+1]); sendline(fd, "%d %d %d", CONTROL, REQ_SET_DEBUG, debuglevel); - if(!recvline(fd, line, sizeof line) || sscanf(line, "%d %d %d", &code, &req, &result) != 3 || code != CONTROL || req != REQ_SET_DEBUG) { + if(!recvline(fd, line, sizeof line) || sscanf(line, "%d %d %d", &code, &req, &origlevel) != 3 || code != CONTROL || req != REQ_SET_DEBUG) { fprintf(stderr, "Could not purge tinc daemon\n"); return 1; }