Page MenuHomeFreeBSD

ndp: Add support for route information (RFC 4191)
Needs ReviewPublic

Authored by pouria on Sun, Feb 22, 9:47 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Feb 25, 6:39 PM
Unknown Object (File)
Wed, Feb 25, 4:12 PM
Unknown Object (File)
Wed, Feb 25, 11:55 AM
Unknown Object (File)
Wed, Feb 25, 8:04 AM
Unknown Object (File)
Wed, Feb 25, 7:23 AM
Unknown Object (File)
Wed, Feb 25, 3:07 AM
Unknown Object (File)
Wed, Feb 25, 1:31 AM
Unknown Object (File)
Tue, Feb 24, 4:57 PM
Subscribers

Details

Reviewers
glebius
zlei
markj
madpilot
melifaro
Group Reviewers
network
Summary

This revision implements RFC 4191,
it also resolves PR263982.
notes for reviewers:

  1. I've avoided using separate callout and, as this aligns with what

RFC 4191 intends by directly using the routing table instead of separate data
structure. (like defrouter)

  1. I tried to avoid locking the RIB inside the nd6_rtr.c. However, I couldn't

obtain an exact match for my prefix from other public functions without
locking the RIB.

  1. I could reuse rib_add_redirect(), but it only works for host routes (plen 128).
  2. I will create rib_add_temproute(), similar to rib_add_redirect()

but tailored for the route info option in another review if necessary.
Despite nhop_create_from_info() being a public function, I prefer not to use it
inside nd6_rtr.c, consider defrouter_addreq already utilizes nhop
facilities, I've used it for now anyway.

  1. For updating nhop lifetime, I can't use nhop_set_expire() directly, because it linked.

I solved this problem by calling rib_change_route() and making
nhop_create_from_nhop behave like nhop_create_from_info (as intended).

This review depends on D55267.

Test Plan

See my other revisions on route expire arguments
of route(8) and netstat(1).

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 70891
Build 67774: arc lint + arc unit

Event Timeline

Some other notes for reviewers: (see description above too please)

sys/netinet6/nd6_rtr.c
81

This can be in nd6.h, but there is no need for it to being public.
So I made it private.

497

XXX: our dr lifetime is 16 bit. the rti_lifetime is 32 bit. it will overflow if I override it.
So I commented it for now. Any idea?
This should not block this revision however, I can style(9) it by using #ifdef notyet like others.

2458

We also need to prioritize routes from RAs with higher preference values.
That's why I saved the ndrt_flags.
I will do it in another revision/review after this one gets committed.

style commented to use #ifdef without functional change.