-
Notifications
You must be signed in to change notification settings - Fork 1.3k
build: the war on config.h
is a war of attrition, 2 of ∞
#18877
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Jafaral
merged 8 commits into
FRRouting:master
from
opensourcerouting:build-config-h-20250523
May 27, 2025
Merged
build: the war on config.h
is a war of attrition, 2 of ∞
#18877
Jafaral
merged 8 commits into
FRRouting:master
from
opensourcerouting:build-config-h-20250523
May 27, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, there were two and I only killed one in 9ff7885. Zap the other one too. And while we're at it, that means `ND6_INFINITE_LIFETIME` is no longer needed either. Signed-off-by: David Lamparter <[email protected]>
`struct in6_aliasreq` exists on all of the BSDs, no point in testing for it really. Just use it and that's that then. Signed-off-by: David Lamparter <[email protected]>
`netinet6/in6_var.h` exists on all of the BSDs, and more than that it's only needed in `zebra/ioctl.c` and nowhere else. Drop the check & global `zebra.h` reference, and just include it where it's actually used. Signed-off-by: David Lamparter <[email protected]>
If you've looked at the commits before this, you'll know the drill: this file exists on all BSDs, so it's pointless to check. It's also only used in 3 files, so include it there. Except for some reason there was an `#include <linux/types.h>` tied into this, which is incredibly strange. The check was triggering on *some* of the Linux systems in CI (because old Linux has a sys/sysctl.h), but not all... so it should be safe to remove. Let's just see if it blows up. Signed-off-by: David Lamparter <[email protected]>
This one is extra funny because `configure.ac` has a comment explaining why it's needed. Except that comment is either wrong or outdated... `net/if_var.h` doesn't exist on NetBSD, is semantically empty on OpenBSD, and contains nothing of relevance on FreeBSD. Ditch and move on. Signed-off-by: David Lamparter <[email protected]>
Neither of these two include files is needed anywhere. Ditch the autoconf checks and global `lib/zebra.h` reference. Signed-off-by: David Lamparter <[email protected]>
Once CI finishes I'll get this in..... |
`net/if_dl.h` exists on all BSDs and is used for all link-level interface address bits there. Remove the autoconf check, and gate it by `!__linux__` instead, and include it where needed rather than in `lib/zebra.h`. (Note there are some other CMSG related macros that implicitly need it, that's why it's in the _packet.c files even though they have no direct sockaddr_dl reference.) Signed-off-by: David Lamparter <[email protected]>
At least in `.h` files, use `__linux__` (defined by the compilers) rather than `GNU_LINUX` (from our autoconf). It doesn't matter much for `.c` files, but for `.h` it's the difference between them being externally usable without our autoconf foo or not. Signed-off-by: David Lamparter <[email protected]>
eee3b7f
to
40b5660
Compare
LGTM, including yesterday's updates after @donaldsharp 's review. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Another stack of
config.h
related cleanups.On the TODO list of things needed for using our headers without
config.h
(#18807):HAVE_CLOCK_THREAD_CPUTIME_ID
needs to go (because it changes the layout ofstruct event
)HAVE_SECTION_SYMS
might affect thingsHAVE_MALLOC_USABLE_SIZE
&HAVE_MALLOC_SIZE
need something, because they affect the layout ofstruct mtype
MULTIPATH_NUM
will just need to be exported in the.pc
file, i.e. it'll have-DMULTIPATH_NUM=1234
HAVE_NETLINK
(struct layouts?)HAVE_RTADV
(struct layouts again)HAVE_BFDD
(conditionals in zebra?)The other
#if
checks should be "benign", as in, shouldn't break anything if they're just not set.