From b9d0cf9c894752ecfb74c9f8942eff6b77a90f4a Mon Sep 17 00:00:00 2001 From: Joseph Henry Date: Tue, 5 Mar 2024 12:14:12 -0800 Subject: [PATCH] Don't pass result of void function to string constructor --- controller/EmbeddedNetworkController.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/controller/EmbeddedNetworkController.cpp b/controller/EmbeddedNetworkController.cpp index 0aa56d59..98a9fbd9 100644 --- a/controller/EmbeddedNetworkController.cpp +++ b/controller/EmbeddedNetworkController.cpp @@ -315,12 +315,14 @@ static bool _parseRule(json &r,ZT_VirtualNetworkRule &rule) return true; } else if (t == "MATCH_MAC_SOURCE") { rule.t |= ZT_NETWORK_RULE_MATCH_MAC_SOURCE; - const std::string mac(Utils::cleanMac(OSUtils::jsonString(r["mac"],"0"))); + std::string mac(OSUtils::jsonString(r["mac"],"0")); + Utils::cleanMac(mac); Utils::unhex(mac.c_str(),(unsigned int)mac.length(),rule.v.mac,6); return true; } else if (t == "MATCH_MAC_DEST") { rule.t |= ZT_NETWORK_RULE_MATCH_MAC_DEST; - const std::string mac(Utils::cleanMac(OSUtils::jsonString(r["mac"],"0"))); + std::string mac(OSUtils::jsonString(r["mac"],"0")); + Utils::cleanMac(mac); Utils::unhex(mac.c_str(),(unsigned int)mac.length(),rule.v.mac,6); return true; } else if (t == "MATCH_IPV4_SOURCE") {