@@ -206,18 +206,13 @@ void CConfig::Load (void)
206206 m_bNetworkDHCP = m_Properties.GetNumber (" NetworkDHCP" , 0 ) != 0 ;
207207 m_NetworkType = m_Properties.GetString (" NetworkType" , " wlan" );
208208 m_NetworkHostname = m_Properties.GetString (" NetworkHostname" , " MiniDexed" );
209- m_INetworkIPAddress = m_Properties.GetIPAddress (" NetworkIPAddress" ) != 0 ;
210- m_INetworkSubnetMask = m_Properties.GetIPAddress (" NetworkSubnetMask" ) != 0 ;
211- m_INetworkDefaultGateway = m_Properties.GetIPAddress (" NetworkDefaultGateway" ) != 0 ;
209+ if ( const u8 *pIP = m_Properties.GetIPAddress (" NetworkIPAddress" )) m_INetworkIPAddress. Set (pIP) ;
210+ if ( const u8 *pIP = m_Properties.GetIPAddress (" NetworkSubnetMask" )) m_INetworkSubnetMask. Set (pIP) ;
211+ if ( const u8 *pIP = m_Properties.GetIPAddress (" NetworkDefaultGateway" )) m_INetworkDefaultGateway. Set (pIP) ;
212212 m_bSyslogEnabled = m_Properties.GetNumber (" NetworkSyslogEnabled" , 0 ) != 0 ;
213- m_INetworkDNSServer = m_Properties.GetIPAddress (" NetworkDNSServer" ) != 0 ;
213+ if ( const u8 *pIP = m_Properties.GetIPAddress (" NetworkDNSServer" )) m_INetworkDNSServer. Set (pIP) ;
214214 m_bNetworkFTPEnabled = m_Properties.GetNumber (" NetworkFTPEnabled" , 0 ) != 0 ;
215-
216- const u8 *pSyslogServerIP = m_Properties.GetIPAddress (" NetworkSyslogServerIPAddress" );
217- if (pSyslogServerIP)
218- {
219- m_INetworkSyslogServerIPAddress.Set (pSyslogServerIP);
220- }
215+ if (const u8 *pIP = m_Properties.GetIPAddress (" NetworkSyslogServerIPAddress" )) m_INetworkSyslogServerIPAddress.Set (pIP);
221216
222217 m_nMasterVolume = m_Properties.GetNumber (" MasterVolume" , 64 );
223218}
@@ -764,22 +759,22 @@ const char *CConfig::GetNetworkHostname (void) const
764759 return m_NetworkHostname.c_str ();
765760}
766761
767- CIPAddress CConfig::GetNetworkIPAddress (void ) const
762+ const CIPAddress& CConfig::GetNetworkIPAddress (void ) const
768763{
769764 return m_INetworkIPAddress;
770765}
771766
772- CIPAddress CConfig::GetNetworkSubnetMask (void ) const
767+ const CIPAddress& CConfig::GetNetworkSubnetMask (void ) const
773768{
774769 return m_INetworkSubnetMask;
775770}
776771
777- CIPAddress CConfig::GetNetworkDefaultGateway (void ) const
772+ const CIPAddress& CConfig::GetNetworkDefaultGateway (void ) const
778773{
779774 return m_INetworkDefaultGateway;
780775}
781776
782- CIPAddress CConfig::GetNetworkDNSServer (void ) const
777+ const CIPAddress& CConfig::GetNetworkDNSServer (void ) const
783778{
784779 return m_INetworkDNSServer;
785780}
@@ -789,7 +784,7 @@ bool CConfig::GetSyslogEnabled (void) const
789784 return m_bSyslogEnabled;
790785}
791786
792- CIPAddress CConfig::GetNetworkSyslogServerIPAddress (void ) const
787+ const CIPAddress& CConfig::GetNetworkSyslogServerIPAddress (void ) const
793788{
794789 return m_INetworkSyslogServerIPAddress;
795790}
0 commit comments