Page MenuHomeFreeBSD

rtsol/rtsold: Add option to skip random delay
ClosedPublic

Authored by cperciva on Nov 12 2021, 5:14 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Mar 12, 5:29 PM
Unknown Object (File)
Tue, Mar 12, 5:29 PM
Unknown Object (File)
Tue, Mar 12, 5:29 PM
Unknown Object (File)
Fri, Mar 8, 9:38 AM
Unknown Object (File)
Fri, Mar 8, 6:13 AM
Unknown Object (File)
Jan 20 2024, 12:02 PM
Unknown Object (File)
Jan 17 2024, 6:13 PM
Unknown Object (File)
Dec 22 2023, 11:53 PM
Subscribers

Details

Summary

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

Lint
Lint Skipped
Unit
Tests Skipped

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.
usr.sbin/rtsold/rtsold.c
724–727

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;
		else
			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
usr.sbin/rtsold/rtsold.c
102

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
usr.sbin/rtsold/rtsold.c
102

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...)