Page MenuHomeFreeBSD

Make temp option for ndp work
Needs ReviewPublic

Authored by lytboris_gmail.com on Mar 23 2025, 8:20 AM.
Referenced Files
Unknown Object (File)
Sat, Nov 29, 4:26 AM
Unknown Object (File)
Fri, Nov 28, 11:07 AM
Unknown Object (File)
Tue, Nov 18, 11:38 AM
Unknown Object (File)
Fri, Nov 14, 4:46 PM
Unknown Object (File)
Thu, Nov 6, 9:09 AM
Unknown Object (File)
Nov 3 2025, 10:55 PM
Unknown Object (File)
Nov 3 2025, 9:50 PM
Unknown Object (File)
Nov 3 2025, 4:40 PM

Details

Reviewers
melifaro
glebius
Summary

Both ways to create an artificial NDP record are broken: a call via rtsock sets wrong timeout, a netlink code does not check opts.expire_time value at all.

Patch addresses both issues.

Test Plan
  1. add 2001:DB8::/64 to an interface
  2. run ndp -s 2001:DB8::c001 11:22:33:44:55:66 temp
  3. check ndp -an | fgrep 2001:DB8::c001 to have < 20 minutes timeout
  4. rebuild ndp with -DWITHOUT_NETLINK=1 and repeat steps 1-3

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

Thank you for working on this! Can we add tests here?

Are the tests that hard to add, or perhaps can it be proceeded with further without them?

Are the tests that hard to add, or perhaps can it be proceeded with further without them?

I will try to add them this or the next week, it takes a while to get familiar with test suite.

usr.sbin/ndp/ndp.c
960

IMHO the comment isn't really needed. It just reiterates what we see in the code. If you don't like idea of using uptime for that purpose you'd better make a longer XXX comment that would elaborate on why using uptime is not the best idea.

usr.sbin/ndp/ndp_netlink.c
484–495
507

Please declare int off; at the beginning of the block.

P.S. IMHO, the entire API construct of adding a nested attribute should be a bit easier. Just comment into the air, not asking for anything here :)