diff --git a/components/net/lwip-1.3.2/src/arch/sys_arch_init.c b/components/net/lwip-1.3.2/src/arch/sys_arch_init.c index 0b4669afde7170ae59509a02f9e49bf000d98bc6..73aa34171cf4b33838d7d1ac25f5479e778c078b 100644 --- a/components/net/lwip-1.3.2/src/arch/sys_arch_init.c +++ b/components/net/lwip-1.3.2/src/arch/sys_arch_init.c @@ -123,9 +123,9 @@ void lwip_system_init(void) { struct ip_addr ipaddr, netmask, gw; - IP4_ADDR(&ipaddr, RT_LWIP_IPADDR0, RT_LWIP_IPADDR1, RT_LWIP_IPADDR2, RT_LWIP_IPADDR3); - IP4_ADDR(&gw, RT_LWIP_GWADDR0, RT_LWIP_GWADDR1, RT_LWIP_GWADDR2, RT_LWIP_GWADDR3); - IP4_ADDR(&netmask, RT_LWIP_MSKADDR0, RT_LWIP_MSKADDR1, RT_LWIP_MSKADDR2, RT_LWIP_MSKADDR3); + ipaddr.addr = inet_addr(RT_LWIP_IPADDR); + gw.addr = inet_addr(RT_LWIP_GWADDR); + netmask.addr = inet_addr(RT_LWIP_MSKADDR); netifapi_netif_set_addr(netif_default, &ipaddr, &netmask, &gw); } diff --git a/components/net/lwip-1.4.1/src/arch/sys_arch.c b/components/net/lwip-1.4.1/src/arch/sys_arch.c index c0aed9d4f03a0ba8490107ba49f60d2830b3a6ea..0963f8d403ef617c8955dbef259defc8127490a6 100644 --- a/components/net/lwip-1.4.1/src/arch/sys_arch.c +++ b/components/net/lwip-1.4.1/src/arch/sys_arch.c @@ -167,9 +167,9 @@ int lwip_system_init(void) { struct ip_addr ipaddr, netmask, gw; - IP4_ADDR(&ipaddr, RT_LWIP_IPADDR0, RT_LWIP_IPADDR1, RT_LWIP_IPADDR2, RT_LWIP_IPADDR3); - IP4_ADDR(&gw, RT_LWIP_GWADDR0, RT_LWIP_GWADDR1, RT_LWIP_GWADDR2, RT_LWIP_GWADDR3); - IP4_ADDR(&netmask, RT_LWIP_MSKADDR0, RT_LWIP_MSKADDR1, RT_LWIP_MSKADDR2, RT_LWIP_MSKADDR3); + ipaddr.addr = inet_addr(RT_LWIP_IPADDR); + gw.addr = inet_addr(RT_LWIP_GWADDR); + netmask.addr = inet_addr(RT_LWIP_MSKADDR); netifapi_netif_set_addr(netif_default, &ipaddr, &netmask, &gw); } diff --git a/components/net/lwip-1.4.1/src/netif/ethernetif.c b/components/net/lwip-1.4.1/src/netif/ethernetif.c index 0f28f5356921256fe651b6851d03735e468b9261..96e1672fe99173995e6ab601d83d448e3fb0f5b1 100644 --- a/components/net/lwip-1.4.1/src/netif/ethernetif.c +++ b/components/net/lwip-1.4.1/src/netif/ethernetif.c @@ -240,9 +240,9 @@ rt_err_t eth_device_init_with_flag(struct eth_device *dev, char *name, rt_uint16 else #endif { - IP4_ADDR(&ipaddr, RT_LWIP_IPADDR0, RT_LWIP_IPADDR1, RT_LWIP_IPADDR2, RT_LWIP_IPADDR3); - IP4_ADDR(&gw, RT_LWIP_GWADDR0, RT_LWIP_GWADDR1, RT_LWIP_GWADDR2, RT_LWIP_GWADDR3); - IP4_ADDR(&netmask, RT_LWIP_MSKADDR0, RT_LWIP_MSKADDR1, RT_LWIP_MSKADDR2, RT_LWIP_MSKADDR3); + ipaddr.addr = inet_addr(RT_LWIP_IPADDR); + gw.addr = inet_addr(RT_LWIP_GWADDR); + netmask.addr = inet_addr(RT_LWIP_MSKADDR); } netifapi_netif_add(netif, &ipaddr, &netmask, &gw, dev, eth_netif_device_init, tcpip_input); diff --git a/components/net/lwip-2.0.2/src/arch/sys_arch.c b/components/net/lwip-2.0.2/src/arch/sys_arch.c index bb809ac6ad9119391d288e15749c0666c68eb22d..dd5345ccbbf0cebc20b62a431df868a3f0e10dc9 100644 --- a/components/net/lwip-2.0.2/src/arch/sys_arch.c +++ b/components/net/lwip-2.0.2/src/arch/sys_arch.c @@ -28,6 +28,7 @@ #include "lwip/sio.h" #include "lwip/init.h" #include "lwip/dhcp.h" +#include "lwip/inet.h" #include @@ -166,16 +167,16 @@ int lwip_system_init(void) { struct ip4_addr ipaddr, netmask, gw; - IP4_ADDR(&ipaddr, RT_LWIP_IPADDR0, RT_LWIP_IPADDR1, RT_LWIP_IPADDR2, RT_LWIP_IPADDR3); - IP4_ADDR(&gw, RT_LWIP_GWADDR0, RT_LWIP_GWADDR1, RT_LWIP_GWADDR2, RT_LWIP_GWADDR3); - IP4_ADDR(&netmask, RT_LWIP_MSKADDR0, RT_LWIP_MSKADDR1, RT_LWIP_MSKADDR2, RT_LWIP_MSKADDR3); + ipaddr.addr = inet_addr(RT_LWIP_IPADDR); + gw.addr = inet_addr(RT_LWIP_GWADDR); + netmask.addr = inet_addr(RT_LWIP_MSKADDR); netifapi_netif_set_addr(netif_default, &ipaddr, &netmask, &gw); } #endif - rt_kprintf("lwIP-%d.%d.%d initialized!\n", LWIP_VERSION_MAJOR, LWIP_VERSION_MINOR, LWIP_VERSION_REVISION); + rt_kprintf("lwIP-%d.%d.%d initialized!\n", LWIP_VERSION_MAJOR, LWIP_VERSION_MINOR, LWIP_VERSION_REVISION); - return 0; + return 0; } INIT_COMPONENT_EXPORT(lwip_system_init); diff --git a/components/net/lwip-2.0.2/src/netif/ethernetif.c b/components/net/lwip-2.0.2/src/netif/ethernetif.c index 5b82649662d74c39a436074fa2a59ec16c61c742..09d6140b16e8fdbebe4806d305ff32e64b0e913c 100644 --- a/components/net/lwip-2.0.2/src/netif/ethernetif.c +++ b/components/net/lwip-2.0.2/src/netif/ethernetif.c @@ -74,6 +74,8 @@ #include "netif/etharp.h" #include "netif/ethernetif.h" +#include "lwip/inet.h" + #define netifapi_netif_set_link_up(n) netifapi_netif_common(n, netif_set_link_up, NULL) #define netifapi_netif_set_link_down(n) netifapi_netif_common(n, netif_set_link_down, NULL) @@ -246,15 +248,14 @@ rt_err_t eth_device_init_with_flag(struct eth_device *dev, char *name, rt_uint16 ip_addr_t ipaddr, netmask, gw; #if !LWIP_DHCP - IP4_ADDR(&ipaddr, RT_LWIP_IPADDR0, RT_LWIP_IPADDR1, RT_LWIP_IPADDR2, RT_LWIP_IPADDR3); - IP4_ADDR(&gw, RT_LWIP_GWADDR0, RT_LWIP_GWADDR1, RT_LWIP_GWADDR2, RT_LWIP_GWADDR3); - IP4_ADDR(&netmask, RT_LWIP_MSKADDR0, RT_LWIP_MSKADDR1, RT_LWIP_MSKADDR2, RT_LWIP_MSKADDR3); -#else + ipaddr.addr = inet_addr(RT_LWIP_IPADDR); + gw.addr = inet_addr(RT_LWIP_GWADDR); + netmask.addr = inet_addr(RT_LWIP_MSKADDR); +#else IP4_ADDR(&ipaddr, 0, 0, 0, 0); IP4_ADDR(&gw, 0, 0, 0, 0); IP4_ADDR(&netmask, 0, 0, 0, 0); #endif - netifapi_netif_add(netif, &ipaddr, &netmask, &gw, dev, eth_netif_device_init, tcpip_input); }