]> git.meshlink.io Git - meshlink/blobdiff - src/protocol_auth.c
class based connect behaviour
[meshlink] / src / protocol_auth.c
index 349d903282005e2a9f467208c304fd4d5da47f4a..65736253020c08cf49d6c6758b4c37187aaee749 100644 (file)
@@ -36,6 +36,8 @@
 #include "utils.h"
 #include "xalloc.h"
 #include "ed25519/sha512.h"
+    
+extern bool node_write_dclass(meshlink_handle_t *mesh, node_t *n);
 
 static bool send_proxyrequest(meshlink_handle_t *mesh, connection_t *c) {
        switch(mesh->proxytype) {
@@ -412,6 +414,8 @@ bool ack_h(meshlink_handle_t *mesh, connection_t *c, const char *request) {
        }
 
        n->dclass = dclass;
+       node_write_dclass(mesh, n);
+
        n->connection = c;
        c->node = n;
        if(!(c->options & options & OPTION_PMTU_DISCOVERY)) {
@@ -440,7 +444,7 @@ bool ack_h(meshlink_handle_t *mesh, connection_t *c, const char *request) {
        sockaddr2str(&c->address, &hisaddress, NULL);
        c->edge->address = str2sockaddr(hisaddress, hisport);
        free(hisaddress);
-       c->edge->weight = weight_from_dclass(dclass);
+       c->edge->weight = cweight_from_dclass(dclass);
        c->edge->connection = c;
        c->edge->options = c->options;