net: ipv6: Silently drop unwanted NA messages

Silently drop the IPv6 Neighbor Advertisement if we receive it
for an unknown neighbor or if there some some issue in the packet.
Returning error here would cause the ICMP module to print an
actual error which just pollutes the log without any apparent
benefit.

Fixes #66063

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
This commit is contained in:
Jukka Rissanen 2023-12-04 09:44:49 +02:00 committed by Fabio Baltieri
parent 3879b02550
commit d5c7761314

View file

@ -1818,7 +1818,12 @@ static int handle_na_input(struct net_icmp_ctx *ctx,
}
if (!handle_na_neighbor(pkt, na_hdr, tllao_offset)) {
goto drop;
/* Update the statistics but silently drop NA msg if the sender
* is not known or if there was an error in the message.
* Returning <0 will cause error message to be printed which
* is too much for this non error.
*/
net_stats_update_ipv6_nd_drop(net_pkt_iface(pkt));
}
return 0;