]> git.meshlink.io Git - meshlink/commitdiff
dclass transfer while adding edges improved
authorNiklas Hofmann <niklas.hofmann@everbase.net>
Sat, 9 Aug 2014 10:02:55 +0000 (12:02 +0200)
committerNiklas Hofmann <niklas.hofmann@everbase.net>
Sat, 9 Aug 2014 10:02:55 +0000 (12:02 +0200)
src/protocol_edge.c

index 1baa038754c7ebdade678dad92c15a5501b1dbd1..5ab15863c5e2c0d7f9f2751fad2327cef4c11787 100644 (file)
@@ -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);