Merge pull request #58 from agessaman/fix/observer-hostname-on-rename

fix(network): rebuild the DHCP hostname when the node is renamed
This commit is contained in:
Adam Gessaman authored and GitHub committed 2026-09-19 21:37:32 -07:00
commit 8dc81b7447
6 files changed
+75 -10

No files matched your search

+1
View File
@@ -1583,6 +1583,7 @@ void CommonCLI::handleSetCmd(uint32_t sender_timestamp, char* command, char* rep
if (isValidName(&config[5])) {
StrHelper::strncpy(_prefs->node_name, &config[5], sizeof(_prefs->node_name));
savePrefs();
_callbacks->onNodeNameChanged();
strcpy(reply, "OK");
} else {
strcpy(reply, "Error, bad chars");
+4
View File
@@ -274,6 +274,10 @@ struct LegacyObserverTail {
class CommonCLICallbacks {
public:
virtual void savePrefs() = 0;
// The node name feeds the DHCP hostname, which is built once when the link
// starts. Renaming a running node has to rebuild it or the node keeps
// advertising the old name to DHCP until the next reflash.
virtual void onNodeNameChanged() {}
#ifdef WITH_MQTT_BRIDGE
virtual bool saveObserverPrefs() = 0;
#else