forked from espressif/esp-idf
docs(examples): Added network config to icmpv6_ping readme and other fixes
This commit is contained in:
@@ -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`.
|
**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.
|
* 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:
|
#### Build and execute as follows:
|
||||||
```sh
|
```sh
|
||||||
idf.py build
|
idf.py build
|
||||||
|
@@ -132,7 +132,7 @@ static int create_multicast_ipv4_socket(void)
|
|||||||
|
|
||||||
// Assign multicast TTL (set separately from normal interface TTL)
|
// Assign multicast TTL (set separately from normal interface TTL)
|
||||||
uint8_t ttl = MULTICAST_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) {
|
if (err < 0) {
|
||||||
ESP_LOGE(V4TAG, "Failed to set IP_MULTICAST_TTL. Error %d", errno);
|
ESP_LOGE(V4TAG, "Failed to set IP_MULTICAST_TTL. Error %d", errno);
|
||||||
goto err;
|
goto err;
|
||||||
@@ -193,7 +193,7 @@ static int create_multicast_ipv6_socket(void)
|
|||||||
goto err;
|
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
|
#if LISTEN_ALL_IF
|
||||||
bzero(&if_inaddr.un, sizeof(if_inaddr.un));
|
bzero(&if_inaddr.un, sizeof(if_inaddr.un));
|
||||||
#else
|
#else
|
||||||
|
Reference in New Issue
Block a user