Page MenuHomeFreeBSD

rtsol/rtsold: Add option to skip random delay

Authored by cperciva on Nov 12 2021, 5:14 AM.



In accordance with a SHOULD in RFC 4861, rtsol and rtsold wait a random time between
zero and one (aka MAX_RTR_SOLICITATION_DELAY) seconds before sending a Router
Solicitation, in order to avoid network congestion if many hosts come online at once. (The
question of how many hosts would be required to cause congestion by each sending a
single packet on a Gbps+ network is left to the reader.)

The new option -i disables this wait and instructs rtsol and rtsold to send the Router
Solicitation immediately.

Diff Detail

rG FreeBSD src repository
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

cperciva created this revision.
kp added a subscriber: kp.

LGTM. The man page date will want to be bumped up.

This revision is now accepted and ready to land.Nov 12 2021, 9:25 AM
allanjude added inline comments.

This if makes a double negative, I feel like this if would read better the other way around...

		if (no_solicitation_delay == 1)
			interval = 0;
			interval = arc4random_uniform(MAX_RTR_SOLICITATION_DELAY * MILLION);

Bumped man page date & adjusted if logic to avoid double-negative.

This revision now requires review to proceed.Nov 12 2021, 8:10 PM

bool given we have that these days (as opposed to 25 years ago)?

bz added a reviewer: hrs.

Apart from that this seems fine to me.

This revision is now accepted and ready to land.Nov 12 2021, 8:49 PM

I considered that, but figured that it made sense to keep style consistency with the surrounding code.

(For the same reason, I didn't wrap the interval = arc4random_uniform(MAX_RTR_SOLICITATION_DELAY * MILLION); -- it's a long line, but it was *already* >80 characters before this change...)