Remove checkpoint tracing.
authorGuus Sliepen <guus@tinc-vpn.org>
Thu, 24 Sep 2009 22:33:04 +0000 (00:33 +0200)
committerGuus Sliepen <guus@tinc-vpn.org>
Thu, 24 Sep 2009 22:33:04 +0000 (00:33 +0200)
This feature is not necessary anymore since we have tools like valgrind today
that can catch stack overflow errors before they make a backtrace in gdb
impossible.

31 files changed:
configure.in
lib/utils.c
lib/utils.h
src/bsd/device.c
src/conf.c
src/connection.c
src/cygwin/device.c
src/edge.c
src/event.c
src/graph.c
src/linux/device.c
src/meta.c
src/mingw/device.c
src/net.c
src/net_packet.c
src/net_setup.c
src/net_socket.c
src/netutl.c
src/node.c
src/process.c
src/protocol.c
src/protocol_auth.c
src/protocol_edge.c
src/protocol_key.c
src/protocol_misc.c
src/protocol_subnet.c
src/raw_socket/device.c
src/route.c
src/solaris/device.c
src/subnet.c
src/uml_socket/device.c

index 67715862389a13666e75412e60efc1dcd4284473..4c28426ef6344dd43dea6e073737a415947058fd 100644 (file)
@@ -164,12 +164,6 @@ AC_ARG_ENABLE(jumbograms,
   [ AC_DEFINE(ENABLE_JUMBOGRAMS, 1, [Support for jumbograms (packets up to 9000 bytes)]) ]
 )
 
   [ AC_DEFINE(ENABLE_JUMBOGRAMS, 1, [Support for jumbograms (packets up to 9000 bytes)]) ]
 )
 
-dnl Check if checkpoint tracing has to be enabled
-AC_ARG_ENABLE(tracing,
-  AS_HELP_STRING([--enable-tracing], [enable checkpoint tracing (debugging only)]),
-  [ AC_DEFINE(ENABLE_TRACING, 1, [Checkpoint tracing]) ]
-)
-
 AC_SUBST(INCLUDES)
 
 AC_CONFIG_FILES([Makefile src/Makefile doc/Makefile lib/Makefile po/Makefile.in m4/Makefile])
 AC_SUBST(INCLUDES)
 
 AC_CONFIG_FILES([Makefile src/Makefile doc/Makefile lib/Makefile po/Makefile.in m4/Makefile])
index b327a49f56c1abcf3d9b22d1fa7fac55a853df6a..3283472d826d6e13541bc0cf712168fc5b2761f4 100644 (file)
 #include "../src/logger.h"
 #include "utils.h"
 
 #include "../src/logger.h"
 #include "utils.h"
 
-#ifdef ENABLE_TRACING
-volatile int (cp_line[]) = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
-volatile char (*cp_file[]) = {"?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?"};
-volatile int cp_index = 0;
-#endif
-
 const char hexadecimals[] = "0123456789ABCDEF";
 
 int charhex2bin(char c) {
 const char hexadecimals[] = "0123456789ABCDEF";
 
 int charhex2bin(char c) {
@@ -53,29 +47,6 @@ void bin2hex(char *src, char *dst, int length) {
        }
 }
 
        }
 }
 
-#ifdef ENABLE_TRACING
-void cp_trace() {
-       logger(LOG_DEBUG, "Checkpoint trace: %s:%d <- %s:%d <- %s:%d <- %s:%d <- %s:%d <- %s:%d <- %s:%d <- %s:%d <- %s:%d <- %s:%d <- %s:%d <- %s:%d <- %s:%d <- %s:%d <- %s:%d <- %s:%d...",
-                  cp_file[(cp_index + 15) % 16], cp_line[(cp_index + 15) % 16],
-                  cp_file[(cp_index + 14) % 16], cp_line[(cp_index + 14) % 16],
-                  cp_file[(cp_index + 13) % 16], cp_line[(cp_index + 13) % 16],
-                  cp_file[(cp_index + 12) % 16], cp_line[(cp_index + 12) % 16],
-                  cp_file[(cp_index + 11) % 16], cp_line[(cp_index + 11) % 16],
-                  cp_file[(cp_index + 10) % 16], cp_line[(cp_index + 10) % 16],
-                  cp_file[(cp_index + 9) % 16], cp_line[(cp_index + 9) % 16],
-                  cp_file[(cp_index + 8) % 16], cp_line[(cp_index + 8) % 16],
-                  cp_file[(cp_index + 7) % 16], cp_line[(cp_index + 7) % 16],
-                  cp_file[(cp_index + 6) % 16], cp_line[(cp_index + 6) % 16],
-                  cp_file[(cp_index + 5) % 16], cp_line[(cp_index + 5) % 16],
-                  cp_file[(cp_index + 4) % 16], cp_line[(cp_index + 4) % 16],
-                  cp_file[(cp_index + 3) % 16], cp_line[(cp_index + 3) % 16],
-                  cp_file[(cp_index + 2) % 16], cp_line[(cp_index + 2) % 16],
-                  cp_file[(cp_index + 1) % 16], cp_line[(cp_index + 1) % 16],
-                  cp_file[cp_index], cp_line[cp_index]
-               );
-}
-#endif
-
 #if defined(HAVE_MINGW) || defined(HAVE_CYGWIN)
 #ifdef HAVE_CYGWIN
 #include <w32api/windows.h>
 #if defined(HAVE_MINGW) || defined(HAVE_CYGWIN)
 #ifdef HAVE_CYGWIN
 #include <w32api/windows.h>
index a94548fea95889208ab01f6273c56cd171eea061..c6fb18076e5078cdd27659372a3fdfa4178d960c 100644 (file)
 #ifndef __TINC_UTILS_H__
 #define __TINC_UTILS_H__
 
 #ifndef __TINC_UTILS_H__
 #define __TINC_UTILS_H__
 
-#ifdef ENABLE_TRACING
-extern volatile int cp_line[];
-extern volatile char *cp_file[];
-extern volatile int cp_index;
-extern void cp_trace(void);
-
-#define cp() { cp_line[cp_index] = __LINE__; cp_file[cp_index] = __FILE__; cp_index++; cp_index %= 16; }
-#define ecp() { fprintf(stderr, "Explicit checkpoint in %s line %d\n", __FILE__, __LINE__); }
-#else
-#define cp()
-#define ecp()
-#define cp_trace()
-#endif
-
 extern void hex2bin(char *src, char *dst, int length);
 extern void bin2hex(char *src, char *dst, int length);
 
 extern void hex2bin(char *src, char *dst, int length);
 extern void bin2hex(char *src, char *dst, int length);
 
index 5fe8dc0dfd176615b683068b4281de2e29cc90b6..be026b701d01a992b8abd181801685ba73b2172f 100644 (file)
@@ -59,8 +59,6 @@ static device_type_t device_type = DEVICE_TYPE_TUN;
 bool setup_device(void) {
        char *type;
 
 bool setup_device(void) {
        char *type;
 
-       cp();
-
        if(!get_config_string(lookup_config(config_tree, "Device"), &device))
                device = xstrdup(DEFAULT_DEVICE);
 
        if(!get_config_string(lookup_config(config_tree, "Device"), &device))
                device = xstrdup(DEFAULT_DEVICE);
 
@@ -165,8 +163,6 @@ bool setup_device(void) {
 }
 
 void close_device(void) {
 }
 
 void close_device(void) {
-       cp();
-
        switch(device_type) {
 #ifdef HAVE_TUNEMU
                case DEVICE_TYPE_TUNEMU:
        switch(device_type) {
 #ifdef HAVE_TUNEMU
                case DEVICE_TYPE_TUNEMU:
@@ -184,8 +180,6 @@ void close_device(void) {
 bool read_packet(vpn_packet_t *packet) {
        int lenin;
 
 bool read_packet(vpn_packet_t *packet) {
        int lenin;
 
-       cp();
-
        switch(device_type) {
                case DEVICE_TYPE_TUN:
 #ifdef HAVE_TUNEMU
        switch(device_type) {
                case DEVICE_TYPE_TUN:
 #ifdef HAVE_TUNEMU
@@ -278,8 +272,6 @@ bool read_packet(vpn_packet_t *packet) {
 }
 
 bool write_packet(vpn_packet_t *packet) {
 }
 
 bool write_packet(vpn_packet_t *packet) {
-       cp();
-
        ifdebug(TRAFFIC) logger(LOG_DEBUG, _("Writing packet of %d bytes to %s"),
                           packet->len, device_info);
 
        ifdebug(TRAFFIC) logger(LOG_DEBUG, _("Writing packet of %d bytes to %s"),
                           packet->len, device_info);
 
@@ -349,8 +341,6 @@ bool write_packet(vpn_packet_t *packet) {
 }
 
 void dump_device_stats(void) {
 }
 
 void dump_device_stats(void) {
-       cp();
-
        logger(LOG_DEBUG, _("Statistics for %s %s:"), device_info, device);
        logger(LOG_DEBUG, _(" total bytes in:  %10d"), device_total_in);
        logger(LOG_DEBUG, _(" total bytes out: %10d"), device_total_out);
        logger(LOG_DEBUG, _("Statistics for %s %s:"), device_info, device);
        logger(LOG_DEBUG, _(" total bytes in:  %10d"), device_total_in);
        logger(LOG_DEBUG, _(" total bytes out: %10d"), device_total_out);
index e7703c16bbe71bd2862fec3239013f4d2aee85b5..688974ba7426a6d3f226a792f7ca452c83548ca9 100644 (file)
@@ -53,27 +53,19 @@ static int config_compare(const config_t *a, const config_t *b) {
 }
 
 void init_configuration(avl_tree_t ** config_tree) {
 }
 
 void init_configuration(avl_tree_t ** config_tree) {
-       cp();
-
        *config_tree = avl_alloc_tree((avl_compare_t) config_compare, (avl_action_t) free_config);
 }
 
 void exit_configuration(avl_tree_t ** config_tree) {
        *config_tree = avl_alloc_tree((avl_compare_t) config_compare, (avl_action_t) free_config);
 }
 
 void exit_configuration(avl_tree_t ** config_tree) {
-       cp();
-
        avl_delete_tree(*config_tree);
        *config_tree = NULL;
 }
 
 config_t *new_config(void) {
        avl_delete_tree(*config_tree);
        *config_tree = NULL;
 }
 
 config_t *new_config(void) {
-       cp();
-
        return xmalloc_and_zero(sizeof(config_t));
 }
 
 void free_config(config_t *cfg) {
        return xmalloc_and_zero(sizeof(config_t));
 }
 
 void free_config(config_t *cfg) {
-       cp();
-
        if(cfg->variable)
                free(cfg->variable);
 
        if(cfg->variable)
                free(cfg->variable);
 
@@ -87,16 +79,12 @@ void free_config(config_t *cfg) {
 }
 
 void config_add(avl_tree_t *config_tree, config_t *cfg) {
 }
 
 void config_add(avl_tree_t *config_tree, config_t *cfg) {
-       cp();
-
        avl_insert(config_tree, cfg);
 }
 
 config_t *lookup_config(avl_tree_t *config_tree, char *variable) {
        config_t cfg, *found;
 
        avl_insert(config_tree, cfg);
 }
 
 config_t *lookup_config(avl_tree_t *config_tree, char *variable) {
        config_t cfg, *found;
 
-       cp();
-
        cfg.variable = variable;
        cfg.file = "";
        cfg.line = 0;
        cfg.variable = variable;
        cfg.file = "";
        cfg.line = 0;
@@ -116,8 +104,6 @@ config_t *lookup_config_next(avl_tree_t *config_tree, const config_t *cfg) {
        avl_node_t *node;
        config_t *found;
 
        avl_node_t *node;
        config_t *found;
 
-       cp();
-
        node = avl_search_node(config_tree, cfg);
 
        if(node) {
        node = avl_search_node(config_tree, cfg);
 
        if(node) {
@@ -133,8 +119,6 @@ config_t *lookup_config_next(avl_tree_t *config_tree, const config_t *cfg) {
 }
 
 bool get_config_bool(const config_t *cfg, bool *result) {
 }
 
 bool get_config_bool(const config_t *cfg, bool *result) {
-       cp();
-
        if(!cfg)
                return false;
 
        if(!cfg)
                return false;
 
@@ -153,8 +137,6 @@ bool get_config_bool(const config_t *cfg, bool *result) {
 }
 
 bool get_config_int(const config_t *cfg, int *result) {
 }
 
 bool get_config_int(const config_t *cfg, int *result) {
-       cp();
-
        if(!cfg)
                return false;
 
        if(!cfg)
                return false;
 
@@ -168,8 +150,6 @@ bool get_config_int(const config_t *cfg, int *result) {
 }
 
 bool get_config_string(const config_t *cfg, char **result) {
 }
 
 bool get_config_string(const config_t *cfg, char **result) {
-       cp();
-
        if(!cfg)
                return false;
 
        if(!cfg)
                return false;
 
@@ -181,8 +161,6 @@ bool get_config_string(const config_t *cfg, char **result) {
 bool get_config_address(const config_t *cfg, struct addrinfo **result) {
        struct addrinfo *ai;
 
 bool get_config_address(const config_t *cfg, struct addrinfo **result) {
        struct addrinfo *ai;
 
-       cp();
-
        if(!cfg)
                return false;
 
        if(!cfg)
                return false;
 
@@ -202,8 +180,6 @@ bool get_config_address(const config_t *cfg, struct addrinfo **result) {
 bool get_config_subnet(const config_t *cfg, subnet_t ** result) {
        subnet_t subnet = {0};
 
 bool get_config_subnet(const config_t *cfg, subnet_t ** result) {
        subnet_t subnet = {0};
 
-       cp();
-
        if(!cfg)
                return false;
 
        if(!cfg)
                return false;
 
@@ -314,8 +290,6 @@ int read_config_file(avl_tree_t *config_tree, const char *fname) {
        config_t *cfg;
        size_t bufsize;
 
        config_t *cfg;
        size_t bufsize;
 
-       cp();
-
        fp = fopen(fname, "r");
 
        if(!fp) {
        fp = fopen(fname, "r");
 
        if(!fp) {
@@ -397,8 +371,6 @@ bool read_server_config() {
        char *fname;
        int x;
 
        char *fname;
        int x;
 
-       cp();
-
        xasprintf(&fname, "%s/tinc.conf", confbase);
        x = read_config_file(config_tree, fname);
 
        xasprintf(&fname, "%s/tinc.conf", confbase);
        x = read_config_file(config_tree, fname);
 
index 289c233bb9f29803e77e1e28c0e201a4711f2623..7c8cd0ba83e3c326a47505f8f8cd175403926bfe 100644 (file)
@@ -38,8 +38,6 @@ static int connection_compare(const connection_t *a, const connection_t *b) {
 }
 
 void init_connections(void) {
 }
 
 void init_connections(void) {
-       cp();
-
        connection_tree = avl_alloc_tree((avl_compare_t) connection_compare, (avl_action_t) free_connection);
        broadcast = new_connection();
        broadcast->name = xstrdup(_("everyone"));
        connection_tree = avl_alloc_tree((avl_compare_t) connection_compare, (avl_action_t) free_connection);
        broadcast = new_connection();
        broadcast->name = xstrdup(_("everyone"));
@@ -47,8 +45,6 @@ void init_connections(void) {
 }
 
 void exit_connections(void) {
 }
 
 void exit_connections(void) {
-       cp();
-
        avl_delete_tree(connection_tree);
        free_connection(broadcast);
 }
        avl_delete_tree(connection_tree);
        free_connection(broadcast);
 }
@@ -56,8 +52,6 @@ void exit_connections(void) {
 connection_t *new_connection(void) {
        connection_t *c;
 
 connection_t *new_connection(void) {
        connection_t *c;
 
-       cp();
-
        c = xmalloc_and_zero(sizeof(connection_t));
 
        if(!c)
        c = xmalloc_and_zero(sizeof(connection_t));
 
        if(!c)
@@ -69,8 +63,6 @@ connection_t *new_connection(void) {
 }
 
 void free_connection(connection_t *c) {
 }
 
 void free_connection(connection_t *c) {
-       cp();
-
        if(c->name)
                free(c->name);
 
        if(c->name)
                free(c->name);
 
@@ -112,14 +104,10 @@ void free_connection(connection_t *c) {
 }
 
 void connection_add(connection_t *c) {
 }
 
 void connection_add(connection_t *c) {
-       cp();
-
        avl_insert(connection_tree, c);
 }
 
 void connection_del(connection_t *c) {
        avl_insert(connection_tree, c);
 }
 
 void connection_del(connection_t *c) {
-       cp();
-
        avl_delete(connection_tree, c);
 }
 
        avl_delete(connection_tree, c);
 }
 
@@ -127,8 +115,6 @@ void dump_connections(void) {
        avl_node_t *node;
        connection_t *c;
 
        avl_node_t *node;
        connection_t *c;
 
-       cp();
-
        logger(LOG_DEBUG, _("Connections:"));
 
        for(node = connection_tree->head; node; node = node->next) {
        logger(LOG_DEBUG, _("Connections:"));
 
        for(node = connection_tree->head; node; node = node->next) {
@@ -145,8 +131,6 @@ bool read_connection_config(connection_t *c) {
        char *fname;
        int x;
 
        char *fname;
        int x;
 
-       cp();
-
        xasprintf(&fname, "%s/hosts/%s", confbase, c->name);
        x = read_config_file(c->config_tree, fname);
        free(fname);
        xasprintf(&fname, "%s/hosts/%s", confbase, c->name);
        x = read_config_file(c->config_tree, fname);
        free(fname);
index 921205cf87e174bb592daa99ee1a3f522c95af4f..617214d0a3b0fe6bf4ec195cb71fb084f2e59791 100644 (file)
@@ -57,8 +57,6 @@ bool setup_device(void) {
 
        bool found = false;
 
 
        bool found = false;
 
-       cp();
-
        get_config_string(lookup_config(config_tree, "Device"), &device);
        get_config_string(lookup_config(config_tree, "Interface"), &iface);
 
        get_config_string(lookup_config(config_tree, "Device"), &device);
        get_config_string(lookup_config(config_tree, "Interface"), &iface);
 
@@ -216,8 +214,6 @@ bool setup_device(void) {
 }
 
 void close_device(void) {
 }
 
 void close_device(void) {
-       cp();
-
        close(sp[0]);
        close(sp[1]);
        CloseHandle(device_handle);
        close(sp[0]);
        close(sp[1]);
        CloseHandle(device_handle);
@@ -231,8 +227,6 @@ void close_device(void) {
 bool read_packet(vpn_packet_t *packet) {
        int lenin;
 
 bool read_packet(vpn_packet_t *packet) {
        int lenin;
 
-       cp();
-
        if((lenin = read(sp[0], packet->data, MTU)) <= 0) {
                logger(LOG_ERR, _("Error while reading from %s %s: %s"), device_info,
                           device, strerror(errno));
        if((lenin = read(sp[0], packet->data, MTU)) <= 0) {
                logger(LOG_ERR, _("Error while reading from %s %s: %s"), device_info,
                           device, strerror(errno));
@@ -252,8 +246,6 @@ bool read_packet(vpn_packet_t *packet) {
 bool write_packet(vpn_packet_t *packet) {
        long lenout;
 
 bool write_packet(vpn_packet_t *packet) {
        long lenout;
 
-       cp();
-
        ifdebug(TRAFFIC) logger(LOG_DEBUG, _("Writing packet of %d bytes to %s"),
                           packet->len, device_info);
 
        ifdebug(TRAFFIC) logger(LOG_DEBUG, _("Writing packet of %d bytes to %s"),
                           packet->len, device_info);
 
@@ -268,8 +260,6 @@ bool write_packet(vpn_packet_t *packet) {
 }
 
 void dump_device_stats(void) {
 }
 
 void dump_device_stats(void) {
-       cp();
-
        logger(LOG_DEBUG, _("Statistics for %s %s:"), device_info, device);
        logger(LOG_DEBUG, _(" total bytes in:  %10d"), device_total_in);
        logger(LOG_DEBUG, _(" total bytes out: %10d"), device_total_out);
        logger(LOG_DEBUG, _("Statistics for %s %s:"), device_info, device);
        logger(LOG_DEBUG, _(" total bytes in:  %10d"), device_total_in);
        logger(LOG_DEBUG, _(" total bytes out: %10d"), device_total_out);
index 403dfff64d3bc943b99e5ee07cde80624efc6b47..d1ff32491d09e6c16f102bf81c8df15d8db521c6 100644 (file)
@@ -51,48 +51,34 @@ static int edge_weight_compare(const edge_t *a, const edge_t *b) {
 }
 
 void init_edges(void) {
 }
 
 void init_edges(void) {
-       cp();
-
        edge_weight_tree = avl_alloc_tree((avl_compare_t) edge_weight_compare, NULL);
 }
 
 avl_tree_t *new_edge_tree(void) {
        edge_weight_tree = avl_alloc_tree((avl_compare_t) edge_weight_compare, NULL);
 }
 
 avl_tree_t *new_edge_tree(void) {
-       cp();
-
        return avl_alloc_tree((avl_compare_t) edge_compare, (avl_action_t) free_edge);
 }
 
 void free_edge_tree(avl_tree_t *edge_tree) {
        return avl_alloc_tree((avl_compare_t) edge_compare, (avl_action_t) free_edge);
 }
 
 void free_edge_tree(avl_tree_t *edge_tree) {
-       cp();
-
        avl_delete_tree(edge_tree);
 }
 
 void exit_edges(void) {
        avl_delete_tree(edge_tree);
 }
 
 void exit_edges(void) {
-       cp();
-
        avl_delete_tree(edge_weight_tree);
 }
 
 /* Creation and deletion of connection elements */
 
 edge_t *new_edge(void) {
        avl_delete_tree(edge_weight_tree);
 }
 
 /* Creation and deletion of connection elements */
 
 edge_t *new_edge(void) {
-       cp();
-
        return xmalloc_and_zero(sizeof(edge_t));
 }
 
 void free_edge(edge_t *e) {
        return xmalloc_and_zero(sizeof(edge_t));
 }
 
 void free_edge(edge_t *e) {
-       cp();
-       
        sockaddrfree(&e->address);
 
        free(e);
 }
 
 void edge_add(edge_t *e) {
        sockaddrfree(&e->address);
 
        free(e);
 }
 
 void edge_add(edge_t *e) {
-       cp();
-
        avl_insert(edge_weight_tree, e);
        avl_insert(e->from->edge_tree, e);
 
        avl_insert(edge_weight_tree, e);
        avl_insert(e->from->edge_tree, e);
 
@@ -103,8 +89,6 @@ void edge_add(edge_t *e) {
 }
 
 void edge_del(edge_t *e) {
 }
 
 void edge_del(edge_t *e) {
-       cp();
-
        if(e->reverse)
                e->reverse->reverse = NULL;
 
        if(e->reverse)
                e->reverse->reverse = NULL;
 
@@ -115,8 +99,6 @@ void edge_del(edge_t *e) {
 edge_t *lookup_edge(node_t *from, node_t *to) {
        edge_t v;
        
 edge_t *lookup_edge(node_t *from, node_t *to) {
        edge_t v;
        
-       cp();
-
        v.from = from;
        v.to = to;
 
        v.from = from;
        v.to = to;
 
@@ -129,8 +111,6 @@ void dump_edges(void) {
        edge_t *e;
        char *address;
 
        edge_t *e;
        char *address;
 
-       cp();
-
        logger(LOG_DEBUG, _("Edges:"));
 
        for(node = node_tree->head; node; node = node->next) {
        logger(LOG_DEBUG, _("Edges:"));
 
        for(node = node_tree->head; node; node = node->next) {
index 304360c63fbc0607ef67136b164eac7fe9e9f2b5..99e6a2381280c95d5365fce5020e8a450662d4f0 100644 (file)
@@ -41,14 +41,10 @@ static int event_compare(const event_t *a, const event_t *b) {
 }
 
 void init_events(void) {
 }
 
 void init_events(void) {
-       cp();
-
        event_tree = avl_alloc_tree((avl_compare_t) event_compare, (avl_action_t) free_event);
 }
 
 void exit_events(void) {
        event_tree = avl_alloc_tree((avl_compare_t) event_compare, (avl_action_t) free_event);
 }
 
 void exit_events(void) {
-       cp();
-
        avl_delete_tree(event_tree);
 }
 
        avl_delete_tree(event_tree);
 }
 
@@ -62,8 +58,6 @@ void expire_events(void) {
          * the expiration time of the last event and the current time.
         */
 
          * the expiration time of the last event and the current time.
         */
 
-       cp();
-
        if(!event_tree->tail)
                return;
 
        if(!event_tree->tail)
                return;
 
@@ -80,35 +74,25 @@ void expire_events(void) {
 }
 
 event_t *new_event(void) {
 }
 
 event_t *new_event(void) {
-       cp();
-
        return xmalloc_and_zero(sizeof(event_t));
 }
 
 void free_event(event_t *event) {
        return xmalloc_and_zero(sizeof(event_t));
 }
 
 void free_event(event_t *event) {
-       cp();
-
        free(event);
 }
 
 void event_add(event_t *event) {
        free(event);
 }
 
 void event_add(event_t *event) {
-       cp();
-
        event->id = ++id;
        avl_insert(event_tree, event);
 }
 
 void event_del(event_t *event) {
        event->id = ++id;
        avl_insert(event_tree, event);
 }
 
 void event_del(event_t *event) {
-       cp();
-
        avl_delete(event_tree, event);
 }
 
 event_t *get_expired_event(void) {
        event_t *event;
 
        avl_delete(event_tree, event);
 }
 
 event_t *get_expired_event(void) {
        event_t *event;
 
-       cp();
-
        if(event_tree->head) {
                event = event_tree->head->data;
 
        if(event_tree->head) {
                event = event_tree->head->data;
 
index 4f2ea498c2c7d70abb33a1f75f568a46b2055d64..c8430d8251552b2a4bafb5d68144a211c651d182 100644 (file)
@@ -73,8 +73,6 @@ void mst_kruskal(void) {
        int safe_edges = 0;
        bool skipped;
 
        int safe_edges = 0;
        bool skipped;
 
-       cp();
-       
        /* Clear MST status on connections */
 
        for(node = connection_tree->head; node; node = node->next) {
        /* Clear MST status on connections */
 
        for(node = connection_tree->head; node; node = node->next) {
@@ -159,8 +157,6 @@ void sssp_bfs(void) {
        char *envp[7];
        int i;
 
        char *envp[7];
        int i;
 
-       cp();
-
        todo_list = list_alloc(NULL);
 
        /* Clear visited status on nodes */
        todo_list = list_alloc(NULL);
 
        /* Clear visited status on nodes */
index 9af503886703df879016c1a261cb1eab24fc284c..8ae8fefb249892ea3039885d4ae6ae62f59f0ef1 100644 (file)
@@ -53,8 +53,6 @@ static int device_total_out = 0;
 bool setup_device(void) {
        struct ifreq ifr;
 
 bool setup_device(void) {
        struct ifreq ifr;
 
-       cp();
-
        if(!get_config_string(lookup_config(config_tree, "Device"), &device))
                device = xstrdup(DEFAULT_DEVICE);
 
        if(!get_config_string(lookup_config(config_tree, "Device"), &device))
                device = xstrdup(DEFAULT_DEVICE);
 
@@ -116,8 +114,6 @@ bool setup_device(void) {
 }
 
 void close_device(void) {
 }
 
 void close_device(void) {
-       cp();
-       
        close(device_fd);
 
        free(device);
        close(device_fd);
 
        free(device);
@@ -127,8 +123,6 @@ void close_device(void) {
 bool read_packet(vpn_packet_t *packet) {
        int lenin;
        
 bool read_packet(vpn_packet_t *packet) {
        int lenin;
        
-       cp();
-
        switch(device_type) {
                case DEVICE_TYPE_TUN:
                        lenin = read(device_fd, packet->data + 10, MTU - 10);
        switch(device_type) {
                case DEVICE_TYPE_TUN:
                        lenin = read(device_fd, packet->data + 10, MTU - 10);
@@ -174,8 +168,6 @@ bool read_packet(vpn_packet_t *packet) {
 }
 
 bool write_packet(vpn_packet_t *packet) {
 }
 
 bool write_packet(vpn_packet_t *packet) {
-       cp();
-
        ifdebug(TRAFFIC) logger(LOG_DEBUG, _("Writing packet of %d bytes to %s"),
                           packet->len, device_info);
 
        ifdebug(TRAFFIC) logger(LOG_DEBUG, _("Writing packet of %d bytes to %s"),
                           packet->len, device_info);
 
@@ -212,8 +204,6 @@ bool write_packet(vpn_packet_t *packet) {
 }
 
 void dump_device_stats(void) {
 }
 
 void dump_device_stats(void) {
-       cp();
-
        logger(LOG_DEBUG, _("Statistics for %s %s:"), device_info, device);
        logger(LOG_DEBUG, _(" total bytes in:  %10d"), device_total_in);
        logger(LOG_DEBUG, _(" total bytes out: %10d"), device_total_out);
        logger(LOG_DEBUG, _("Statistics for %s %s:"), device_info, device);
        logger(LOG_DEBUG, _(" total bytes in:  %10d"), device_total_in);
        logger(LOG_DEBUG, _(" total bytes out: %10d"), device_total_out);
index 27d2394a2d7d1877a960c0d08c1715d667fc5484..9c38fefb19e380d7c0a9bece05eb193ce6668699 100644 (file)
@@ -36,8 +36,6 @@ bool send_meta(connection_t *c, const char *buffer, int length) {
        int outlen;
        int result;
 
        int outlen;
        int result;
 
-       cp();
-
        if(!c) {
                logger(LOG_ERR, _("send_meta() called with NULL pointer!"));
                abort();
        if(!c) {
                logger(LOG_ERR, _("send_meta() called with NULL pointer!"));
                abort();
@@ -121,8 +119,6 @@ void broadcast_meta(connection_t *from, const char *buffer, int length) {
        avl_node_t *node;
        connection_t *c;
 
        avl_node_t *node;
        connection_t *c;
 
-       cp();
-
        for(node = connection_tree->head; node; node = node->next) {
                c = node->data;
 
        for(node = connection_tree->head; node; node = node->next) {
                c = node->data;
 
@@ -137,8 +133,6 @@ bool receive_meta(connection_t *c) {
        bool decrypted = false;
        char inbuf[MAXBUFSIZE];
 
        bool decrypted = false;
        char inbuf[MAXBUFSIZE];
 
-       cp();
-
        /* Strategy:
           - Read as much as possible from the TCP socket in one go.
           - Decrypt it.
        /* Strategy:
           - Read as much as possible from the TCP socket in one go.
           - Decrypt it.
index c0f02f2a870a8ec1efbe9c1c75dcfbda28449150..132ef8f796657010726f249f9e6374e8ce371297 100644 (file)
@@ -106,8 +106,6 @@ bool setup_device(void) {
                .ai_flags = 0,
        };
 
                .ai_flags = 0,
        };
 
-       cp();
-
        get_config_string(lookup_config(config_tree, "Device"), &device);
        get_config_string(lookup_config(config_tree, "Interface"), &iface);
 
        get_config_string(lookup_config(config_tree, "Device"), &device);
        get_config_string(lookup_config(config_tree, "Interface"), &iface);
 
@@ -220,8 +218,6 @@ bool setup_device(void) {
 }
 
 void close_device(void) {
 }
 
 void close_device(void) {
-       cp();
-
        CloseHandle(device_handle);
 
        free(device);
        CloseHandle(device_handle);
 
        free(device);
@@ -236,8 +232,6 @@ bool write_packet(vpn_packet_t *packet) {
        long lenout;
        OVERLAPPED overlapped = {0};
 
        long lenout;
        OVERLAPPED overlapped = {0};
 
-       cp();
-
        ifdebug(TRAFFIC) logger(LOG_DEBUG, _("Writing packet of %d bytes to %s"),
                           packet->len, device_info);
 
        ifdebug(TRAFFIC) logger(LOG_DEBUG, _("Writing packet of %d bytes to %s"),
                           packet->len, device_info);
 
@@ -252,8 +246,6 @@ bool write_packet(vpn_packet_t *packet) {
 }
 
 void dump_device_stats(void) {
 }
 
 void dump_device_stats(void) {
-       cp();
-
        logger(LOG_DEBUG, _("Statistics for %s %s:"), device_info, device);
        logger(LOG_DEBUG, _(" total bytes in:  %10d"), device_total_in);
        logger(LOG_DEBUG, _(" total bytes out: %10d"), device_total_out);
        logger(LOG_DEBUG, _("Statistics for %s %s:"), device_info, device);
        logger(LOG_DEBUG, _(" total bytes in:  %10d"), device_total_in);
        logger(LOG_DEBUG, _(" total bytes out: %10d"), device_total_out);
index 0b617bd08ac3bffaf420c570eb56de7563607f26..da5be4e60b824e141d492c4ea944223e863dbb6c 100644 (file)
--- a/src/net.c
+++ b/src/net.c
@@ -52,8 +52,6 @@ static void purge(void) {
        edge_t *e;
        subnet_t *s;
 
        edge_t *e;
        subnet_t *s;
 
-       cp();
-
        ifdebug(PROTOCOL) logger(LOG_DEBUG, _("Purging unreachable nodes"));
 
        /* Remove all edges and subnets owned by unreachable nodes. */
        ifdebug(PROTOCOL) logger(LOG_DEBUG, _("Purging unreachable nodes"));
 
        /* Remove all edges and subnets owned by unreachable nodes. */
@@ -114,8 +112,6 @@ static int build_fdset(fd_set *readset, fd_set *writeset) {
        connection_t *c;
        int i, max = 0;
 
        connection_t *c;
        int i, max = 0;
 
-       cp();
-
        FD_ZERO(readset);
        FD_ZERO(writeset);
 
        FD_ZERO(readset);
        FD_ZERO(writeset);
 
@@ -161,8 +157,6 @@ static int build_fdset(fd_set *readset, fd_set *writeset) {
   - Deactivate the host
 */
 void terminate_connection(connection_t *c, bool report) {
   - Deactivate the host
 */
 void terminate_connection(connection_t *c, bool report) {
-       cp();
-
        if(c->status.remove)
                return;
 
        if(c->status.remove)
                return;
 
@@ -227,8 +221,6 @@ static void check_dead_connections(void) {
        avl_node_t *node, *next;
        connection_t *c;
 
        avl_node_t *node, *next;
        connection_t *c;
 
-       cp();
-
        for(node = connection_tree->head; node; node = next) {
                next = node->next;
                c = node->data;
        for(node = connection_tree->head; node; node = next) {
                next = node->next;
                c = node->data;
@@ -285,8 +277,6 @@ static void check_network_activity(fd_set * readset, fd_set * writeset) {
        socklen_t len = sizeof(result);
        vpn_packet_t packet;
 
        socklen_t len = sizeof(result);
        vpn_packet_t packet;
 
-       cp();
-
        /* check input from kernel */
        if(device_fd >= 0 && FD_ISSET(device_fd, readset)) {
                if(read_packet(&packet)) {
        /* check input from kernel */
        if(device_fd >= 0 && FD_ISSET(device_fd, readset)) {
                if(read_packet(&packet)) {
@@ -352,8 +342,6 @@ int main_loop(void) {
        time_t last_ping_check, last_config_check, last_graph_dump;
        event_t *event;
 
        time_t last_ping_check, last_config_check, last_graph_dump;
        event_t *event;
 
-       cp();
-
        last_ping_check = now;
        last_config_check = now;
        last_graph_dump = now;
        last_ping_check = now;
        last_config_check = now;
        last_graph_dump = now;
@@ -383,7 +371,6 @@ int main_loop(void) {
                        if(errno != EINTR && errno != EAGAIN) {
                                logger(LOG_ERR, _("Error while waiting for input: %s"),
                                           strerror(errno));
                        if(errno != EINTR && errno != EAGAIN) {
                                logger(LOG_ERR, _("Error while waiting for input: %s"),
                                           strerror(errno));
-                               cp_trace();
                                dump_connections();
                                return 1;
                        }
                                dump_connections();
                                return 1;
                        }
index 0059b278f5e8dc22c6c7f4db8e6aca9a029e0a4d..05336b0f2265d4a097c7aff4047761b095d40b08 100644 (file)
@@ -62,8 +62,6 @@ void send_mtu_probe(node_t *n) {
        vpn_packet_t packet;
        int len, i;
        
        vpn_packet_t packet;
        int len, i;
        
-       cp();
-
        n->mtuprobes++;
        n->mtuevent = NULL;
 
        n->mtuprobes++;
        n->mtuevent = NULL;
 
@@ -158,8 +156,6 @@ static length_t uncompress_packet(uint8_t *dest, const uint8_t *source, length_t
 /* VPN packet I/O */
 
 static void receive_packet(node_t *n, vpn_packet_t *packet) {
 /* VPN packet I/O */
 
 static void receive_packet(node_t *n, vpn_packet_t *packet) {
-       cp();
-
        ifdebug(TRAFFIC) logger(LOG_DEBUG, _("Received packet of %d bytes from %s (%s)"),
                           packet->len, n->name, n->hostname);
 
        ifdebug(TRAFFIC) logger(LOG_DEBUG, _("Received packet of %d bytes from %s (%s)"),
                           packet->len, n->name, n->hostname);
 
@@ -186,8 +182,6 @@ static void receive_udppacket(node_t *n, vpn_packet_t *inpkt) {
        unsigned char hmac[EVP_MAX_MD_SIZE];
        int i;
 
        unsigned char hmac[EVP_MAX_MD_SIZE];
        int i;
 
-       cp();
-
        if(!n->inkey) {
                ifdebug(TRAFFIC) logger(LOG_DEBUG, _("Got packet from %s (%s) but he hasn't got our key yet"),
                                        n->name, n->hostname);
        if(!n->inkey) {
                ifdebug(TRAFFIC) logger(LOG_DEBUG, _("Got packet from %s (%s) but he hasn't got our key yet"),
                                        n->name, n->hostname);
@@ -297,8 +291,6 @@ static void receive_udppacket(node_t *n, vpn_packet_t *inpkt) {
 void receive_tcppacket(connection_t *c, char *buffer, int len) {
        vpn_packet_t outpkt;
 
 void receive_tcppacket(connection_t *c, char *buffer, int len) {
        vpn_packet_t outpkt;
 
-       cp();
-
        outpkt.len = len;
        if(c->options & OPTION_TCPONLY)
                outpkt.priority = 0;
        outpkt.len = len;
        if(c->options & OPTION_TCPONLY)
                outpkt.priority = 0;
@@ -321,8 +313,6 @@ static void send_udppacket(node_t *n, vpn_packet_t *origpkt) {
        int origpriority;
        int sock;
 
        int origpriority;
        int sock;
 
-       cp();
-
        if(!n->status.reachable) {
                ifdebug(TRAFFIC) logger(LOG_INFO, _("Trying to send UDP packet to unreachable node %s (%s)"), n->name, n->hostname);
                return;
        if(!n->status.reachable) {
                ifdebug(TRAFFIC) logger(LOG_INFO, _("Trying to send UDP packet to unreachable node %s (%s)"), n->name, n->hostname);
                return;
@@ -444,8 +434,6 @@ end:
 void send_packet(const node_t *n, vpn_packet_t *packet) {
        node_t *via;
 
 void send_packet(const node_t *n, vpn_packet_t *packet) {
        node_t *via;
 
-       cp();
-
        if(n == myself) {
                if(overwrite_mac)
                         memcpy(packet->data, mymac.x, ETH_ALEN);
        if(n == myself) {
                if(overwrite_mac)
                         memcpy(packet->data, mymac.x, ETH_ALEN);
@@ -481,8 +469,6 @@ void broadcast_packet(const node_t *from, vpn_packet_t *packet) {
        avl_node_t *node;
        connection_t *c;
 
        avl_node_t *node;
        connection_t *c;
 
-       cp();
-
        ifdebug(TRAFFIC) logger(LOG_INFO, _("Broadcasting packet of %d bytes from %s (%s)"),
                           packet->len, from->name, from->hostname);
 
        ifdebug(TRAFFIC) logger(LOG_INFO, _("Broadcasting packet of %d bytes from %s (%s)"),
                           packet->len, from->name, from->hostname);
 
@@ -534,8 +520,6 @@ void handle_incoming_vpn_data(int sock) {
        socklen_t fromlen = sizeof(from);
        node_t *n;
 
        socklen_t fromlen = sizeof(from);
        node_t *n;
 
-       cp();
-
        pkt.len = recvfrom(sock, (char *) &pkt.seqno, MAXSIZE, 0, &from.sa, &fromlen);
 
        if(pkt.len < 0) {
        pkt.len = recvfrom(sock, (char *) &pkt.seqno, MAXSIZE, 0, &from.sa, &fromlen);
 
        if(pkt.len < 0) {
index a6fd3d06f3729fbf6481b51c634472348293c0dc..12b09a91045e716af1165804ba54cf834ff67da2 100644 (file)
@@ -49,8 +49,6 @@ bool read_rsa_public_key(connection_t *c) {
        char *fname;
        char *key;
 
        char *fname;
        char *key;
 
-       cp();
-
        if(!c->rsa_key) {
                c->rsa_key = RSA_new();
 //             RSA_blinding_on(c->rsa_key, NULL);
        if(!c->rsa_key) {
                c->rsa_key = RSA_new();
 //             RSA_blinding_on(c->rsa_key, NULL);
@@ -149,8 +147,6 @@ bool read_rsa_private_key(void) {
        char *fname, *key, *pubkey;
        struct stat s;
 
        char *fname, *key, *pubkey;
        struct stat s;
 
-       cp();
-
        if(get_config_string(lookup_config(config_tree, "PrivateKey"), &key)) {
                if(!get_config_string(lookup_config(myself->connection->config_tree, "PublicKey"), &pubkey)) {
                        logger(LOG_ERR, _("PrivateKey used but no PublicKey found!"));
        if(get_config_string(lookup_config(config_tree, "PrivateKey"), &key)) {
                if(!get_config_string(lookup_config(myself->connection->config_tree, "PublicKey"), &pubkey)) {
                        logger(LOG_ERR, _("PrivateKey used but no PublicKey found!"));
@@ -217,8 +213,6 @@ bool setup_myself(void) {
        bool choice;
        int i, err;
 
        bool choice;
        int i, err;
 
-       cp();
-
        myself = new_node();
        myself->connection = new_connection();
        init_configuration(&myself->connection->config_tree);
        myself = new_node();
        myself->connection = new_connection();
        init_configuration(&myself->connection->config_tree);
@@ -504,8 +498,6 @@ bool setup_myself(void) {
   initialize network
 */
 bool setup_network(void) {
   initialize network
 */
 bool setup_network(void) {
-       cp();
-
        now = time(NULL);
 
        init_events();
        now = time(NULL);
 
        init_events();
@@ -545,8 +537,6 @@ void close_network_connections(void) {
        char *envp[5];
        int i;
 
        char *envp[5];
        int i;
 
-       cp();
-
        for(node = connection_tree->head; node; node = next) {
                next = node->next;
                c = node->data;
        for(node = connection_tree->head; node; node = next) {
                next = node->next;
                c = node->data;
index 5f6cd2a1a83791507c93606d52f5217aa0d0026d..8c8054900ba0fd718b6472e6d2d5e8c079e45a59 100644 (file)
@@ -175,8 +175,6 @@ int setup_listen_socket(const sockaddr_t *sa) {
        int option;
        char *iface;
 
        int option;
        char *iface;
 
-       cp();
-
        nfd = socket(sa->sa.sa_family, SOCK_STREAM, IPPROTO_TCP);
 
        if(nfd < 0) {
        nfd = socket(sa->sa.sa_family, SOCK_STREAM, IPPROTO_TCP);
 
        if(nfd < 0) {
@@ -237,8 +235,6 @@ int setup_vpn_in_socket(const sockaddr_t *sa) {
        char *addrstr;
        int option;
 
        char *addrstr;
        int option;
 
-       cp();
-
        nfd = socket(sa->sa.sa_family, SOCK_DGRAM, IPPROTO_UDP);
 
        if(nfd < 0) {
        nfd = socket(sa->sa.sa_family, SOCK_DGRAM, IPPROTO_UDP);
 
        if(nfd < 0) {
@@ -311,8 +307,6 @@ int setup_vpn_in_socket(const sockaddr_t *sa) {
 void retry_outgoing(outgoing_t *outgoing) {
        event_t *event;
 
 void retry_outgoing(outgoing_t *outgoing) {
        event_t *event;
 
-       cp();
-
        outgoing->timeout += 5;
 
        if(outgoing->timeout > maxtimeout)
        outgoing->timeout += 5;
 
        if(outgoing->timeout > maxtimeout)
@@ -330,8 +324,6 @@ void retry_outgoing(outgoing_t *outgoing) {
 }
 
 void finish_connecting(connection_t *c) {
 }
 
 void finish_connecting(connection_t *c) {
-       cp();
-
        ifdebug(CONNECTIONS) logger(LOG_INFO, _("Connected to %s (%s)"), c->name, c->hostname);
 
        configure_tcp(c);
        ifdebug(CONNECTIONS) logger(LOG_INFO, _("Connected to %s (%s)"), c->name, c->hostname);
 
        configure_tcp(c);
@@ -345,8 +337,6 @@ void do_outgoing_connection(connection_t *c) {
        char *address, *port;
        int result;
 
        char *address, *port;
        int result;
 
-       cp();
-
 begin:
        if(!c->outgoing->ai) {
                if(!c->outgoing->cfg) {
 begin:
        if(!c->outgoing->ai) {
                if(!c->outgoing->cfg) {
@@ -440,8 +430,6 @@ void setup_outgoing_connection(outgoing_t *outgoing) {
        connection_t *c;
        node_t *n;
 
        connection_t *c;
        node_t *n;
 
-       cp();
-
        n = lookup_node(outgoing->name);
 
        if(n)
        n = lookup_node(outgoing->name);
 
        if(n)
@@ -488,8 +476,6 @@ bool handle_new_meta_connection(int sock) {
        int fd;
        socklen_t len = sizeof(sa);
 
        int fd;
        socklen_t len = sizeof(sa);
 
-       cp();
-
        fd = accept(sock, &sa.sa, &len);
 
        if(fd < 0) {
        fd = accept(sock, &sa.sa, &len);
 
        if(fd < 0) {
@@ -541,8 +527,6 @@ void try_outgoing_connections(void) {
        connection_t *c;
        avl_node_t *node;
        
        connection_t *c;
        avl_node_t *node;
        
-       cp();
-
        if(outgoing_list) {
                for(node = connection_tree->head; node; node = node->next) {
                        c = node->data;
        if(outgoing_list) {
                for(node = connection_tree->head; node; node = node->next) {
                        c = node->data;
index 9872480f44a52a0d0c93eeac68c4398e5f81513c..7eadaebff9d3ae43a3071b0f6ea556182a3cf2c2 100644 (file)
@@ -36,8 +36,6 @@ struct addrinfo *str2addrinfo(const char *address, const char *service, int sock
        struct addrinfo *ai, hint = {0};
        int err;
 
        struct addrinfo *ai, hint = {0};
        int err;
 
-       cp();
-
        hint.ai_family = addressfamily;
        hint.ai_socktype = socktype;
 
        hint.ai_family = addressfamily;
        hint.ai_socktype = socktype;
 
@@ -57,8 +55,6 @@ sockaddr_t str2sockaddr(const char *address, const char *port) {
        sockaddr_t result;
        int err;
 
        sockaddr_t result;
        int err;
 
-       cp();
-
        hint.ai_family = AF_UNSPEC;
        hint.ai_flags = AI_NUMERICHOST;
        hint.ai_socktype = SOCK_STREAM;
        hint.ai_family = AF_UNSPEC;
        hint.ai_flags = AI_NUMERICHOST;
        hint.ai_socktype = SOCK_STREAM;
@@ -86,8 +82,6 @@ void sockaddr2str(const sockaddr_t *sa, char **addrstr, char **portstr) {
        char *scopeid;
        int err;
 
        char *scopeid;
        int err;
 
-       cp();
-
        if(sa->sa.sa_family == AF_UNKNOWN) {
                *addrstr = xstrdup(sa->unknown.address);
                *portstr = xstrdup(sa->unknown.port);
        if(sa->sa.sa_family == AF_UNKNOWN) {
                *addrstr = xstrdup(sa->unknown.address);
                *portstr = xstrdup(sa->unknown.port);
@@ -99,7 +93,6 @@ void sockaddr2str(const sockaddr_t *sa, char **addrstr, char **portstr) {
        if(err) {
                logger(LOG_ERR, _("Error while translating addresses: %s"),
                           gai_strerror(err));
        if(err) {
                logger(LOG_ERR, _("Error while translating addresses: %s"),
                           gai_strerror(err));
-               cp_trace();
                raise(SIGFPE);
                exit(0);
        }
                raise(SIGFPE);
                exit(0);
        }
@@ -119,8 +112,6 @@ char *sockaddr2hostname(const sockaddr_t *sa) {
        char port[NI_MAXSERV] = "unknown";
        int err;
 
        char port[NI_MAXSERV] = "unknown";
        int err;
 
-       cp();
-
        if(sa->sa.sa_family == AF_UNKNOWN) {
                xasprintf(&str, _("%s port %s"), sa->unknown.address, sa->unknown.port);
                return str;
        if(sa->sa.sa_family == AF_UNKNOWN) {
                xasprintf(&str, _("%s port %s"), sa->unknown.address, sa->unknown.port);
                return str;
@@ -141,8 +132,6 @@ char *sockaddr2hostname(const sockaddr_t *sa) {
 int sockaddrcmp_noport(const sockaddr_t *a, const sockaddr_t *b) {
        int result;
 
 int sockaddrcmp_noport(const sockaddr_t *a, const sockaddr_t *b) {
        int result;
 
-       cp();
-
        result = a->sa.sa_family - b->sa.sa_family;
 
        if(result)
        result = a->sa.sa_family - b->sa.sa_family;
 
        if(result)
@@ -164,7 +153,6 @@ int sockaddrcmp_noport(const sockaddr_t *a, const sockaddr_t *b) {
                default:
                        logger(LOG_ERR, _("sockaddrcmp() was called with unknown address family %d, exitting!"),
                                   a->sa.sa_family);
                default:
                        logger(LOG_ERR, _("sockaddrcmp() was called with unknown address family %d, exitting!"),
                                   a->sa.sa_family);
-                       cp_trace();
                        raise(SIGFPE);
                        exit(0);
        }
                        raise(SIGFPE);
                        exit(0);
        }
@@ -173,8 +161,6 @@ int sockaddrcmp_noport(const sockaddr_t *a, const sockaddr_t *b) {
 int sockaddrcmp(const sockaddr_t *a, const sockaddr_t *b) {
        int result;
 
 int sockaddrcmp(const sockaddr_t *a, const sockaddr_t *b) {
        int result;
 
-       cp();
-
        result = a->sa.sa_family - b->sa.sa_family;
 
        if(result)
        result = a->sa.sa_family - b->sa.sa_family;
 
        if(result)
@@ -211,15 +197,12 @@ int sockaddrcmp(const sockaddr_t *a, const sockaddr_t *b) {
                default:
                        logger(LOG_ERR, _("sockaddrcmp() was called with unknown address family %d, exitting!"),
                                   a->sa.sa_family);
                default:
                        logger(LOG_ERR, _("sockaddrcmp() was called with unknown address family %d, exitting!"),
                                   a->sa.sa_family);
-                       cp_trace();
                        raise(SIGFPE);
                        exit(0);
        }
 }
 
 void sockaddrcpy(sockaddr_t *a, const sockaddr_t *b) {
                        raise(SIGFPE);
                        exit(0);
        }
 }
 
 void sockaddrcpy(sockaddr_t *a, const sockaddr_t *b) {
-       cp();
-
        if(b->sa.sa_family != AF_UNKNOWN) {
                *a = *b;
        } else {
        if(b->sa.sa_family != AF_UNKNOWN) {
                *a = *b;
        } else {
@@ -230,8 +213,6 @@ void sockaddrcpy(sockaddr_t *a, const sockaddr_t *b) {
 }
 
 void sockaddrfree(sockaddr_t *a) {
 }
 
 void sockaddrfree(sockaddr_t *a) {
-       cp();
-
        if(a->sa.sa_family == AF_UNKNOWN) {
                free(a->unknown.address);
                free(a->unknown.port);
        if(a->sa.sa_family == AF_UNKNOWN) {
                free(a->unknown.address);
                free(a->unknown.port);
@@ -239,8 +220,6 @@ void sockaddrfree(sockaddr_t *a) {
 }
        
 void sockaddrunmap(sockaddr_t *sa) {
 }
        
 void sockaddrunmap(sockaddr_t *sa) {
-       cp();
-
        if(sa->sa.sa_family == AF_INET6 && IN6_IS_ADDR_V4MAPPED(&sa->in6.sin6_addr)) {
                sa->in.sin_addr.s_addr = ((uint32_t *) & sa->in6.sin6_addr)[3];
                sa->in.sin_family = AF_INET;
        if(sa->sa.sa_family == AF_INET6 && IN6_IS_ADDR_V4MAPPED(&sa->in6.sin6_addr)) {
                sa->in.sin_addr.s_addr = ((uint32_t *) & sa->in6.sin6_addr)[3];
                sa->in.sin_family = AF_INET;
@@ -254,8 +233,6 @@ int maskcmp(const void *va, const void *vb, int masklen) {
        const char *a = va;
        const char *b = vb;
 
        const char *a = va;
        const char *b = vb;
 
-       cp();
-
        for(m = masklen, i = 0; m >= 8; m -= 8, i++) {
                result = a[i] - b[i];
                if(result)
        for(m = masklen, i = 0; m >= 8; m -= 8, i++) {
                result = a[i] - b[i];
                if(result)
@@ -273,8 +250,6 @@ void mask(void *va, int masklen, int len) {
        int i;
        char *a = va;
 
        int i;
        char *a = va;
 
-       cp();
-
        i = masklen / 8;
        masklen %= 8;
 
        i = masklen / 8;
        masklen %= 8;
 
@@ -290,8 +265,6 @@ void maskcpy(void *va, const void *vb, int masklen, int len) {
        char *a = va;
        const char *b = vb;
 
        char *a = va;
        const char *b = vb;
 
-       cp();
-
        for(m = masklen, i = 0; m >= 8; m -= 8, i++)
                a[i] = b[i];
 
        for(m = masklen, i = 0; m >= 8; m -= 8, i++)
                a[i] = b[i];
 
@@ -308,8 +281,6 @@ bool maskcheck(const void *va, int masklen, int len) {
        int i;
        const char *a = va;
 
        int i;
        const char *a = va;
 
-       cp();
-
        i = masklen / 8;
        masklen %= 8;
 
        i = masklen / 8;
        masklen %= 8;
 
index 92af66a9310444c2b2bdbf3c8144d28f29cc7d0c..579f05c2ab35988911f48f404f0681ec3066f90d 100644 (file)
@@ -42,15 +42,11 @@ static int node_udp_compare(const node_t *a, const node_t *b) {
 }
 
 void init_nodes(void) {
 }
 
 void init_nodes(void) {
-       cp();
-
        node_tree = avl_alloc_tree((avl_compare_t) node_compare, (avl_action_t) free_node);
        node_udp_tree = avl_alloc_tree((avl_compare_t) node_udp_compare, NULL);
 }
 
 void exit_nodes(void) {
        node_tree = avl_alloc_tree((avl_compare_t) node_compare, (avl_action_t) free_node);
        node_udp_tree = avl_alloc_tree((avl_compare_t) node_udp_compare, NULL);
 }
 
 void exit_nodes(void) {
-       cp();
-
        avl_delete_tree(node_udp_tree);
        avl_delete_tree(node_tree);
 }
        avl_delete_tree(node_udp_tree);
        avl_delete_tree(node_tree);
 }
@@ -58,8 +54,6 @@ void exit_nodes(void) {
 node_t *new_node(void) {
        node_t *n = xmalloc_and_zero(sizeof(*n));
 
 node_t *new_node(void) {
        node_t *n = xmalloc_and_zero(sizeof(*n));
 
-       cp();
-
        n->subnet_tree = new_subnet_tree();
        n->edge_tree = new_edge_tree();
        EVP_CIPHER_CTX_init(&n->inctx);
        n->subnet_tree = new_subnet_tree();
        n->edge_tree = new_edge_tree();
        EVP_CIPHER_CTX_init(&n->inctx);
@@ -71,8 +65,6 @@ node_t *new_node(void) {
 }
 
 void free_node(node_t *n) {
 }
 
 void free_node(node_t *n) {
-       cp();
-
        if(n->inkey)
                free(n->inkey);
 
        if(n->inkey)
                free(n->inkey);
 
@@ -103,8 +95,6 @@ void free_node(node_t *n) {
 }
 
 void node_add(node_t *n) {
 }
 
 void node_add(node_t *n) {
-       cp();
-
        avl_insert(node_tree, n);
 }
 
        avl_insert(node_tree, n);
 }
 
@@ -113,8 +103,6 @@ void node_del(node_t *n) {
        edge_t *e;
        subnet_t *s;
 
        edge_t *e;
        subnet_t *s;
 
-       cp();
-
        for(node = n->subnet_tree->head; node; node = next) {
                next = node->next;
                s = node->data;
        for(node = n->subnet_tree->head; node; node = next) {
                next = node->next;
                s = node->data;
@@ -134,8 +122,6 @@ void node_del(node_t *n) {
 node_t *lookup_node(char *name) {
        node_t n = {0};
 
 node_t *lookup_node(char *name) {
        node_t n = {0};
 
-       cp();
-       
        n.name = name;
 
        return avl_search(node_tree, &n);
        n.name = name;
 
        return avl_search(node_tree, &n);
@@ -144,8 +130,6 @@ node_t *lookup_node(char *name) {
 node_t *lookup_node_udp(const sockaddr_t *sa) {
        node_t n = {0};
 
 node_t *lookup_node_udp(const sockaddr_t *sa) {
        node_t n = {0};
 
-       cp();
-
        n.address = *sa;
        n.name = NULL;
 
        n.address = *sa;
        n.name = NULL;
 
@@ -174,8 +158,6 @@ void dump_nodes(void) {
        avl_node_t *node;
        node_t *n;
 
        avl_node_t *node;
        node_t *n;
 
-       cp();
-
        logger(LOG_DEBUG, _("Nodes:"));
 
        for(node = node_tree->head; node; node = node->next) {
        logger(LOG_DEBUG, _("Nodes:"));
 
        for(node = node_tree->head; node; node = node->next) {
index 406661031628f55e2ef56f51e345fe2a43b2c892..b8bb82147485b0b2c5f05f5a4ff3986f6ec0d54a 100644 (file)
@@ -49,7 +49,6 @@ static int saved_debug_level = -1;
 
 static void memory_full(int size) {
        logger(LOG_ERR, _("Memory exhausted (couldn't allocate %d bytes), exitting."), size);
 
 static void memory_full(int size) {
        logger(LOG_ERR, _("Memory exhausted (couldn't allocate %d bytes), exitting."), size);
-       cp_trace();
        exit(1);
 }
 
        exit(1);
 }
 
@@ -241,8 +240,6 @@ bool init_service(void) {
 static bool write_pidfile(void) {
        pid_t pid;
 
 static bool write_pidfile(void) {
        pid_t pid;
 
-       cp();
-
        pid = check_pid(pidfilename);
 
        if(pid) {
        pid = check_pid(pidfilename);
 
        if(pid) {
@@ -271,8 +268,6 @@ bool kill_other(int signal) {
 #ifndef HAVE_MINGW
        pid_t pid;
 
 #ifndef HAVE_MINGW
        pid_t pid;
 
-       cp();
-
        pid = read_pid(pidfilename);
 
        if(!pid) {
        pid = read_pid(pidfilename);
 
        if(!pid) {
@@ -308,8 +303,6 @@ bool kill_other(int signal) {
   Detach from current terminal, write pidfile, kill parent
 */
 bool detach(void) {
   Detach from current terminal, write pidfile, kill parent
 */
 bool detach(void) {
-       cp();
-
        setup_signals();
 
        /* First check if we can open a fresh new pidfile */
        setup_signals();
 
        /* First check if we can open a fresh new pidfile */
@@ -359,8 +352,6 @@ bool execute_script(const char *name, char **envp) {
        char *scriptname, *p;
        int i;
 
        char *scriptname, *p;
        int i;
 
-       cp();
-
 #ifndef HAVE_MINGW
        len = xasprintf(&scriptname, "\"%s/%s\"", confbase, name);
 #else
 #ifndef HAVE_MINGW
        len = xasprintf(&scriptname, "\"%s/%s\"", confbase, name);
 #else
@@ -456,14 +447,12 @@ static RETSIGTYPE sigquit_handler(int a) {
 static RETSIGTYPE fatal_signal_square(int a) {
        logger(LOG_ERR, _("Got another fatal signal %d (%s): not restarting."), a,
                   strsignal(a));
 static RETSIGTYPE fatal_signal_square(int a) {
        logger(LOG_ERR, _("Got another fatal signal %d (%s): not restarting."), a,
                   strsignal(a));
-       cp_trace();
        exit(1);
 }
 
 static RETSIGTYPE fatal_signal_handler(int a) {
        struct sigaction act;
        logger(LOG_ERR, _("Got fatal signal %d (%s)"), a, strsignal(a));
        exit(1);
 }
 
 static RETSIGTYPE fatal_signal_handler(int a) {
        struct sigaction act;
        logger(LOG_ERR, _("Got fatal signal %d (%s)"), a, strsignal(a));
-       cp_trace();
 
        if(do_detach) {
                logger(LOG_NOTICE, _("Trying to re-execute in 5 seconds..."));
 
        if(do_detach) {
                logger(LOG_NOTICE, _("Trying to re-execute in 5 seconds..."));
@@ -527,7 +516,6 @@ static RETSIGTYPE sigwinch_handler(int a) {
 
 static RETSIGTYPE unexpected_signal_handler(int a) {
        logger(LOG_WARNING, _("Got unexpected signal %d (%s)"), a, strsignal(a));
 
 static RETSIGTYPE unexpected_signal_handler(int a) {
        logger(LOG_WARNING, _("Got unexpected signal %d (%s)"), a, strsignal(a));
-       cp_trace();
 }
 
 static RETSIGTYPE ignore_signal_handler(int a) {
 }
 
 static RETSIGTYPE ignore_signal_handler(int a) {
index 78781a6c72d2733e8627ba8b026c0b92fa8a70b9..5e0881631e261d2d0feb9d7c4b5d3cd91fb016f3 100644 (file)
@@ -69,8 +69,6 @@ bool send_request(connection_t *c, const char *format, ...) {
        char buffer[MAXBUFSIZE];
        int len, request;
 
        char buffer[MAXBUFSIZE];
        int len, request;
 
-       cp();
-
        /* Use vsnprintf instead of vxasprintf: faster, no memory
           fragmentation, cleanup is automatic, and there is a limit on the
           input buffer anyway */
        /* Use vsnprintf instead of vxasprintf: faster, no memory
           fragmentation, cleanup is automatic, and there is a limit on the
           input buffer anyway */
@@ -107,8 +105,6 @@ bool send_request(connection_t *c, const char *format, ...) {
 void forward_request(connection_t *from) {
        int request;
 
 void forward_request(connection_t *from) {
        int request;
 
-       cp();
-
        ifdebug(PROTOCOL) {
                sscanf(from->buffer, "%d", &request);
                ifdebug(META)
        ifdebug(PROTOCOL) {
                sscanf(from->buffer, "%d", &request);
                ifdebug(META)
@@ -128,8 +124,6 @@ void forward_request(connection_t *from) {
 bool receive_request(connection_t *c) {
        int request;
 
 bool receive_request(connection_t *c) {
        int request;
 
-       cp();
-
        if(sscanf(c->buffer, "%d", &request) == 1) {
                if((request < 0) || (request >= LAST) || !request_handlers[request]) {
                        ifdebug(META)
        if(sscanf(c->buffer, "%d", &request) == 1) {
                if((request < 0) || (request >= LAST) || !request_handlers[request]) {
                        ifdebug(META)
@@ -179,8 +173,6 @@ static int past_request_compare(const past_request_t *a, const past_request_t *b
 }
 
 static void free_past_request(past_request_t *r) {
 }
 
 static void free_past_request(past_request_t *r) {
-       cp();
-
        if(r->request)
                free(r->request);
 
        if(r->request)
                free(r->request);
 
@@ -188,22 +180,16 @@ static void free_past_request(past_request_t *r) {
 }
 
 void init_requests(void) {
 }
 
 void init_requests(void) {
-       cp();
-
        past_request_tree = avl_alloc_tree((avl_compare_t) past_request_compare, (avl_action_t) free_past_request);
 }
 
 void exit_requests(void) {
        past_request_tree = avl_alloc_tree((avl_compare_t) past_request_compare, (avl_action_t) free_past_request);
 }
 
 void exit_requests(void) {
-       cp();
-
        avl_delete_tree(past_request_tree);
 }
 
 bool seen_request(char *request) {
        past_request_t *new, p = {0};
 
        avl_delete_tree(past_request_tree);
 }
 
 bool seen_request(char *request) {
        past_request_t *new, p = {0};
 
-       cp();
-
        p.request = request;
 
        if(avl_search(past_request_tree, &p)) {
        p.request = request;
 
        if(avl_search(past_request_tree, &p)) {
@@ -223,8 +209,6 @@ void age_past_requests(void) {
        past_request_t *p;
        int left = 0, deleted = 0;
 
        past_request_t *p;
        int left = 0, deleted = 0;
 
-       cp();
-
        for(node = past_request_tree->head; node; node = next) {
                next = node->next;
                p = node->data;
        for(node = past_request_tree->head; node; node = next) {
                next = node->next;
                p = node->data;
index 5926a124621189491559fb4cbecac3c10b4646a7..1c6df401a600833d7bfb1c855d0640a747ba753c 100644 (file)
@@ -39,8 +39,6 @@
 #include "xalloc.h"
 
 bool send_id(connection_t *c) {
 #include "xalloc.h"
 
 bool send_id(connection_t *c) {
-       cp();
-
        return send_request(c, "%d %s %d", ID, myself->connection->name,
                                                myself->connection->protocol_version);
 }
        return send_request(c, "%d %s %d", ID, myself->connection->name,
                                                myself->connection->protocol_version);
 }
@@ -48,8 +46,6 @@ bool send_id(connection_t *c) {
 bool id_h(connection_t *c) {
        char name[MAX_STRING_SIZE];
 
 bool id_h(connection_t *c) {
        char name[MAX_STRING_SIZE];
 
-       cp();
-
        if(sscanf(c->buffer, "%*d " MAX_STRING " %d", name, &c->protocol_version) != 2) {
                logger(LOG_ERR, _("Got bad %s from %s (%s)"), "ID", c->name,
                           c->hostname);
        if(sscanf(c->buffer, "%*d " MAX_STRING " %d", name, &c->protocol_version) != 2) {
                logger(LOG_ERR, _("Got bad %s from %s (%s)"), "ID", c->name,
                           c->hostname);
@@ -117,8 +113,6 @@ bool send_metakey(connection_t *c) {
        int len;
        bool x;
 
        int len;
        bool x;
 
-       cp();
-
        len = RSA_size(c->rsa_key);
 
        /* Allocate buffers for the meta key */
        len = RSA_size(c->rsa_key);
 
        /* Allocate buffers for the meta key */
@@ -129,7 +123,7 @@ bool send_metakey(connection_t *c) {
 
        if(!c->outctx)
                c->outctx = xmalloc_and_zero(sizeof(*c->outctx));
 
        if(!c->outctx)
                c->outctx = xmalloc_and_zero(sizeof(*c->outctx));
-       cp();
+
        /* Copy random data to the buffer */
 
        RAND_pseudo_bytes((unsigned char *)c->outkey, len);
        /* Copy random data to the buffer */
 
        RAND_pseudo_bytes((unsigned char *)c->outkey, len);
@@ -201,8 +195,6 @@ bool metakey_h(connection_t *c) {
        int cipher, digest, maclength, compression;
        int len;
 
        int cipher, digest, maclength, compression;
        int len;
 
-       cp();
-
        if(sscanf(c->buffer, "%*d %d %d %d %d " MAX_STRING, &cipher, &digest, &maclength, &compression, buffer) != 5) {
                logger(LOG_ERR, _("Got bad %s from %s (%s)"), "METAKEY", c->name,
                           c->hostname);
        if(sscanf(c->buffer, "%*d %d %d %d %d " MAX_STRING, &cipher, &digest, &maclength, &compression, buffer) != 5) {
                logger(LOG_ERR, _("Got bad %s from %s (%s)"), "METAKEY", c->name,
                           c->hostname);
@@ -298,8 +290,6 @@ bool send_challenge(connection_t *c) {
        char *buffer;
        int len;
 
        char *buffer;
        int len;
 
-       cp();
-
        /* CHECKME: what is most reasonable value for len? */
 
        len = RSA_size(c->rsa_key);
        /* CHECKME: what is most reasonable value for len? */
 
        len = RSA_size(c->rsa_key);
@@ -328,8 +318,6 @@ bool challenge_h(connection_t *c) {
        char buffer[MAX_STRING_SIZE];
        int len;
 
        char buffer[MAX_STRING_SIZE];
        int len;
 
-       cp();
-
        if(sscanf(c->buffer, "%*d " MAX_STRING, buffer) != 1) {
                logger(LOG_ERR, _("Got bad %s from %s (%s)"), "CHALLENGE", c->name,
                           c->hostname);
        if(sscanf(c->buffer, "%*d " MAX_STRING, buffer) != 1) {
                logger(LOG_ERR, _("Got bad %s from %s (%s)"), "CHALLENGE", c->name,
                           c->hostname);
@@ -365,8 +353,6 @@ bool send_chal_reply(connection_t *c) {
        char hash[EVP_MAX_MD_SIZE * 2 + 1];
        EVP_MD_CTX ctx;
 
        char hash[EVP_MAX_MD_SIZE * 2 + 1];
        EVP_MD_CTX ctx;
 
-       cp();
-
        /* Calculate the hash from the challenge we received */
 
        if(!EVP_DigestInit(&ctx, c->indigest)
        /* Calculate the hash from the challenge we received */
 
        if(!EVP_DigestInit(&ctx, c->indigest)
@@ -392,8 +378,6 @@ bool chal_reply_h(connection_t *c) {
        char myhash[EVP_MAX_MD_SIZE];
        EVP_MD_CTX ctx;
 
        char myhash[EVP_MAX_MD_SIZE];
        EVP_MD_CTX ctx;
 
-       cp();
-
        if(sscanf(c->buffer, "%*d " MAX_STRING, hishash) != 1) {
                logger(LOG_ERR, _("Got bad %s from %s (%s)"), "CHAL_REPLY", c->name,
                           c->hostname);
        if(sscanf(c->buffer, "%*d " MAX_STRING, hishash) != 1) {
                logger(LOG_ERR, _("Got bad %s from %s (%s)"), "CHAL_REPLY", c->name,
                           c->hostname);
@@ -453,8 +437,6 @@ bool send_ack(connection_t *c) {
        struct timeval now;
        bool choice;
 
        struct timeval now;
        bool choice;
 
-       cp();
-
        /* Estimate weight */
 
        gettimeofday(&now, NULL);
        /* Estimate weight */
 
        gettimeofday(&now, NULL);
@@ -515,8 +497,6 @@ bool ack_h(connection_t *c) {
        long int options;
        node_t *n;
 
        long int options;
        node_t *n;
 
-       cp();
-
        if(sscanf(c->buffer, "%*d " MAX_STRING " %d %lx", hisport, &weight, &options) != 3) {
                logger(LOG_ERR, _("Got bad %s from %s (%s)"), "ACK", c->name,
                           c->hostname);
        if(sscanf(c->buffer, "%*d " MAX_STRING " %d %lx", hisport, &weight, &options) != 3) {
                logger(LOG_ERR, _("Got bad %s from %s (%s)"), "ACK", c->name,
                           c->hostname);
@@ -571,7 +551,6 @@ bool ack_h(connection_t *c) {
        /* Create an edge_t for this connection */
 
        c->edge = new_edge();
        /* Create an edge_t for this connection */
 
        c->edge = new_edge();
-       cp();
        c->edge->from = myself;
        c->edge->to = n;
        sockaddr2str(&c->address, &hisaddress, &dummy);
        c->edge->from = myself;
        c->edge->to = n;
        sockaddr2str(&c->address, &hisaddress, &dummy);
index 6fa9dee8317a5ec3fff8470cfcf311fbc98430d9..03a91ba2f236b42e23d02ea365553b3ed70c4756 100644 (file)
@@ -39,8 +39,6 @@ bool send_add_edge(connection_t *c, const edge_t *e) {
        bool x;
        char *address, *port;
 
        bool x;
        char *address, *port;
 
-       cp();
-
        sockaddr2str(&e->address, &address, &port);
 
        x = send_request(c, "%d %x %s %s %s %s %lx %d", ADD_EDGE, rand(),
        sockaddr2str(&e->address, &address, &port);
 
        x = send_request(c, "%d %x %s %s %s %s %lx %d", ADD_EDGE, rand(),
@@ -63,8 +61,6 @@ bool add_edge_h(connection_t *c) {
        long int options;
        int weight;
 
        long int options;
        int weight;
 
-       cp();
-
        if(sscanf(c->buffer, "%*d %*x "MAX_STRING" "MAX_STRING" "MAX_STRING" "MAX_STRING" %lx %d",
                          from_name, to_name, to_address, to_port, &options, &weight) != 6) {
                logger(LOG_ERR, _("Got bad %s from %s (%s)"), "ADD_EDGE", c->name,
        if(sscanf(c->buffer, "%*d %*x "MAX_STRING" "MAX_STRING" "MAX_STRING" "MAX_STRING" %lx %d",
                          from_name, to_name, to_address, to_port, &options, &weight) != 6) {
                logger(LOG_ERR, _("Got bad %s from %s (%s)"), "ADD_EDGE", c->name,
@@ -172,8 +168,6 @@ bool add_edge_h(connection_t *c) {
 }
 
 bool send_del_edge(connection_t *c, const edge_t *e) {
 }
 
 bool send_del_edge(connection_t *c, const edge_t *e) {
-       cp();
-
        return send_request(c, "%d %x %s %s", DEL_EDGE, rand(),
                                                e->from->name, e->to->name);
 }
        return send_request(c, "%d %x %s %s", DEL_EDGE, rand(),
                                                e->from->name, e->to->name);
 }
@@ -184,8 +178,6 @@ bool del_edge_h(connection_t *c) {
        char to_name[MAX_STRING_SIZE];
        node_t *from, *to;
 
        char to_name[MAX_STRING_SIZE];
        node_t *from, *to;
 
-       cp();
-
        if(sscanf(c->buffer, "%*d %*x "MAX_STRING" "MAX_STRING, from_name, to_name) != 2) {
                logger(LOG_ERR, _("Got bad %s from %s (%s)"), "DEL_EDGE", c->name,
                           c->hostname);
        if(sscanf(c->buffer, "%*d %*x "MAX_STRING" "MAX_STRING, from_name, to_name) != 2) {
                logger(LOG_ERR, _("Got bad %s from %s (%s)"), "DEL_EDGE", c->name,
                           c->hostname);
index cd95d9c425e93f4316c83fab01aa9b6928ac4765..8517411824cd08c1cb7f4580acf67e226464acf0 100644 (file)
@@ -37,8 +37,6 @@
 bool mykeyused = false;
 
 bool send_key_changed() {
 bool mykeyused = false;
 
 bool send_key_changed() {
-       cp();
-
        /* Only send this message if some other daemon requested our key previously.
           This reduces unnecessary key_changed broadcasts.
         */
        /* Only send this message if some other daemon requested our key previously.
           This reduces unnecessary key_changed broadcasts.
         */
@@ -53,8 +51,6 @@ bool key_changed_h(connection_t *c) {
        char name[MAX_STRING_SIZE];
        node_t *n;
 
        char name[MAX_STRING_SIZE];
        node_t *n;
 
-       cp();
-
        if(sscanf(c->buffer, "%*d %*x " MAX_STRING, name) != 1) {
                logger(LOG_ERR, _("Got bad %s from %s (%s)"), "KEY_CHANGED",
                           c->name, c->hostname);
        if(sscanf(c->buffer, "%*d %*x " MAX_STRING, name) != 1) {
                logger(LOG_ERR, _("Got bad %s from %s (%s)"), "KEY_CHANGED",
                           c->name, c->hostname);
@@ -84,8 +80,6 @@ bool key_changed_h(connection_t *c) {
 }
 
 bool send_req_key(node_t *to) {
 }
 
 bool send_req_key(node_t *to) {
-       cp();
-
        return send_request(to->nexthop->connection, "%d %s %s", REQ_KEY, myself->name, to->name);
 }
 
        return send_request(to->nexthop->connection, "%d %s %s", REQ_KEY, myself->name, to->name);
 }
 
@@ -94,8 +88,6 @@ bool req_key_h(connection_t *c) {
        char to_name[MAX_STRING_SIZE];
        node_t *from, *to;
 
        char to_name[MAX_STRING_SIZE];
        node_t *from, *to;
 
-       cp();
-
        if(sscanf(c->buffer, "%*d " MAX_STRING " " MAX_STRING, from_name, to_name) != 2) {
                logger(LOG_ERR, _("Got bad %s from %s (%s)"), "REQ_KEY", c->name,
                           c->hostname);
        if(sscanf(c->buffer, "%*d " MAX_STRING " " MAX_STRING, from_name, to_name) != 2) {
                logger(LOG_ERR, _("Got bad %s from %s (%s)"), "REQ_KEY", c->name,
                           c->hostname);
@@ -141,8 +133,6 @@ bool req_key_h(connection_t *c) {
 bool send_ans_key(node_t *to) {
        char *key;
 
 bool send_ans_key(node_t *to) {
        char *key;
 
-       cp();
-
        // Set key parameters
        to->incipher = myself->incipher;
        to->inkeylength = myself->inkeylength;
        // Set key parameters
        to->incipher = myself->incipher;
        to->inkeylength = myself->inkeylength;
@@ -182,8 +172,6 @@ bool ans_key_h(connection_t *c) {
        int cipher, digest, maclength, compression;
        node_t *from, *to;
 
        int cipher, digest, maclength, compression;
        node_t *from, *to;
 
-       cp();
-
        if(sscanf(c->buffer, "%*d "MAX_STRING" "MAX_STRING" "MAX_STRING" %d %d %d %d",
                from_name, to_name, key, &cipher, &digest, &maclength,
                &compression) != 7) {
        if(sscanf(c->buffer, "%*d "MAX_STRING" "MAX_STRING" "MAX_STRING" %d %d %d %d",
                from_name, to_name, key, &cipher, &digest, &maclength,
                &compression) != 7) {
index 5499b344f5106a9fbea8b352d2fb2b6bc8cb4c3a..8a536e37ea90898ecd07d20a3cd21c0f1acf7163 100644 (file)
@@ -34,8 +34,6 @@ int maxoutbufsize = 0;
 /* Status and error notification routines */
 
 bool send_status(connection_t *c, int statusno, const char *statusstring) {
 /* Status and error notification routines */
 
 bool send_status(connection_t *c, int statusno, const char *statusstring) {
-       cp();
-
        if(!statusstring)
                statusstring = "Status";
 
        if(!statusstring)
                statusstring = "Status";
 
@@ -46,8 +44,6 @@ bool status_h(connection_t *c) {
        int statusno;
        char statusstring[MAX_STRING_SIZE];
 
        int statusno;
        char statusstring[MAX_STRING_SIZE];
 
-       cp();
-
        if(sscanf(c->buffer, "%*d %d " MAX_STRING, &statusno, statusstring) != 2) {
                logger(LOG_ERR, _("Got bad %s from %s (%s)"), "STATUS",
                           c->name, c->hostname);
        if(sscanf(c->buffer, "%*d %d " MAX_STRING, &statusno, statusstring) != 2) {
                logger(LOG_ERR, _("Got bad %s from %s (%s)"), "STATUS",
                           c->name, c->hostname);
@@ -61,8 +57,6 @@ bool status_h(connection_t *c) {
 }
 
 bool send_error(connection_t *c, int err, const char *errstring) {
 }
 
 bool send_error(connection_t *c, int err, const char *errstring) {
-       cp();
-
        if(!errstring)
                errstring = "Error";
 
        if(!errstring)
                errstring = "Error";
 
@@ -73,8 +67,6 @@ bool error_h(connection_t *c) {
        int err;
        char errorstring[MAX_STRING_SIZE];
 
        int err;
        char errorstring[MAX_STRING_SIZE];
 
-       cp();
-
        if(sscanf(c->buffer, "%*d %d " MAX_STRING, &err, errorstring) != 2) {
                logger(LOG_ERR, _("Got bad %s from %s (%s)"), "ERROR",
                           c->name, c->hostname);
        if(sscanf(c->buffer, "%*d %d " MAX_STRING, &err, errorstring) != 2) {
                logger(LOG_ERR, _("Got bad %s from %s (%s)"), "ERROR",
                           c->name, c->hostname);
@@ -90,22 +82,16 @@ bool error_h(connection_t *c) {
 }
 
 bool send_termreq(connection_t *c) {
 }
 
 bool send_termreq(connection_t *c) {
-       cp();
-
        return send_request(c, "%d", TERMREQ);
 }
 
 bool termreq_h(connection_t *c) {
        return send_request(c, "%d", TERMREQ);
 }
 
 bool termreq_h(connection_t *c) {
-       cp();
-
        terminate_connection(c, c->status.active);
 
        return true;
 }
 
 bool send_ping(connection_t *c) {
        terminate_connection(c, c->status.active);
 
        return true;
 }
 
 bool send_ping(connection_t *c) {
-       cp();
-
        c->status.pinged = true;
        c->last_ping_time = now;
 
        c->status.pinged = true;
        c->last_ping_time = now;
 
@@ -113,20 +99,14 @@ bool send_ping(connection_t *c) {
 }
 
 bool ping_h(connection_t *c) {
 }
 
 bool ping_h(connection_t *c) {
-       cp();
-
        return send_pong(c);
 }
 
 bool send_pong(connection_t *c) {
        return send_pong(c);
 }
 
 bool send_pong(connection_t *c) {
-       cp();
-
        return send_request(c, "%d", PONG);
 }
 
 bool pong_h(connection_t *c) {
        return send_request(c, "%d", PONG);
 }
 
 bool pong_h(connection_t *c) {
-       cp();
-
        c->status.pinged = false;
 
        /* Succesful connection, reset timeout if this is an outgoing connection. */
        c->status.pinged = false;
 
        /* Succesful connection, reset timeout if this is an outgoing connection. */
@@ -140,8 +120,6 @@ bool pong_h(connection_t *c) {
 /* Sending and receiving packets via TCP */
 
 bool send_tcppacket(connection_t *c, vpn_packet_t *packet) {
 /* Sending and receiving packets via TCP */
 
 bool send_tcppacket(connection_t *c, vpn_packet_t *packet) {
-       cp();
-
        /* If there already is a lot of data in the outbuf buffer, discard this packet.
            We use a very simple Random Early Drop algorithm. */
 
        /* If there already is a lot of data in the outbuf buffer, discard this packet.
            We use a very simple Random Early Drop algorithm. */
 
@@ -157,8 +135,6 @@ bool send_tcppacket(connection_t *c, vpn_packet_t *packet) {
 bool tcppacket_h(connection_t *c) {
        short int len;
 
 bool tcppacket_h(connection_t *c) {
        short int len;
 
-       cp();
-
        if(sscanf(c->buffer, "%*d %hd", &len) != 1) {
                logger(LOG_ERR, _("Got bad %s from %s (%s)"), "PACKET", c->name,
                           c->hostname);
        if(sscanf(c->buffer, "%*d %hd", &len) != 1) {
                logger(LOG_ERR, _("Got bad %s from %s (%s)"), "PACKET", c->name,
                           c->hostname);
index c6c018744fb8a2da94af9fd8c5b3bad5bfe5d933..cdfcb6d0c33f95313d8847d20561af9e27747fab 100644 (file)
@@ -35,8 +35,6 @@
 bool send_add_subnet(connection_t *c, const subnet_t *subnet) {
        char netstr[MAXNETSTR];
 
 bool send_add_subnet(connection_t *c, const subnet_t *subnet) {
        char netstr[MAXNETSTR];
 
-       cp();
-
        if(!net2str(netstr, sizeof netstr, subnet))
                return false;
 
        if(!net2str(netstr, sizeof netstr, subnet))
                return false;
 
@@ -49,8 +47,6 @@ bool add_subnet_h(connection_t *c) {
        node_t *owner;
        subnet_t s = {0}, *new;
 
        node_t *owner;
        subnet_t s = {0}, *new;
 
-       cp();
-
        if(sscanf(c->buffer, "%*d %*x " MAX_STRING " " MAX_STRING, name, subnetstr) != 2) {
                logger(LOG_ERR, _("Got bad %s from %s (%s)"), "ADD_SUBNET", c->name,
                           c->hostname);
        if(sscanf(c->buffer, "%*d %*x " MAX_STRING " " MAX_STRING, name, subnetstr) != 2) {
                logger(LOG_ERR, _("Got bad %s from %s (%s)"), "ADD_SUBNET", c->name,
                           c->hostname);
@@ -152,8 +148,6 @@ bool add_subnet_h(connection_t *c) {
 bool send_del_subnet(connection_t *c, const subnet_t *s) {
        char netstr[MAXNETSTR];
 
 bool send_del_subnet(connection_t *c, const subnet_t *s) {
        char netstr[MAXNETSTR];
 
-       cp();
-
        if(!net2str(netstr, sizeof netstr, s))
                return false;
 
        if(!net2str(netstr, sizeof netstr, s))
                return false;
 
@@ -166,8 +160,6 @@ bool del_subnet_h(connection_t *c) {
        node_t *owner;
        subnet_t s = {0}, *find;
 
        node_t *owner;
        subnet_t s = {0}, *find;
 
-       cp();
-
        if(sscanf(c->buffer, "%*d %*x " MAX_STRING " " MAX_STRING, name, subnetstr) != 2) {
                logger(LOG_ERR, _("Got bad %s from %s (%s)"), "DEL_SUBNET", c->name,
                           c->hostname);
        if(sscanf(c->buffer, "%*d %*x " MAX_STRING " " MAX_STRING, name, subnetstr) != 2) {
                logger(LOG_ERR, _("Got bad %s from %s (%s)"), "DEL_SUBNET", c->name,
                           c->hostname);
index 5cefbce843795f3fe0268142e53ae506ef8d28e1..e52097eb5964ed3cb5836ebbfcd29bdd3969a48d 100644 (file)
@@ -42,8 +42,6 @@ bool setup_device(void) {
        struct ifreq ifr;
        struct sockaddr_ll sa;
 
        struct ifreq ifr;
        struct sockaddr_ll sa;
 
-       cp();
-
        if(!get_config_string(lookup_config(config_tree, "Interface"), &iface))
                iface = xstrdup("eth0");
 
        if(!get_config_string(lookup_config(config_tree, "Interface"), &iface))
                iface = xstrdup("eth0");
 
@@ -83,8 +81,6 @@ bool setup_device(void) {
 }
 
 void close_device(void) {
 }
 
 void close_device(void) {
-       cp();
-
        close(device_fd);
 
        free(device);
        close(device_fd);
 
        free(device);
@@ -94,8 +90,6 @@ void close_device(void) {
 bool read_packet(vpn_packet_t *packet) {
        int lenin;
 
 bool read_packet(vpn_packet_t *packet) {
        int lenin;
 
-       cp();
-
        if((lenin = read(device_fd, packet->data, MTU)) <= 0) {
                logger(LOG_ERR, _("Error while reading from %s %s: %s"), device_info,
                           device, strerror(errno));
        if((lenin = read(device_fd, packet->data, MTU)) <= 0) {
                logger(LOG_ERR, _("Error while reading from %s %s: %s"), device_info,
                           device, strerror(errno));
@@ -113,8 +107,6 @@ bool read_packet(vpn_packet_t *packet) {
 }
 
 bool write_packet(vpn_packet_t *packet) {
 }
 
 bool write_packet(vpn_packet_t *packet) {
-       cp();
-
        ifdebug(TRAFFIC) logger(LOG_DEBUG, _("Writing packet of %d bytes to %s"),
                           packet->len, device_info);
 
        ifdebug(TRAFFIC) logger(LOG_DEBUG, _("Writing packet of %d bytes to %s"),
                           packet->len, device_info);
 
@@ -130,8 +122,6 @@ bool write_packet(vpn_packet_t *packet) {
 }
 
 void dump_device_stats(void) {
 }
 
 void dump_device_stats(void) {
-       cp();
-
        logger(LOG_DEBUG, _("Statistics for %s %s:"), device_info, device);
        logger(LOG_DEBUG, _(" total bytes in:  %10d"), device_total_in);
        logger(LOG_DEBUG, _(" total bytes out: %10d"), device_total_out);
        logger(LOG_DEBUG, _("Statistics for %s %s:"), device_info, device);
        logger(LOG_DEBUG, _(" total bytes in:  %10d"), device_total_in);
        logger(LOG_DEBUG, _(" total bytes out: %10d"), device_total_out);
index 6cc2fc1c00a221904ef8822d91385ad4a0cddd2b..7538bec517c8a70a42bf6d566d63448e8d6f5d44 100644 (file)
@@ -104,8 +104,6 @@ static void learn_mac(mac_t *address) {
        avl_node_t *node;
        connection_t *c;
 
        avl_node_t *node;
        connection_t *c;
 
-       cp();
-
        subnet = lookup_subnet_mac(address);
 
        /* If we don't know this MAC address yet, store it */
        subnet = lookup_subnet_mac(address);
 
        /* If we don't know this MAC address yet, store it */
@@ -139,8 +137,6 @@ void age_subnets(void) {
        connection_t *c;
        avl_node_t *node, *next, *node2;
 
        connection_t *c;
        avl_node_t *node, *next, *node2;
 
-       cp();
-
        for(node = myself->subnet_tree->head; node; node = next) {
                next = node->next;
                s = node->data;
        for(node = myself->subnet_tree->head; node; node = next) {
                next = node->next;
                s = node->data;
@@ -175,8 +171,6 @@ static void route_ipv4_unreachable(node_t *source, vpn_packet_t *packet, uint8_t
        if(ratelimit(3))
                return;
        
        if(ratelimit(3))
                return;
        
-       cp();
-
        /* Swap Ethernet source and destination addresses */
 
        swap_mac_addresses(packet);
        /* Swap Ethernet source and destination addresses */
 
        swap_mac_addresses(packet);
@@ -246,8 +240,6 @@ static void fragment_ipv4_packet(node_t *dest, vpn_packet_t *packet) {
        uint8_t *offset;
        uint16_t ip_off, origf;
        
        uint8_t *offset;
        uint16_t ip_off, origf;
        
-       cp();
-
        memcpy(&ip, packet->data + ether_size, ip_size);
        fragment.priority = packet->priority;
 
        memcpy(&ip, packet->data + ether_size, ip_size);
        fragment.priority = packet->priority;
 
@@ -294,8 +286,6 @@ static void route_ipv4_unicast(node_t *source, vpn_packet_t *packet) {
        node_t *via;
        ipv4_t dest;
 
        node_t *via;
        ipv4_t dest;
 
-       cp();
-
        memcpy(&dest, &packet->data[30], sizeof dest);
        subnet = lookup_subnet_ipv4(&dest);
 
        memcpy(&dest, &packet->data[30], sizeof dest);
        subnet = lookup_subnet_ipv4(&dest);
 
@@ -340,8 +330,6 @@ static void route_ipv4_unicast(node_t *source, vpn_packet_t *packet) {
 }
 
 static void route_ipv4(node_t *source, vpn_packet_t *packet) {
 }
 
 static void route_ipv4(node_t *source, vpn_packet_t *packet) {
-       cp();
-
        if(!checklength(source, packet, ether_size + ip_size))
                return;
 
        if(!checklength(source, packet, ether_size + ip_size))
                return;
 
@@ -372,8 +360,6 @@ static void route_ipv6_unreachable(node_t *source, vpn_packet_t *packet, uint8_t
        if(ratelimit(3))
                return;
        
        if(ratelimit(3))
                return;
        
-       cp();
-
        /* Swap Ethernet source and destination addresses */
 
        swap_mac_addresses(packet);
        /* Swap Ethernet source and destination addresses */
 
        swap_mac_addresses(packet);
@@ -442,8 +428,6 @@ static void route_ipv6_unicast(node_t *source, vpn_packet_t *packet) {
        node_t *via;
        ipv6_t dest;
 
        node_t *via;
        ipv6_t dest;
 
-       cp();
-
        memcpy(&dest, &packet->data[38], sizeof dest);
        subnet = lookup_subnet_ipv6(&dest);
 
        memcpy(&dest, &packet->data[38], sizeof dest);
        subnet = lookup_subnet_ipv6(&dest);
 
@@ -500,8 +484,6 @@ static void route_neighborsol(node_t *source, vpn_packet_t *packet) {
                uint32_t next;
        } pseudo;
 
                uint32_t next;
        } pseudo;
 
-       cp();
-
        if(!checklength(source, packet, ether_size + ip6_size + ns_size))
                return;
        
        if(!checklength(source, packet, ether_size + ip6_size + ns_size))
                return;
        
@@ -627,8 +609,6 @@ static void route_neighborsol(node_t *source, vpn_packet_t *packet) {
 }
 
 static void route_ipv6(node_t *source, vpn_packet_t *packet) {
 }
 
 static void route_ipv6(node_t *source, vpn_packet_t *packet) {
-       cp();
-
        if(!checklength(source, packet, ether_size + ip6_size))
                return;
 
        if(!checklength(source, packet, ether_size + ip6_size))
                return;
 
@@ -650,8 +630,6 @@ static void route_arp(node_t *source, vpn_packet_t *packet) {
        subnet_t *subnet;
        struct in_addr addr;
 
        subnet_t *subnet;
        struct in_addr addr;
 
-       cp();
-
        if(!checklength(source, packet, ether_size + arp_size))
                return;
 
        if(!checklength(source, packet, ether_size + arp_size))
                return;
 
@@ -715,9 +693,6 @@ static void route_mac(node_t *source, vpn_packet_t *packet) {
        subnet_t *subnet;
        mac_t dest;
 
        subnet_t *subnet;
        mac_t dest;
 
-       cp();
-
-
        /* Learn source address */
 
        if(source == myself) {
        /* Learn source address */
 
        if(source == myself) {
@@ -766,10 +741,7 @@ static void route_mac(node_t *source, vpn_packet_t *packet) {
        send_packet(subnet->owner, packet);
 }
 
        send_packet(subnet->owner, packet);
 }
 
-
 void route(node_t *source, vpn_packet_t *packet) {
 void route(node_t *source, vpn_packet_t *packet) {
-       cp();
-
        if(!checklength(source, packet, ether_size))
                return;
 
        if(!checklength(source, packet, ether_size))
                return;
 
index 71d9bda9f5096f4995972886e3a94ce2c4003209..f1d648d3db5ea732da81f580bb0cdb4112e550e7 100644 (file)
@@ -46,8 +46,6 @@ bool setup_device(void) {
        int ppa;
        char *ptr;
 
        int ppa;
        char *ptr;
 
-       cp();
-
        if(!get_config_string(lookup_config(config_tree, "Device"), &device))
                device = xstrdup(DEFAULT_DEVICE);
 
        if(!get_config_string(lookup_config(config_tree, "Device"), &device))
                device = xstrdup(DEFAULT_DEVICE);
 
@@ -107,8 +105,6 @@ bool setup_device(void) {
 }
 
 void close_device(void) {
 }
 
 void close_device(void) {
-       cp();
-
        close(device_fd);
 
        free(device);
        close(device_fd);
 
        free(device);
@@ -118,8 +114,6 @@ void close_device(void) {
 bool read_packet(vpn_packet_t *packet) {
        int lenin;
 
 bool read_packet(vpn_packet_t *packet) {
        int lenin;
 
-       cp();
-
        if((lenin = read(device_fd, packet->data + 14, MTU - 14)) <= 0) {
                logger(LOG_ERR, _("Error while reading from %s %s: %s"), device_info,
                           device, strerror(errno));
        if((lenin = read(device_fd, packet->data + 14, MTU - 14)) <= 0) {
                logger(LOG_ERR, _("Error while reading from %s %s: %s"), device_info,
                           device, strerror(errno));
@@ -153,8 +147,6 @@ bool read_packet(vpn_packet_t *packet) {
 }
 
 bool write_packet(vpn_packet_t *packet) {
 }
 
 bool write_packet(vpn_packet_t *packet) {
-       cp();
-
        ifdebug(TRAFFIC) logger(LOG_DEBUG, _("Writing packet of %d bytes to %s"),
                           packet->len, device_info);
 
        ifdebug(TRAFFIC) logger(LOG_DEBUG, _("Writing packet of %d bytes to %s"),
                           packet->len, device_info);
 
@@ -170,8 +162,6 @@ bool write_packet(vpn_packet_t *packet) {
 }
 
 void dump_device_stats(void) {
 }
 
 void dump_device_stats(void) {
-       cp();
-
        logger(LOG_DEBUG, _("Statistics for %s %s:"), device_info, device);
        logger(LOG_DEBUG, _(" total bytes in:  %10d"), device_total_in);
        logger(LOG_DEBUG, _(" total bytes out: %10d"), device_total_out);
        logger(LOG_DEBUG, _("Statistics for %s %s:"), device_info, device);
        logger(LOG_DEBUG, _(" total bytes in:  %10d"), device_total_in);
        logger(LOG_DEBUG, _(" total bytes out: %10d"), device_total_out);
index fa1ee63094c009237583dc23f0c7ac3dff416b8e..db7aeb1e9ab62365ae15428cafdfeec71dca2c2d 100644 (file)
@@ -130,7 +130,6 @@ int subnet_compare(const subnet_t *a, const subnet_t *b) {
        default:
                logger(LOG_ERR, _("subnet_compare() was called with unknown subnet type %d, exitting!"),
                           a->type);
        default:
                logger(LOG_ERR, _("subnet_compare() was called with unknown subnet type %d, exitting!"),
                           a->type);
-               cp_trace();
                exit(0);
        }
 
                exit(0);
        }
 
@@ -140,50 +139,36 @@ int subnet_compare(const subnet_t *a, const subnet_t *b) {
 /* Initialising trees */
 
 void init_subnets(void) {
 /* Initialising trees */
 
 void init_subnets(void) {
-       cp();
-
        subnet_tree = avl_alloc_tree((avl_compare_t) subnet_compare, (avl_action_t) free_subnet);
 
        subnet_cache_flush();
 }
 
 void exit_subnets(void) {
        subnet_tree = avl_alloc_tree((avl_compare_t) subnet_compare, (avl_action_t) free_subnet);
 
        subnet_cache_flush();
 }
 
 void exit_subnets(void) {
-       cp();
-
        avl_delete_tree(subnet_tree);
 }
 
 avl_tree_t *new_subnet_tree(void) {
        avl_delete_tree(subnet_tree);
 }
 
 avl_tree_t *new_subnet_tree(void) {
-       cp();
-
        return avl_alloc_tree((avl_compare_t) subnet_compare, NULL);
 }
 
 void free_subnet_tree(avl_tree_t *subnet_tree) {
        return avl_alloc_tree((avl_compare_t) subnet_compare, NULL);
 }
 
 void free_subnet_tree(avl_tree_t *subnet_tree) {
-       cp();
-
        avl_delete_tree(subnet_tree);
 }
 
 /* Allocating and freeing space for subnets */
 
 subnet_t *new_subnet(void) {
        avl_delete_tree(subnet_tree);
 }
 
 /* Allocating and freeing space for subnets */
 
 subnet_t *new_subnet(void) {
-       cp();
-
        return xmalloc_and_zero(sizeof(subnet_t));
 }
 
 void free_subnet(subnet_t *subnet) {
        return xmalloc_and_zero(sizeof(subnet_t));
 }
 
 void free_subnet(subnet_t *subnet) {
-       cp();
-
        free(subnet);
 }
 
 /* Adding and removing subnets */
 
 void subnet_add(node_t *n, subnet_t *subnet) {
        free(subnet);
 }
 
 /* Adding and removing subnets */
 
 void subnet_add(node_t *n, subnet_t *subnet) {
-       cp();
-
        subnet->owner = n;
 
        avl_insert(subnet_tree, subnet);
        subnet->owner = n;
 
        avl_insert(subnet_tree, subnet);
@@ -193,8 +178,6 @@ void subnet_add(node_t *n, subnet_t *subnet) {
 }
 
 void subnet_del(node_t *n, subnet_t *subnet) {
 }
 
 void subnet_del(node_t *n, subnet_t *subnet) {
-       cp();
-
        avl_delete(n->subnet_tree, subnet);
        avl_delete(subnet_tree, subnet);
 
        avl_delete(n->subnet_tree, subnet);
        avl_delete(subnet_tree, subnet);
 
@@ -208,8 +191,6 @@ bool str2net(subnet_t *subnet, const char *subnetstr) {
        uint16_t x[8];
        int weight = 10;
 
        uint16_t x[8];
        int weight = 10;
 
-       cp();
-
        if(sscanf(subnetstr, "%hu.%hu.%hu.%hu/%d#%d",
                          &x[0], &x[1], &x[2], &x[3], &l, &weight) >= 5) {
                if(l < 0 || l > 32)
        if(sscanf(subnetstr, "%hu.%hu.%hu.%hu/%d#%d",
                          &x[0], &x[1], &x[2], &x[3], &l, &weight) >= 5) {
                if(l < 0 || l > 32)
@@ -285,8 +266,6 @@ bool str2net(subnet_t *subnet, const char *subnetstr) {
 }
 
 bool net2str(char *netstr, int len, const subnet_t *subnet) {
 }
 
 bool net2str(char *netstr, int len, const subnet_t *subnet) {
-       cp();
-
        if(!netstr || !subnet) {
                logger(LOG_ERR, _("net2str() was called with netstr=%p, subnet=%p!\n"), netstr, subnet);
                return false;
        if(!netstr || !subnet) {
                logger(LOG_ERR, _("net2str() was called with netstr=%p, subnet=%p!\n"), netstr, subnet);
                return false;
@@ -332,7 +311,6 @@ bool net2str(char *netstr, int len, const subnet_t *subnet) {
                        logger(LOG_ERR,
                                   _("net2str() was called with unknown subnet type %d, exiting!"),
                                   subnet->type);
                        logger(LOG_ERR,
                                   _("net2str() was called with unknown subnet type %d, exiting!"),
                                   subnet->type);
-                       cp_trace();
                        exit(0);
        }
 
                        exit(0);
        }
 
@@ -342,16 +320,12 @@ bool net2str(char *netstr, int len, const subnet_t *subnet) {
 /* Subnet lookup routines */
 
 subnet_t *lookup_subnet(const node_t *owner, const subnet_t *subnet) {
 /* Subnet lookup routines */
 
 subnet_t *lookup_subnet(const node_t *owner, const subnet_t *subnet) {
-       cp();
-
        return avl_search(owner->subnet_tree, subnet);
 }
 
 subnet_t *lookup_subnet_mac(const mac_t *address) {
        subnet_t *p, subnet = {0};
 
        return avl_search(owner->subnet_tree, subnet);
 }
 
 subnet_t *lookup_subnet_mac(const mac_t *address) {
        subnet_t *p, subnet = {0};
 
-       cp();
-
        subnet.type = SUBNET_MAC;
        subnet.net.mac.address = *address;
        subnet.owner = NULL;
        subnet.type = SUBNET_MAC;
        subnet.net.mac.address = *address;
        subnet.owner = NULL;
@@ -366,8 +340,6 @@ subnet_t *lookup_subnet_ipv4(const ipv4_t *address) {
        avl_node_t *n;
        int i;
 
        avl_node_t *n;
        int i;
 
-       cp();
-
        // Check if this address is cached
 
        for(i = 0; i < 2; i++) {
        // Check if this address is cached
 
        for(i = 0; i < 2; i++) {
@@ -412,8 +384,6 @@ subnet_t *lookup_subnet_ipv6(const ipv6_t *address) {
        avl_node_t *n;
        int i;
 
        avl_node_t *n;
        int i;
 
-       cp();
-
        // Check if this address is cached
 
        for(i = 0; i < 2; i++) {
        // Check if this address is cached
 
        for(i = 0; i < 2; i++) {
@@ -525,8 +495,6 @@ void dump_subnets(void) {
        subnet_t *subnet;
        avl_node_t *node;
 
        subnet_t *subnet;
        avl_node_t *node;
 
-       cp();
-
        logger(LOG_DEBUG, _("Subnet list:"));
 
        for(node = subnet_tree->head; node; node = node->next) {
        logger(LOG_DEBUG, _("Subnet list:"));
 
        for(node = subnet_tree->head; node; node = node->next) {
index fa46f65a8b00876b74e8a19ee911c70bbc8dbd2c..aaaab443e865ca4a58d7c67c1e8a31463ee5e32e 100644 (file)
@@ -65,8 +65,6 @@ bool setup_device(void) {
        } name;
        struct timeval tv;
 
        } name;
        struct timeval tv;
 
-       cp();
-
        if(!get_config_string(lookup_config(config_tree, "Device"), &device))
                xasprintf(&device, LOCALSTATEDIR "/run/%s.umlsocket", identname);
 
        if(!get_config_string(lookup_config(config_tree, "Device"), &device))
                xasprintf(&device, LOCALSTATEDIR "/run/%s.umlsocket", identname);
 
@@ -152,8 +150,6 @@ bool setup_device(void) {
 }
 
 void close_device(void) {
 }
 
 void close_device(void) {
-       cp();
-
        if(listen_fd >= 0)
                close(listen_fd);
 
        if(listen_fd >= 0)
                close(listen_fd);
 
@@ -175,8 +171,6 @@ void close_device(void) {
 bool read_packet(vpn_packet_t *packet) {
        int lenin;
 
 bool read_packet(vpn_packet_t *packet) {
        int lenin;
 
-       cp();
-
        switch(state) {
                case 0: {
                        struct sockaddr sa;
        switch(state) {
                case 0: {
                        struct sockaddr sa;
@@ -253,8 +247,6 @@ bool read_packet(vpn_packet_t *packet) {
 }
 
 bool write_packet(vpn_packet_t *packet) {
 }
 
 bool write_packet(vpn_packet_t *packet) {
-       cp();
-
        if(state != 2) {
                ifdebug(TRAFFIC) logger(LOG_DEBUG, _("Dropping packet of %d bytes to %s: not connected to UML yet"),
                                packet->len, device_info);
        if(state != 2) {
                ifdebug(TRAFFIC) logger(LOG_DEBUG, _("Dropping packet of %d bytes to %s: not connected to UML yet"),
                                packet->len, device_info);
@@ -279,8 +271,6 @@ bool write_packet(vpn_packet_t *packet) {
 }
 
 void dump_device_stats(void) {
 }
 
 void dump_device_stats(void) {
-       cp();
-
        logger(LOG_DEBUG, _("Statistics for %s %s:"), device_info, device);
        logger(LOG_DEBUG, _(" total bytes in:  %10d"), device_total_in);
        logger(LOG_DEBUG, _(" total bytes out: %10d"), device_total_out);
        logger(LOG_DEBUG, _("Statistics for %s %s:"), device_info, device);
        logger(LOG_DEBUG, _(" total bytes in:  %10d"), device_total_in);
        logger(LOG_DEBUG, _(" total bytes out: %10d"), device_total_out);