nd6: Handle NS packets without LL opt to send NA response

2.1.3-esp: 6bc36ec0 ND6: reply NS without LL opt
This commit is contained in:
zwx
2024-08-07 14:52:09 +08:00
committed by David Cermak
parent fbce255b84
commit 0deed15b03
2 changed files with 11 additions and 2 deletions
+10 -1
View File
@@ -520,7 +520,16 @@ nd6_input(struct pbuf *p, struct netif *inp)
/* Sender is trying to resolve our address. */ /* Sender is trying to resolve our address. */
/* Verify that they included their own link-layer address. */ /* Verify that they included their own link-layer address. */
if (lladdr_opt == NULL) { if (lladdr_opt == NULL) {
/* Not a valid message. */ /* Per RFC4861#section-4.3, source Link-Layer address SHOULD be included in unicast solicitations.
* But, there might be some NSs which do not contain source link-layer address option.
* For LwIP implement, this kind of NS will be ignored. This issue should be fixed.
* Although this Neighbor Solicitation (NS) will be ignored in the subsequent process,
* a Neighbor Advertisement (NA) is still sent in response. */
#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
pbuf_free(p); pbuf_free(p);
ND6_STATS_INC(nd6.proterr); ND6_STATS_INC(nd6.proterr);
ND6_STATS_INC(nd6.drop); ND6_STATS_INC(nd6.drop);
+1 -1
View File
@@ -2477,7 +2477,7 @@
#endif #endif
/** /**
* when LWIP_FORCE_ROUTER_FORWARDING is enbaled in lwip, the router flag in NA packet will always * when LWIP_FORCE_ROUTER_FORWARDING is enabled in lwip, the router flag in NA packet will always
* set to 1, otherwise, never set router flag for NA packets. * set to 1, otherwise, never set router flag for NA packets.
*/ */
#if !defined LWIP_FORCE_ROUTER_FORWARDING || defined __DOXYGEN__ #if !defined LWIP_FORCE_ROUTER_FORWARDING || defined __DOXYGEN__