I am building an application which can be setup with either DHCP or static IP through a web UI.
The changing from DHCP to static IP, and vice versa, is done in a function called toggle_dhcp().
One of the first lines in the method is “ifconfig(IF_DEFAULT, IFG_DHCP, IFS_END)” to check if DHCP is currently being used.
However, this call consistently times out each time.
Is this there something wrong with this use of ifconfig?
Any help is appreciated.