connection_t: remove unused compression_level field
authorKirill Isakov <bootctl@gmail.com>
Thu, 21 Apr 2022 08:11:16 +0000 (14:11 +0600)
committerGuus Sliepen <guus@tinc-vpn.org>
Thu, 21 Apr 2022 18:34:57 +0000 (20:34 +0200)
src/connection.h
src/net_setup.c
src/net_socket.c
src/protocol_auth.c

index 9ca1e8d..e39d74b 100644 (file)
@@ -60,7 +60,6 @@ typedef union connection_status_t {
 #include "edge.h"
 #include "net.h"
 #include "node.h"
-#include "compression.h"
 
 #ifndef DISABLE_LEGACY
 typedef struct legacy_crypto_t {
@@ -109,11 +108,7 @@ typedef struct connection_t {
        sptps_t sptps;
 
        int outmaclength;
-
-       union {
-               compression_level_t outcompression;
-               debug_t log_level; // used for REQ_LOG
-       };
+       debug_t log_level;              /* used for REQ_LOG */
 
        uint8_t *hischallenge;          /* The challenge we sent to him */
        uint8_t *mychallenge;           /* The challenge we received */
index 79bed8c..b0b8760 100644 (file)
@@ -1002,8 +1002,6 @@ static bool setup_myself(void) {
                myself->incompression = COMPRESS_NONE;
        }
 
-       myself->connection->outcompression = COMPRESS_NONE;
-
        /* Done */
 
        myself->nexthop = myself;
index af1bec2..8783b01 100644 (file)
@@ -649,7 +649,6 @@ begin:
        c->status.connecting = true;
        c->name = xstrdup(outgoing->node->name);
        c->outmaclength = myself->connection->outmaclength;
-       c->outcompression = myself->connection->outcompression;
        c->last_ping_time = now.tv_sec;
 
        connection_add(c);
@@ -758,7 +757,6 @@ void handle_new_meta_connection(void *data, int flags) {
        c = new_connection();
        c->name = xstrdup("<unknown>");
        c->outmaclength = myself->connection->outmaclength;
-       c->outcompression = myself->connection->outcompression;
 
        c->address = sa;
        c->hostname = sockaddr2hostname(&sa);
index d1eb6c2..2225457 100644 (file)
@@ -42,6 +42,7 @@
 #include "utils.h"
 #include "xalloc.h"
 #include "random.h"
+#include "compression.h"
 
 #include "ed25519/sha512.h"
 #include "keys.h"
@@ -608,7 +609,7 @@ bool send_metakey(connection_t *c) {
        bool result = send_request(c, "%d %d %d %d %d %s", METAKEY,
                                   cipher_get_nid(&c->legacy->out.cipher),
                                   digest_get_nid(&c->legacy->out.digest), c->outmaclength,
-                                  c->outcompression, hexkey);
+                                  COMPRESS_NONE, hexkey);
 
        c->status.encryptout = true;
        return result;