espressif / esp-lwip

Fork of lwIP (https://savannah.nongnu.org/projects/lwip/) with ESP-IDF specific patches
Other
85 stars 129 forks source link

Fix compile error (IDFGH-3929) #21

Closed vinhjaxt closed 3 years ago

vinhjaxt commented 4 years ago

At ./src/include/lwip/ip4_addr.h line 51:

struct ip4_addr {
  u32_t addr;
};

So I changed ip_addr.u_addr.ip4.addr to ip_addr.addr to fix the compile error on my esp8266 project.

Alvin1Zhang commented 4 years ago

Thanks for your contribution.

david-cermak commented 4 years ago

Hi @vinhjaxt

The thing is that the ip4_napt uses the ip_addr defined in netif as struct of this union thus the referencing is correct.

How do you compile your 8266 project with the esp-lwip?

vinhjaxt commented 4 years ago

Hi @david-cermak , Here we go:

git clone https://github.com/espressif/ESP8266_RTOS_SDK.git 
cd ESP8266_RTOS_SDK/examples/get-started/hello_world/
make menuconfig
--> Component config
    --> LWIP
        [*] Enable copy between Layer2 and Layer3 packets
        [*] Enable IP forwarding
        [*]     Enable NAT (new/experimental) (NEW)
make
david-cermak commented 4 years ago

@vinhjaxt Would it help if you also enable IPv6 in menuconfig?

make menuconfig
--> Component config
    --> LWIP
        [*] CONFIG_LWIP_IPV6 -> 1

The trouble is that the changes you are proposing break IDF builds.