@@ -66,7 +66,8 @@ void NetmgrController::initialize(const Device* device, const Keys* keys) {
6666 }
6767 m_uuid = uuid.toString (QUuid::WithoutBraces);
6868
69- m_deviceIpv4Address = device->ipv4Address ();
69+ m_deviceIpv4Address = QHostAddress (device->ipv4Address ().split (' /' ).first ());
70+ m_deviceIpv6Address = QHostAddress (device->ipv6Address ().split (' /' ).first ());
7071
7172 // Generic connection settings.
7273 m_config.insert (" id" , QCoreApplication::applicationName ());
@@ -248,11 +249,16 @@ void NetmgrController::activate(const InterfaceConfig& config,
248249 m_ipv6config.insert (" route-data" , ipv6routes);
249250 m_wireguard.insert (" peers" , peers);
250251
252+ // Keep the server details for later.
253+ m_serverPublicKey = config.m_serverPublicKey ;
254+ m_serverIpv4Gateway = QHostAddress (config.m_serverIpv4Gateway );
255+ m_serverIpv6Gateway = QHostAddress (config.m_serverIpv6Gateway );
256+
251257 // Update the DNS server.
252258 if ((config.m_dnsServer == config.m_serverIpv4Gateway ) ||
253259 (config.m_dnsServer == config.m_serverIpv6Gateway )) {
254- setDnsConfig (m_ipv4config, QHostAddress (config. m_serverIpv4Gateway ) );
255- setDnsConfig (m_ipv6config, QHostAddress (config. m_serverIpv6Gateway ) );
260+ setDnsConfig (m_ipv4config, m_serverIpv4Gateway);
261+ setDnsConfig (m_ipv6config, m_serverIpv6Gateway);
256262 } else if (config.m_dnsServer .contains (' :' )) {
257263 setDnsConfig (m_ipv4config, QHostAddress ());
258264 setDnsConfig (m_ipv6config, QHostAddress (config.m_dnsServer ));
@@ -261,10 +267,6 @@ void NetmgrController::activate(const InterfaceConfig& config,
261267 setDnsConfig (m_ipv6config, QHostAddress ());
262268 }
263269
264- // Keep the server details for later.
265- m_serverPublicKey = config.m_serverPublicKey ;
266- m_serverIpv4Gateway = config.m_serverIpv4Gateway ;
267-
268270 // Update the connection settings.
269271 QList<QVariant> args;
270272 args << serializeConfig ();
@@ -395,7 +397,9 @@ void NetmgrController::checkStatus() {
395397 st.m_connected = true ;
396398 st.m_timestamp = guessUptime ();
397399 st.m_ipv4Gateway = m_serverIpv4Gateway;
400+ st.m_ipv6Gateway = m_serverIpv6Gateway;
398401 st.m_ipv4Address = m_deviceIpv4Address;
402+ st.m_ipv6Address = m_deviceIpv6Address;
399403 st.m_rxBytes = readSysfsFile (rxPath);
400404 st.m_txBytes = readSysfsFile (txPath);
401405
0 commit comments