faustino wrote:
I am using M52233 demo board with Coldfire lite stack and the web server, but I want to know how can I change the ip adress in run time.
Just follow what the Niche code already does in set_ipaddr() (NRMENUS.C) or dhc_setip() (DHCPCLNT.C). The DHCPCLNT.C code is a little smarter about setting the mask, default gateway, and broadcast addresses.
There's a warning about "setip will kill all current net connections!" but it is overstated. Changing the IP will make any connected TCP sockets unreachable. You may want to take action to close them before the change.
The local ARP table is not affected by this change, as it tracks IP addresses of other hosts. Those other hosts may have copies of your previous IP address in their ARP tables, which will eventually expire.