From 7015620bfabb4d913ecda71256cc30ba5225b570 Mon Sep 17 00:00:00 2001 From: Uwe Seimet Date: Mon, 28 Aug 2023 00:08:02 +0200 Subject: [PATCH] Sort interfaces --- cpp/devices/device_factory.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/cpp/devices/device_factory.cpp b/cpp/devices/device_factory.cpp index e7146ff916..711f23b953 100644 --- a/cpp/devices/device_factory.cpp +++ b/cpp/devices/device_factory.cpp @@ -31,17 +31,20 @@ DeviceFactory::DeviceFactory() sector_sizes[SCMO] = { 512, 1024, 2048, 4096 }; sector_sizes[SCCD] = { 512, 2048}; - string network_interfaces; - for (const auto& network_interface : GetNetworkInterfaces()) { - if (!network_interfaces.empty()) { - network_interfaces += ","; + vector network_interfaces = GetNetworkInterfaces(); + sort(network_interfaces.begin(), network_interfaces.end()); + + string interfaces; + for (const auto& network_interface : network_interfaces) { + if (!interfaces.empty()) { + interfaces += ","; } - network_interfaces += network_interface; + interfaces += network_interface; } - default_params[SCBR]["interface"] = network_interfaces; + default_params[SCBR]["interface"] = interfaces; default_params[SCBR]["inet"] = DEFAULT_IP; - default_params[SCDP]["interface"] = network_interfaces; + default_params[SCDP]["interface"] = interfaces; default_params[SCDP]["inet"] = DEFAULT_IP; default_params[SCLP]["cmd"] = "lp -oraw %f";