[En-Nut-Discussion] Once a fixed address, always a fixed address?

Rich Wellner ethernut at objenv.com
Sun Mar 4 03:40:10 CET 2007


I put a fixed address onto my nut once and then it would never ask for a 
dhcp address again.  This is because dhcp.c checks if there is a fixed 
IP on the board and then uses it if so.  This seems like a bug.  I 
worked around it with the following sequence but would argue that 
calling NutDhcpIfConfig really should do a DHCP request and not a silent 
default to a fixed address should one exist.  This came up for me 
because i needed a fixed address on a development network, but then 
deploy the nut to a dhcp network.

  NutRegisterDevice (&DEV_ETHER, 0x8300, 5);

  NutNetLoadConfig ("eth0");

  confnet.cdn_cip_addr = 0;
  confnet.cdn_ip_mask = 0;

  NutNetSaveConfig ();

  NutDhcpIfConfig ("eth0", 0, 60000);




More information about the En-Nut-Discussion mailing list