From a13bd2388ba7072235db93d88deda8e44633d4a3 Mon Sep 17 00:00:00 2001 From: Abhik Roy Date: Sat, 2 Mar 2024 21:26:19 +1100 Subject: [PATCH] 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