From: Guus Sliepen Date: Sat, 3 Aug 2019 21:32:04 +0000 (+0200) Subject: Correctly set device class after joining if the server didn't specify one. X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=848a27a8bd753a40b302a0f527b3a8e6c684f96d;p=meshlink Correctly set device class after joining if the server didn't specify one. --- diff --git a/src/meshlink.c b/src/meshlink.c index 2c1253c7..c42eb769 100644 --- a/src/meshlink.c +++ b/src/meshlink.c @@ -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")) {