From: Denis Ovsienko Date: Mon, 1 Apr 2024 11:58:17 +0000 (+0100) Subject: Include diag-control.h only where necessary. X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/b779eda489a90db6d63c325c7bd60763b3887016 Include diag-control.h only where necessary. Neither addrtoname.c nor extract.h nor netdissect.h nor print-sll.c require the header anymore, so do not include it there. Add a missing conditional include to netdissect.c. --- diff --git a/addrtoname.c b/addrtoname.c index 2a66b50e..48fac286 100644 --- a/addrtoname.c +++ b/addrtoname.c @@ -75,11 +75,6 @@ #endif /* what declares ether_ntohost() */ #ifdef NEED_NETINET_IF_ETHER_H - /* - * Include diag-control.h before , which too defines a macro - * named ND_UNREACHABLE. - */ - #include "diag-control.h" #include /* Needed on some platforms */ #include /* Needed on some platforms */ #include diff --git a/extract.h b/extract.h index fb80fdee..7ec40e63 100644 --- a/extract.h +++ b/extract.h @@ -37,7 +37,6 @@ */ #include "funcattrs.h" #include "netdissect.h" -#include "diag-control.h" /* * If we have versions of GCC or Clang that support an __attribute__ diff --git a/netdissect.c b/netdissect.c index e78ccbc7..a377a482 100644 --- a/netdissect.c +++ b/netdissect.c @@ -34,6 +34,10 @@ #include #endif +#ifdef _AIX +#include "diag-control.h" +#endif /* _AIX */ + /* * Initialize anything that must be initialized before dissecting * packets. diff --git a/netdissect.h b/netdissect.h index 283e5aa5..990cb145 100644 --- a/netdissect.h +++ b/netdissect.h @@ -33,7 +33,6 @@ #include #include "status-exit-codes.h" #include "funcattrs.h" /* for PRINTFLIKE_FUNCPTR() */ -#include "diag-control.h" /* for ND_UNREACHABLE */ /* * Data types corresponding to multi-byte integral values within data diff --git a/print-sll.c b/print-sll.c index 8292388b..3a760aef 100644 --- a/print-sll.c +++ b/print-sll.c @@ -24,11 +24,6 @@ #include #ifdef HAVE_NET_IF_H -/* - * Include diag-control.h before , which too defines a macro - * named ND_UNREACHABLE. - */ -#include "diag-control.h" #include #endif