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
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
Unknown Object (File)
Sun, Sep 6, 4:06 AM
Unknown Object (File)
Sat, Sep 5, 4:18 AM
Unknown Object (File)
Sat, Sep 5, 12:41 AM

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.