Bug 276114 - _fibs is unvalued in /etc/rc.d/routing:static_inet(), static_inet6()
Summary: _fibs is unvalued in /etc/rc.d/routing:static_inet(), static_inet6()
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 14.0-RELEASE
Hardware: Any Any
: --- Affects Many People
Assignee: John Baldwin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-01-04 16:25 UTC by Keith Hellman
Modified: 2024-01-12 18:42 UTC (History)
2 users (show)

See Also:


Attachments
It's a patch :) (1.05 KB, patch)
2024-01-04 16:25 UTC, Keith Hellman
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Keith Hellman 2024-01-04 16:25:56 UTC
Created attachment 247446 [details]
It's a patch :)

_fibs appears to be unvalued in /etc/rc.d/routing:static_inet(), the following from a  `set -x` invocation:

+ static_routes='_loopback '
+ route__loopback='-inet 127.0.0.1 -iface lo0 '
+ [ -gt 0 ]
[: -gt: unexpected operator

_fibs appears only as a local variable in /etc/rc.d/routing, it isn't a local in static_inet() so possibly it should be exported in the environment?  I'm not familiar enough with FreeBSD networking to know...

Adding a get_fibs() function that always returns a non-negative value removes the error message on my system, but (again) I don't know if this is the right fix.

I don't use inet6, but it appears the same is true for static_inet6().

Patch attached.  Thanks for all your efforts around and for FreeBSD!
Comment 1 John Baldwin freebsd_committer freebsd_triage 2024-01-12 18:42:13 UTC
Hmm, this patch doesn't apply to stable/13, stable/14, releng/14.0, or main.  Those versions all include a _fibs local variable in both the static_inet and static_inet6 functions that is initialized directly in the function via the sysctl.

Do you have a locally modified version of the /etc/rc.d/routing script?