From 848a27a8bd753a40b302a0f527b3a8e6c684f96d Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Sat, 3 Aug 2019 23:32:04 +0200 Subject: [PATCH] Correctly set device class after joining if the server didn't specify one. --- src/meshlink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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")) { -- 2.39.5