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)
Fri, Nov 8, 4:07 PM
Unknown Object (File)
Fri, Nov 8, 11:03 AM
Unknown Object (File)
Wed, Nov 6, 4:19 PM
Unknown Object (File)
Tue, Nov 5, 8:51 AM
Unknown Object (File)
Tue, Nov 5, 8:30 AM
Unknown Object (File)
Oct 17 2024, 4:06 PM
Unknown Object (File)
Oct 17 2024, 4:06 PM
Unknown Object (File)
Oct 17 2024, 9:36 AM
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...)