projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Let tincctl parse and format dumps.
[tinc]
/
src
/
connection.c
diff --git
a/src/connection.c
b/src/connection.c
index
dd52448
..
fafec5d
100644
(file)
--- a/
src/connection.c
+++ b/
src/connection.c
@@
-64,8
+64,10
@@
void free_connection_partially(connection_t *c) {
ecdsa_free(&c->ecdsa);
rsa_free(&c->rsa);
ecdsa_free(&c->ecdsa);
rsa_free(&c->rsa);
- if(c->hischallenge)
+ if(c->hischallenge)
{
free(c->hischallenge);
free(c->hischallenge);
+ c->hischallenge = NULL;
+ }
buffer_clear(&c->inbuf);
buffer_clear(&c->outbuf);
buffer_clear(&c->inbuf);
buffer_clear(&c->outbuf);
@@
-80,6
+82,10
@@
void free_connection_partially(connection_t *c) {
closesocket(c->socket);
c->socket = -1;
closesocket(c->socket);
c->socket = -1;
+
+ c->protocol_major = 0;
+ c->protocol_minor = 0;
+ c->allow_request = 0;
}
void free_connection(connection_t *c) {
}
void free_connection(connection_t *c) {
@@
-111,7
+117,7
@@
bool dump_connections(connection_t *cdump) {
for(node = connection_tree->head; node; node = node->next) {
c = node->data;
for(node = connection_tree->head; node; node = node->next) {
c = node->data;
- send_request(cdump, "%d %d %s
at %s options %x socket %d status %04
x",
+ send_request(cdump, "%d %d %s
%s %x %d %
x",
CONTROL, REQ_DUMP_CONNECTIONS,
c->name, c->hostname, c->options, c->socket,
bitfield_to_int(&c->status, sizeof c->status));
CONTROL, REQ_DUMP_CONNECTIONS,
c->name, c->hostname, c->options, c->socket,
bitfield_to_int(&c->status, sizeof c->status));