From a13bd2388ba7072235db93d88deda8e44633d4a3 Mon Sep 17 00:00:00 2001 From: Abhik Roy Date: Sat, 2 Mar 2024 21:26:19 +1100 Subject: [PATCH 1/2] docs(examples): Added network config to icmpv6_ping readme and other fixes --- examples/protocols/sockets/icmpv6_ping/README.md | 5 +++++ .../sockets/udp_multicast/main/udp_multicast_example_main.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/examples/protocols/sockets/icmpv6_ping/README.md b/examples/protocols/sockets/icmpv6_ping/README.md index 255b5eb691..ade7631e5e 100644 --- a/examples/protocols/sockets/icmpv6_ping/README.md +++ b/examples/protocols/sockets/icmpv6_ping/README.md @@ -32,6 +32,11 @@ Set the following parameters under "***Example Configuration***" Options: **Destination IPV6 Address** can also be set manually by modifying the source file `icmpv6_ping.c`. * Press '**`s`**' to save and '**`q`**' to quit the menu. +Network configuration: +* Ensure the Wifi router you are connecting to has a global IPv6 address. + If not, this example will keep waiting for a *Router Advertisement* message. +* To make this example work with the default settings set the global IPv6 of your router address as `2001:DB8::56AF:97FF:FEB3:2195` + #### Build and execute as follows: ```sh idf.py build diff --git a/examples/protocols/sockets/udp_multicast/main/udp_multicast_example_main.c b/examples/protocols/sockets/udp_multicast/main/udp_multicast_example_main.c index 89eafe65e8..cc19e366d6 100644 --- a/examples/protocols/sockets/udp_multicast/main/udp_multicast_example_main.c +++ b/examples/protocols/sockets/udp_multicast/main/udp_multicast_example_main.c @@ -132,7 +132,7 @@ static int create_multicast_ipv4_socket(void) // Assign multicast TTL (set separately from normal interface TTL) uint8_t ttl = MULTICAST_TTL; - setsockopt(sock, IPPROTO_IP, IP_MULTICAST_TTL, &ttl, sizeof(uint8_t)); + err = setsockopt(sock, IPPROTO_IP, IP_MULTICAST_TTL, &ttl, sizeof(uint8_t)); if (err < 0) { ESP_LOGE(V4TAG, "Failed to set IP_MULTICAST_TTL. Error %d", errno); goto err; @@ -193,7 +193,7 @@ static int create_multicast_ipv6_socket(void) goto err; } - // Selct the interface to use as multicast source for this socket. + // Select the interface to use as multicast source for this socket. #if LISTEN_ALL_IF bzero(&if_inaddr.un, sizeof(if_inaddr.un)); #else From 437f08100d75fd5bbac7e35af31a046c87aaa65f Mon Sep 17 00:00:00 2001 From: Abhik Roy Date: Tue, 7 May 2024 20:37:21 +1000 Subject: [PATCH 2/2] fix(esp_netif): Fixed Coverity issue CID 459204 Closes IDF-9847 See merge request espressif/esp-idf!29400 --- components/esp_netif/lwip/esp_netif_lwip.c | 1 + 1 file changed, 1 insertion(+) diff --git a/components/esp_netif/lwip/esp_netif_lwip.c b/components/esp_netif/lwip/esp_netif_lwip.c index a06106048e..7df9ad902a 100644 --- a/components/esp_netif/lwip/esp_netif_lwip.c +++ b/components/esp_netif/lwip/esp_netif_lwip.c @@ -1247,6 +1247,7 @@ static esp_err_t esp_netif_tx_rx_event_api(esp_netif_api_msg_t *msg) esp_netif_t *esp_netif = msg->esp_netif; if (esp_netif == NULL) { ESP_LOGE(TAG, "Invalid esp_netif"); + return ESP_ERR_ESP_NETIF_INVALID_PARAMS; } ESP_LOGD(TAG, "%s esp_netif:%p", __func__, esp_netif);