From: Niklas Hofmann Date: Sat, 9 Aug 2014 10:02:55 +0000 (+0200) Subject: dclass transfer while adding edges improved X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=3b372e41d55c13e96f0a457124d45857217efd6b;p=meshlink dclass transfer while adding edges improved --- diff --git a/src/protocol_edge.c b/src/protocol_edge.c index 1baa0387..5ab15863 100644 --- a/src/protocol_edge.c +++ b/src/protocol_edge.c @@ -87,17 +87,19 @@ bool add_edge_h(meshlink_handle_t *mesh, connection_t *c, const char *request) { if(!from) { from = new_node(); from->name = xstrdup(from_name); - from->dclass = from_dclass; node_add(mesh, from); } + from->dclass = from_dclass; + if(!to) { to = new_node(); to->name = xstrdup(to_name); - to->dclass = to_dclass; node_add(mesh, to); } + to->dclass = to_dclass; + /* Convert addresses */ address = str2sockaddr(to_address, to_port);