@@ -163,51 +163,37 @@ bool NetworkInterface::setLocalIPFull(IPAddress ip, IPAddress subnet, IPAddress
163163 return false ;
164164 }
165165
166- if (!net_if_ipv4_set_netmask_by_addr (netif, &ip_addr, &subnet_addr)) {
167- LOG_ERR (" Failed to set subnet mask" );
168- return false ;
169- }
170-
166+ net_if_ipv4_set_netmask (netif, &subnet_addr);
171167 net_if_ipv4_set_gw (netif, &gw_addr);
172168 LOG_INF (" Static IP configured" );
173169 return true ;
174170}
175171
176- bool NetworkInterface::setLocalIP (IPAddress ip) {
172+ void NetworkInterface::setLocalIP (IPAddress ip) {
177173 struct in_addr addr;
178174 addr.s_addr = ip;
179175
180176 if (!net_if_ipv4_addr_add (netif, &addr, NET_ADDR_MANUAL, 0 )) {
181177 LOG_ERR (" Failed to set local IP address" );
182- return false ;
178+ return ;
183179 }
184-
185180 LOG_INF (" Local IP address set: %s" , ip.toString ().c_str ());
186- return true ;
187181}
188182
189- bool NetworkInterface::setSubnetMask (IPAddress subnet) {
183+ void NetworkInterface::setSubnetMask (IPAddress subnet) {
190184 struct in_addr netmask_addr;
191185 netmask_addr.s_addr = subnet;
192-
193- if (!net_if_ipv4_set_netmask_by_addr (netif, &netmask_addr, &netmask_addr)) {
194- LOG_ERR (" Failed to set subnet mask" );
195- return false ;
196- }
197-
186+ net_if_ipv4_set_netmask (netif, &netmask_addr);
198187 LOG_INF (" Subnet mask set: %s" , subnet.toString ().c_str ());
199- return true ;
200188}
201189
202- bool NetworkInterface::setGatewayIP (IPAddress gateway) {
190+ void NetworkInterface::setGatewayIP (IPAddress gateway) {
203191 struct in_addr gw_addr;
204192 gw_addr.s_addr = gateway;
205-
206193 net_if_ipv4_set_gw (netif, &gw_addr);
207194 LOG_INF (" Gateway IP set: %s" , gateway.toString ().c_str ());
208- return true ;
209195}
210196
211- bool NetworkInterface::setDnsServerIP (IPAddress dns_server) {
212- return false ; // DNS server dynamic configuration is not supported
197+ void NetworkInterface::setDnsServerIP (IPAddress dns_server) {
198+ return ; // DNS server dynamic configuration is not supported
213199}
0 commit comments