]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Fix arp/ndp deletion broken by 2fe5a79425c7.
authorAlexander V. Chernikov <melifaro@FreeBSD.org>
Fri, 19 Feb 2021 21:09:17 +0000 (21:09 +0000)
committerAlexander V. Chernikov <melifaro@FreeBSD.org>
Wed, 10 Mar 2021 21:48:24 +0000 (21:48 +0000)
commit22f24233ba2a5e7163908507d955eefe76051822
tree67ba76de56333b4bc64023bf8af670a0b6375f35
parent6c3f613b6e65d78ee7a836895f5569ee1ac604e2
Fix arp/ndp deletion broken by 2fe5a79425c7.

Changes in the 2fe5a79425c7 moved dst sockaddr masking from the
 routing control plane to the rtsock code.

It broke arp/ndp deletion.
It turns out, arp/ndp perform RTM_GET request first to get an
 interface index necessary for the deletion.
Then they simply stamp the reply with RTF_LLDATA and set the
 command to RTM_DELETE.
As a result, kernel receives request with non-empty RTA_NETMASK
 and clears RTA_DST host bits before passing the message to the
 lla code.

De facto, the only needed bits are RTA_DST, RTA_GATEWAY and the
 subset of rtm_flags.

With that in mind, fix the interace by clearing RTA_NETMASK
 for every messages with RTF_LLDATA.

While here, cleanup arp/ndp code a bit.

Reviewed by: gnn
Differential Revision: https://reviews.freebsd.org/D28804

(cherry picked from commit f9e1cd6c99200846b324a8b65f7f31ded74013bd)
sys/net/rtsock.c
usr.sbin/arp/arp.c
usr.sbin/ndp/ndp.c