From 269c168f7e58dc3a18ff0148fd8cce959f71bad7 Mon Sep 17 00:00:00 2001 From: "W.C.A. Wijngaards" Date: Fri, 5 Mar 2021 13:54:26 +0100 Subject: [PATCH] - Debug output for #411 and #439: printout internal error and details. --- doc/Changelog | 1 + services/outside_network.c | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/doc/Changelog b/doc/Changelog index d8f88f88c..3b3073405 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,5 +1,6 @@ 5 March 2021: Wouter - Workaround for #439: prevent loops in the reuse rbtree. + - Debug output for #411 and #439: printout internal error and details. 4 March 2021: Wouter - iana portlist update. diff --git a/services/outside_network.c b/services/outside_network.c index d2d8c56f5..9769b7602 100644 --- a/services/outside_network.c +++ b/services/outside_network.c @@ -890,7 +890,13 @@ reuse_tcp_remove_tree_list(struct outside_network* outnet, verbose(VERB_CLIENT, "reuse_tcp_remove_tree_list"); if(reuse->node.key) { /* delete it from reuse tree */ - (void)rbtree_delete(&outnet->tcp_reuse, reuse); + if(!rbtree_delete(&outnet->tcp_reuse, reuse)) { + /* should not be possible, it should be there */ + char buf[256]; + addr_to_str(&reuse->addr, reuse->addrlen, buf, + sizeof(buf)); + log_err("reuse tcp delete: node not present, internal error, %s ssl %d lru %d", buf, reuse->is_ssl, reuse->item_on_lru_list); + } reuse->node.key = NULL; /* defend against loops on broken tree by zeroing the * rbnode structure */