Page MenuHomeFreeBSD

Fix `arp -d` / `ndp -d`.
ClosedPublic

Authored by melifaro on Feb 19 2021, 7:52 PM.
Tags
None
Referenced Files
F103355612: D28804.id84292.diff
Sat, Nov 23, 11:37 PM
Unknown Object (File)
Thu, Nov 21, 7:32 PM
Unknown Object (File)
Thu, Nov 21, 2:38 PM
Unknown Object (File)
Tue, Nov 19, 8:24 AM
Unknown Object (File)
Sun, Nov 17, 10:20 PM
Unknown Object (File)
Wed, Nov 13, 8:36 PM
Unknown Object (File)
Wed, Nov 13, 8:23 PM
Unknown Object (File)
Wed, Nov 13, 5:39 PM

Details

Summary

Recent changes ( 2fe5a79425c7 ) pushed RTA_DST masking from route control code to the rtsock code.

It broke arp/ndp deletion.
It turns out, arp/ndp perform RTM_GET request first to gen an interface index, then simply stamp it with RTF_LLDATA and update the command to be RTM_DELETE.

As the kernel has always ignored pretty much everything except RTA_DST, RTA_GATEWAY and RTF_ANNOUNCE, it worked.

Fix this by removing RTA_NETMASK for RTF_LLINFO messages in the early phase.

While here, cleanup some unused code from arp/ndp (proper fix to handle RTM_DELETE will be done separately).

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 37200
Build 34089: arc lint + arc unit

Event Timeline

melifaro added reviewers: kp, network.

Is this a problem of the kernel or the laziness of the arp code?

gnn added a subscriber: gnn.

Couple of nits but otherwise LGTM.

sys/net/rtsock.c
1382

Remove spare blank line please.

1474

Also this one.

This revision is now accepted and ready to land.Feb 19 2021, 8:59 PM

Is this a problem of the kernel or the laziness of the arp code?

I'd say it's the problem of both due to the undefined contract.

Technically speaking, the kernel doesn't need RTA_NETMASK at all, as we always operate on a single entry.
arp(8) was indeed lazy and, so simply worked until the recent times where I added a bit more input normalisation stuff.

melifaro added inline comments.
sys/net/rtsock.c
1382

oh wow!
I missed this style(9). Awesome we don't need to do it now.