]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ctdb-tcp: always call node_dead() upcall in ctdb_tcp_tnode_cb()
authorRalph Boehme <slow@samba.org>
Sat, 29 Feb 2020 11:13:12 +0000 (12:13 +0100)
committerMartin Schwenke <martins@samba.org>
Thu, 12 Mar 2020 03:47:30 +0000 (03:47 +0000)
ctdb_tcp_tnode_cb() is called when we receive data on the outgoing connection.

This can happen when we get an EOF on the connection because the other side as
closed. In this case data will be NULL.

It would also be called if we received data from the peer. In this case data
will not be NULL.

The latter case is a fatal error though and we already call
ctdb_tcp_stop_connection() for this case as well, which means even though the
node is not fully connected anymore, by not calling the node_dead() upcall
NODE_FLAGS_DISCONNECTED will not be set.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14295

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
ctdb/tcp/tcp_connect.c

index 559442f14bfaac324d40374ec7aca26083d10ac7..ea98e6126a6241b58d7747ca3a813e349bd9a402 100644 (file)
@@ -65,9 +65,7 @@ void ctdb_tcp_tnode_cb(uint8_t *data, size_t cnt, void *private_data)
        struct ctdb_tcp_node *tnode = talloc_get_type(
                node->transport_data, struct ctdb_tcp_node);
 
-       if (data == NULL) {
-               node->ctdb->upcalls->node_dead(node);
-       }
+       node->ctdb->upcalls->node_dead(node);
 
        ctdb_tcp_stop_connection(node);
        tnode->connect_te = tevent_add_timer(node->ctdb->ev, tnode,