diff --git a/src/core/ipv6/nd6.c b/src/core/ipv6/nd6.c index 75ddaa140..74b395f3b 100644 --- a/src/core/ipv6/nd6.c +++ b/src/core/ipv6/nd6.c @@ -546,7 +546,11 @@ nd6_input(struct pbuf *p, struct netif *inp) } /* Send back a NA for us. Allocate the reply pbuf. */ +#if ESP_LWIP && LWIP_FORCE_ROUTER_FORWARDING + nd6_send_na(inp, &target_address, ND6_FLAG_ROUTER | ND6_FLAG_SOLICITED | ND6_FLAG_OVERRIDE); +#else nd6_send_na(inp, &target_address, ND6_FLAG_SOLICITED | ND6_FLAG_OVERRIDE); +#endif } break; /* ICMP6_TYPE_NS */ diff --git a/src/include/lwip/opt.h b/src/include/lwip/opt.h index 99eb49796..e08ec79a6 100644 --- a/src/include/lwip/opt.h +++ b/src/include/lwip/opt.h @@ -2404,6 +2404,14 @@ #define LWIP_IPV6 0 #endif +/** + * when LWIP_FORCE_ROUTER_FORWARDING is enbaled in lwip, the router flag in NA packet will always + * set to 1, otherwise, never set router flag for NA packets. + */ +#if !defined LWIP_FORCE_ROUTER_FORWARDING || defined __DOXYGEN__ +#define LWIP_FORCE_ROUTER_FORWARDING 0 +#endif + /** * LWIP_ND6==1: Enable NDP * when LWIP_IPV6 is enabled in lwIP, NDP timer is enabled by default with a timeout of 1 second.