Re: git: aa70361d863b - main - headers: make a few more headers self-contained

From: Warner Losh <imp_at_bsdimp.com>
Date: Mon, 03 Jan 2022 15:06:11 UTC
On Mon, Jan 3, 2022 at 5:56 AM Kristof Provost <kp@freebsd.org> wrote:

> The branch main has been updated by kp:
>
> URL:
> https://cgit.FreeBSD.org/src/commit/?id=aa70361d863b7ec20c7e72a6fa7de8fb110715e1
>
> commit aa70361d863b7ec20c7e72a6fa7de8fb110715e1
> Author:     Kristof Provost <kp@FreeBSD.org>
> AuthorDate: 2021-12-24 15:43:57 +0000
> Commit:     Kristof Provost <kp@FreeBSD.org>
> CommitDate: 2022-01-03 09:12:30 +0000
>
>     headers: make a few more headers self-contained
>
>     Sponsored by:   Rubicon Communications, LLC ("Netgate")
> ---
>  sys/netinet/ip_var.h                   | 5 ++++-
>  sys/netinet/udp.h                      | 2 ++
>  sys/netinet/udp_var.h                  | 5 +++++
>  sys/sys/epoch.h                        | 2 ++
>  tools/build/test-includes/badfiles.inc | 4 ----
>  5 files changed, 13 insertions(+), 5 deletions(-)
>
> diff --git a/sys/netinet/ip_var.h b/sys/netinet/ip_var.h
> index 77b6ee88507a..d5c68442a2b9 100644
> --- a/sys/netinet/ip_var.h
> +++ b/sys/netinet/ip_var.h
> @@ -35,8 +35,11 @@
>  #ifndef _NETINET_IP_VAR_H_
>  #define        _NETINET_IP_VAR_H_
>
> -#include <sys/queue.h>
>  #include <sys/epoch.h>
> +#include <sys/queue.h>
> +#include <sys/types.h>
> +
> +#include <netinet/in.h>
>
>  /*
>   * Overlay for ip header used by other protocols (tcp, udp).
> diff --git a/sys/netinet/udp.h b/sys/netinet/udp.h
> index 263a64fbe588..d7def4e41fc8 100644
> --- a/sys/netinet/udp.h
> +++ b/sys/netinet/udp.h
> @@ -36,6 +36,8 @@
>  #ifndef _NETINET_UDP_H_
>  #define        _NETINET_UDP_H_
>
> +#include <sys/types.h>
> +
>  /*
>   * UDP protocol header.
>   * Per RFC 768, September, 1981.
> diff --git a/sys/netinet/udp_var.h b/sys/netinet/udp_var.h
> index 9a15016b37e3..e66328ec5cb0 100644
> --- a/sys/netinet/udp_var.h
> +++ b/sys/netinet/udp_var.h
> @@ -36,6 +36,11 @@
>  #ifndef _NETINET_UDP_VAR_H_
>  #define        _NETINET_UDP_VAR_H_
>
> +#include <sys/types.h>
>

types.h isn't needed here because both udp.h and ip_var.h include it.


> +#include <netinet/ip_var.h>
> +#include <netinet/udp.h>
> +
>  /*
>   * UDP kernel structures and variables.
>   */
> diff --git a/sys/sys/epoch.h b/sys/sys/epoch.h
> index 6ce0fcd01c60..7b06ee19c2f3 100644
> --- a/sys/sys/epoch.h
> +++ b/sys/sys/epoch.h
> @@ -30,6 +30,8 @@
>  #ifndef _SYS_EPOCH_H_
>  #define _SYS_EPOCH_H_
>
> +#include <sys/cdefs.h>
> +
>  struct epoch_context {
>         void   *data[2];
>  } __aligned(sizeof(void *));
> diff --git a/tools/build/test-includes/badfiles.inc
> b/tools/build/test-includes/badfiles.inc
> index 70061ae0b2b2..ce70cca62959 100644
> --- a/tools/build/test-includes/badfiles.inc
> +++ b/tools/build/test-includes/badfiles.inc
> @@ -35,7 +35,6 @@ BADHDRS= \
>         sys/elf64.h \
>         sys/elf_common.h \
>         sys/elf_generic.h \
> -       sys/epoch.h \
>         sys/eui64.h \
>         sys/eventhandler.h \
>         sys/eventvar.h \
> @@ -267,7 +266,6 @@ BADHDRS= \
>         netinet/ip_icmp.h \
>         netinet/ip_mroute.h \
>         netinet/ip_options.h \
> -       netinet/ip_var.h \
>         netinet/pim_var.h \
>         netinet/sctp_auth.h \
>         netinet/sctp_bsd_addr.h \
> @@ -287,8 +285,6 @@ BADHDRS= \
>         netinet/tcp_var.h \
>         netinet/tcpip.h \
>         netinet/toecore.h \
> -       netinet/udp.h \
> -       netinet/udp_var.h \
>         netinet/udplite.h \
>         netinet6/icmp6.h \
>         netinet6/in6.h \
>