Page MenuHomeFreeBSD

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

Authored by bz on Aug 18 2020, 10:04 AM.

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
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 33040
Build 30426: arc lint + arc unit

Event Timeline

bz requested review of this revision.Aug 18 2020, 10:04 AM
bz added inline comments.
usr.sbin/rtsold/rtsol.c
308

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

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

usr.sbin/rtsold/rtsol.c
314

Typo, RFc

usr.sbin/rtsold/rtsold.c
355

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
299

Typo, "redundant."

308

There should be a newline before the comment.

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.