Page MenuHomeFreeBSD

rtsol(d): add script for "M bit"
ClosedPublic

Authored by bz on Aug 18 2020, 10:04 AM.
Tags
None
Referenced Files
Unknown Object (File)
Nov 21 2024, 3:41 AM
Unknown Object (File)
Nov 18 2024, 1:01 AM
Unknown Object (File)
Nov 17 2024, 9:25 PM
Unknown Object (File)
Nov 10 2024, 8:52 PM
Unknown Object (File)
Nov 10 2024, 6:51 PM
Unknown Object (File)
Oct 6 2024, 7:40 PM
Unknown Object (File)
Oct 5 2024, 10:45 PM
Unknown Object (File)
Sep 25 2024, 11:13 AM
Subscribers

Details

Summary

While we do support the "O bit" running a script (usually to start a
dhcpv6 client) we have no options for setups which set the "M bit" for,
e.g., static address assignment as in EC2.

Duplicate most of the "O bit" logic to also start a script for the
"M bit" with the one difference: if the "M bit" is set we will not
start the script for the "O bit" as well (RFC 4861, Section 4.2).

Please not that the current implemention has the logic for run
"M script" and "O script" backwards it seems as I was too tired last
night. I'll update this soon. Meanwhile it would be good to know if
the idea and the implementation otherwise is sound.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

bz requested review of this revision.Aug 18 2020, 10:04 AM
bz added inline comments.
usr.sbin/rtsold/rtsol.c
308 ↗(On Diff #75940)

This needs to move before the "O bit" handling and check before calling the script needs to move as well into the other block with the other variable.

usr.sbin/rtsold/rtsold.8
225 ↗(On Diff #75940)

This needs to move to the Fl O section and check bits.

usr.sbin/rtsold/rtsol.c
314 ↗(On Diff #75940)

Typo, RFc

usr.sbin/rtsold/rtsold.c
355 ↗(On Diff #75940)

Maybe future-proof it?

count = 0;
for (size_t i = 0; i < nitems(scripts); i++)
    if (scripts[i] != NULL)
        count++;

Apply the changes suggested by @markj and myself.

bz marked 2 inline comments as done.Aug 19 2020, 9:17 PM

Looks ok to me with the nits fixed.

usr.sbin/rtsold/rtsol.c
309 ↗(On Diff #76009)

There should be a newline before the comment.

314 ↗(On Diff #76009)

Typo, "redundant."

This revision is now accepted and ready to land.Aug 20 2020, 11:37 PM

Anyone else comments? Otherwise I'll get it in no later than Tuesday.

In D26099#581086, @bz wrote:

Anyone else comments? Otherwise I'll get it in no later than Tuesday.

I will take a look in the next 12 hours.

Sorry for the delay. Looks good to me.

In D26099#581614, @hrs wrote:

Sorry for the delay. Looks good to me.

Thanks @hrs and @markj for looking. Much appreciated!

bz marked 2 inline comments as done.Aug 25 2020, 3:21 PM
This revision was automatically updated to reflect the committed changes.