Page MenuHomeFreeBSD

Add per-FIB gateway support to rc.d/routing
ClosedPublic

Authored by andrew.fengler_scaleengine.com on Dec 6 2019, 5:36 PM.
Tags
None
Referenced Files
Unknown Object (File)
Jan 15 2024, 4:02 AM
Unknown Object (File)
Jan 12 2024, 10:44 AM
Unknown Object (File)
Jan 2 2024, 3:57 PM
Unknown Object (File)
Dec 21 2023, 11:34 PM
Unknown Object (File)
Dec 20 2023, 7:01 AM
Unknown Object (File)
Dec 12 2023, 2:52 PM
Unknown Object (File)
Nov 24 2023, 10:18 AM
Unknown Object (File)
Nov 22 2023, 4:32 AM

Details

Summary

Make rc.d/routing to read defaultrouter_fibN and ipv6_defaultrouter_fibN, and
set it as the default gateway for FIB N, where N is from 1 to (net.fibs - 1)
This allows adding gateways for multiple FIBs in the same format as the main
gateway. (FIB 0)

Test Plan

The patch has been tested on several 12.0 machines, some with net.fibs == 1,
and some with net.fibs == 8 and a default gateway set for FIB 2.
Note that the _fibN gateways will only be read if you set net.fibs to a
number > 1 in /boot/loader.conf

To test:
Apply the patch for rc.d/routing
Add some extra per-fib defaultrouter variables, or not
Run rc.d/routing restart, or reboot the machine

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

This revision is now accepted and ready to land.Dec 7 2019, 6:26 AM

Thanks for this change. Is there a sentence stop missing in the man page change?

share/man/man5/rc.conf.5
2813 ↗(On Diff #65317)

Is there is a sentence stop missing here?

This revision now requires review to proceed.Dec 9 2019, 3:23 PM

Thanks for fixing it. OK from manpages.
Can you commit it yourself or should I do that (giving proper credit, of course)?

This revision is now accepted and ready to land.Dec 9 2019, 3:41 PM
In D22706#497573, @bcr wrote:

Can you commit it yourself or should I do that (giving proper credit, of course)?

Please commit it, I don't think I can. Thanks.

share/man/man5/rc.conf.5
2813 ↗(On Diff #65317)

Thanks, looks like I accidentally truncated the line at some point and didn't notice.

@allanjude Can you commit these changes? For the src part, I would require that bit, so I think it would be better if you did that.

freebsd_oldach.net added inline comments.
libexec/rc/rc.d/routing
174

This should be ${_fibnum} not ${fibnum}?

251

This should be ${_fibnum} not ${fibnum}?

Indeed. It appears that somehow this patch differs from my local version which does have those 2 places as ${_fibnum}, as well as line 250 should be:
ipv6_static_routes="${ipv6_static_routes} _default_fib${_fibnum}"

I think this needs a new patch to be made? I'm not very familiar with phabricator so i'm not sure if this needs to be re-opened or a new patch to fix the issue.

libexec/rc/rc.d/routing
250

Indeed. It appears that somehow this patch differs from my local version which does have those 2 places as ${_fibnum}, as well as line 250 should be:
ipv6_static_routes="${ipv6_static_routes} _default_fib${_fibnum}"

I think this needs a new patch to be made? I'm not very familiar with phabricator so i'm not sure if this needs to be re-opened or a new patch to fix the issue.

The diff can be updated (should be an "Update Diff" button along the right side near the top of the review, or arc diff --update IIRC)

For updating the diff, should i upload the proper version of the original patch, or a new patch off of head? I assume the latter.

andrew.fengler_scaleengine.com marked an inline comment as done.

Fix to variable names that was missing from the original patch.