Good Morning!
My customer wants to choose (and change his mind at any moment)
between static IP and DHCP configuration.
I have to support both DHCP (so I need DHCP code) and static IP
in one firmware.
The problem is in file "TivaWare_C_Series-2.2.0.295/utils/lwiplib.c".
I need to include DHCP so I defined LWIP_DHCP constant for lwIPLinkDetect()
function.
When Ethernet state changes (for example: link up, link down),
the static IP information is cleared in lwIPLinkDetect():
------------------------------------------------------------------------------
//
// Clear any address information from the network interface.
//
ip_addr.addr = 0;
net_mask.addr = 0;
gw_addr.addr = 0;
netif_set_addr(&g_sNetIF, &ip_addr, &net_mask, &gw_addr);
------------------------------------------------------------------------------
I propose to clear data but not for static IP configuration:
------------------------------------------------------------------------------
if(g_ui32IPMode != IPADDR_USE_STATIC)
{
//
// Clear any address information from the network interface.
//
ip_addr.addr = 0;
net_mask.addr = 0;
gw_addr.addr = 0;
netif_set_addr(&g_sNetIF, &ip_addr, &net_mask, &gw_addr);
}
------------------------------------------------------------------------------
Best wishes,
Piotr Kasprzyk