Avoid using ifdefs throughout syslogd. Instead, define HAS_INET and HAS_INET6 to true/false and use standard if/else blocks to check for INET/INET6 availability.
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
Comment Actions
Did you test compiling with WITHOUT_INET_SUPPORT=or WITHOUT_INET6_SUPPORT= defined? I suspect it will fail, because the #include <netinet/in.h> at the beginning of syslogd is still conditional on INET or INET6 being defined. While the ifdefs are ugly, I'm not sure we can do much better without adding some dummy definitions to replace those in netinet/in.h.
usr.sbin/syslogd/syslogd.c | ||
---|---|---|
3348 | Don't you still need something like if (HAS_INET6 && (<original condition>)) ? |
usr.sbin/syslogd/syslogd.c | ||
---|---|---|
3348 |
There is no original condition. The code technically isn't necessary when INET6 is disabled, but it won't disrupt INET/ipv4 parsing. |
Comment Actions
Yeah... Tried fixing the broken compilation with WITHOUT_INET_SUPPORT. It's a compilation nightmare. I'm just going to drop this.