Page MenuHomeFreeBSD

rtsold: handle media LINK_UP to accelerate RS/RA
Needs ReviewPublic

Authored by bz on Jul 13 2026, 10:52 AM.
Tags
None
Referenced Files
F175389050: D58211.id181893.diff
Sat, Oct 10, 12:10 PM
Unknown Object (File)
Fri, Oct 2, 9:03 AM
Unknown Object (File)
Thu, Oct 1, 3:29 AM
Unknown Object (File)
Mon, Sep 14, 2:02 PM
Unknown Object (File)
Mon, Sep 14, 7:42 AM
Unknown Object (File)
Sat, Sep 12, 7:40 AM
Unknown Object (File)
Fri, Sep 11, 5:59 AM
Unknown Object (File)
Thu, Sep 10, 9:37 PM

Details

Reviewers
pouria
Summary

If a link is not UP at boot time, e.g., a cable gets plugged in later,
rtsold will not send out an RS and we have to wait for the next
unsolicitated RA to get a default router, prefix information, etc.

Hook into rtsolds routing message callback handler and rather than
complicating logic, simply re-set the internal timer if we find a link
UP and RUNNING (based on the rtmsg), and let the rtsold state machine
do the work.


I wrote this in response to D56927 but never tested it.
I would appreciate if someone could test/review.

XXX-BZ also, is there a reference in an RFC related to this which we can/should
mention about this case?

Diff Detail

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

Event Timeline

bz requested review of this revision.Jul 13 2026, 10:52 AM

It helps, but not much. it might increase ifi->timer.tv_sec to PROBE_INTERVAL which is 60s.

usr.sbin/rtsold/rtsock.c
183
191

Why do we need IFF_RUNNING here?

194

After some debugging, I found out rtm_index is not same as ifm_index.

It helps, but not much. it might increase ifi->timer.tv_sec to PROBE_INTERVAL which is 60s.

So just doing the timer update is not enough? I wonder how we get it into a "reset" state to start running like on startup then without massive fiddling?

usr.sbin/rtsold/rtsock.c
191

Because if the interface is not UP and RUNNING you cannot transmit and so it would defeat the purpose.

194

That is a very good catch!

The motivation for writing D56927 was to trigger a Router Solicitation immediately after the interface media becomes available, in order to achieve faster convergence by prompting the gateway to send a Router Advertisement. It works this way:

16:12:25.985907 IP6 fe80::1265:30ff:fe7a:9509 > ff02::2: ICMP6, router solicitation, length 16
16:12:25.989220 IP6 fe80::360a:98ff:fe1b:404e > ff02::1: ICMP6, router advertisement, length 104

A single ICMPv6 Router Solicitation message is sent on the interface, and the received Router Advertisement promptly helps configure the interface that has just been brought up.

Unfortunately, after testing this patch, I can only conclude that it needs further development before it can reliably work as intended.

At the end of Section 3.6 of RFC 8981, we can read the following:
"Finally, when an interface connects to a new (different) link, existing temporary addresses for the corresponding interface MUST be removed, and new temporary addresses MUST be generated for use on the new link, using the algorithm in Section 3.4. If a device moves from one link to another, generating new temporary addresses ensures that the device uses different randomized IIDs for the temporary addresses associated with the two links, making it more difficult to correlate addresses from the two different links as being from the same host. The host MAY follow any process available to it to determine that the link change has occurred. One such process is described by "Simple DNA" [RFC6059]. Detecting link changes would prevent link down/up events from causing temporary addresses to be (unnecessarily) regenerated."

This means that, sooner or later, rtsold(8) on FreeBSD should be redesigned to properly handle interface up/down events. In particular, the daemon would need to monitor the state of each interface and distinguish between a simple interface state change and a transition to a different link.