]> git.meshlink.io Git - meshlink/commitdiff
Correctly set device class after joining if the server didn't specify one.
authorGuus Sliepen <guus@meshlink.io>
Sat, 3 Aug 2019 21:32:04 +0000 (23:32 +0200)
committerGuus Sliepen <guus@meshlink.io>
Sun, 4 Aug 2019 10:23:08 +0000 (12:23 +0200)
src/meshlink.c

index 2c1253c79864d10b0cf567b233ffce4523a88191..c42eb7690543b77037284a22ff678237ff3d9631 100644 (file)
@@ -599,7 +599,7 @@ static bool finalize_join(meshlink_handle_t *mesh, const void *buf, uint16_t len
        free(mesh->self->name);
        mesh->name = name;
        mesh->self->name = xstrdup(name);
-       mesh->self->devclass = devclass;
+       mesh->self->devclass = devclass == DEV_CLASS_UNKNOWN ? mesh->devclass : devclass;
 
        // Initialize configuration directory
        if(!config_init(mesh, "current")) {