Why the ip adress isn't changing while program is running?

Hello, I use next code on my RCM 6710:

int Init()
if (ifconfig(IF_ETH0, IFS_IPADDR, aton(“”),
IFS_NETMASK, aton(“”), IFS_ROUTER_SET, aton(“”),
return 1;
return 0;

This code doesn’t work, because sock_init_or_exit(1) says that ip is the one I set by #define _PRIMARY_STATIC_IP

If you set a primary static IP address the way you have done then it is not possible to change the address at run time.

If you want to have full flexibility on setting IP configurations at run time you are probably best setting TCPCONFIG to 6 and issuing the required ifconfig()s to set up the addressing you need. The addp.c example in the samples cpip folder is a good one to examin to see how this works.


1 Like

Worked great for me, thank you.