projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use ECDSA to sign ECDH key exchange for UDP session keys.
[tinc]
/
src
/
tincctl.c
diff --git
a/src/tincctl.c
b/src/tincctl.c
index
00a296d
..
ebd2e13
100644
(file)
--- a/
src/tincctl.c
+++ b/
src/tincctl.c
@@
-405,14
+405,14
@@
bool recvdata(int fd, char *data, size_t len) {
bool sendline(int fd, char *format, ...) {
static char buffer[4096];
char *p = buffer;
bool sendline(int fd, char *format, ...) {
static char buffer[4096];
char *p = buffer;
-
size_
t blen = 0;
+
in
t blen = 0;
va_list ap;
va_start(ap, format);
blen = vsnprintf(buffer, sizeof buffer, format, ap);
va_end(ap);
va_list ap;
va_start(ap, format);
blen = vsnprintf(buffer, sizeof buffer, format, ap);
va_end(ap);
- if(blen <
0
|| blen >= sizeof buffer)
+ if(blen <
1
|| blen >= sizeof buffer)
return false;
buffer[blen] = '\n';
return false;
buffer[blen] = '\n';
@@
-422,7
+422,7
@@
bool sendline(int fd, char *format, ...) {
int result = send(fd, p, blen, 0);
if(result == -1 && errno == EINTR)
continue;
int result = send(fd, p, blen, 0);
if(result == -1 && errno == EINTR)
continue;
- else if(result <= 0)
;
+ else if(result <= 0)
return false;
p += result;
blen -= result;
return false;
p += result;
blen -= result;
@@
-497,8
+497,8
@@
int main(int argc, char *argv[], char *envp[]) {
make_names();
if(show_version) {
make_names();
if(show_version) {
- printf("%s version %s (built %s %s, protocol %d)\n", PACKAGE,
- VERSION, __DATE__, __TIME__, PROT_
CURRENT
);
+ printf("%s version %s (built %s %s, protocol %d
.%d
)\n", PACKAGE,
+ VERSION, __DATE__, __TIME__, PROT_
MAJOR, PROT_MINOR
);
printf("Copyright (C) 1998-2009 Ivo Timmermans, Guus Sliepen and others.\n"
"See the AUTHORS file for a complete list.\n\n"
"tinc comes with ABSOLUTELY NO WARRANTY. This is free software,\n"
printf("Copyright (C) 1998-2009 Ivo Timmermans, Guus Sliepen and others.\n"
"See the AUTHORS file for a complete list.\n\n"
"tinc comes with ABSOLUTELY NO WARRANTY. This is free software,\n"
@@
-574,7
+574,7
@@
int main(int argc, char *argv[], char *envp[]) {
struct addrinfo *res = NULL;
if(getaddrinfo(host, port, &hints, &res) || !res) {
struct addrinfo *res = NULL;
if(getaddrinfo(host, port, &hints, &res) || !res) {
- fprintf(stderr, "Cannot resolve %s port %s: %s", host
?: "localhost"
, port, strerror(errno));
+ fprintf(stderr, "Cannot resolve %s port %s: %s", host, port, strerror(errno));
return 1;
}
return 1;
}
@@
-593,7
+593,7
@@
int main(int argc, char *argv[], char *envp[]) {
#endif
if(connect(fd, res->ai_addr, res->ai_addrlen) < 0) {
#endif
if(connect(fd, res->ai_addr, res->ai_addrlen) < 0) {
- fprintf(stderr, "Cannot connect to %s port %s: %s\n", host
?: "localhost"
, port, sockstrerror(sockerrno));
+ fprintf(stderr, "Cannot connect to %s port %s: %s\n", host, port, sockstrerror(sockerrno));
return 1;
}
return 1;
}