git: 92e190f11fe8 - main - netinet*: remove unneeded headers from files that just declare domains

From: Gleb Smirnoff <glebius_at_FreeBSD.org>
Date: Tue, 25 Oct 2022 18:09:57 UTC
The branch main has been updated by glebius:

URL: https://cgit.FreeBSD.org/src/commit/?id=92e190f11fe872f7b1f1a1a22c1f10edeb3b7f8d

commit 92e190f11fe872f7b1f1a1a22c1f10edeb3b7f8d
Author:     Gleb Smirnoff <glebius@FreeBSD.org>
AuthorDate: 2022-10-25 18:09:23 +0000
Commit:     Gleb Smirnoff <glebius@FreeBSD.org>
CommitDate: 2022-10-25 18:09:23 +0000

    netinet*: remove unneeded headers from files that just declare domains
---
 sys/netinet/in_proto.c   | 31 ++++---------------------------
 sys/netinet6/in6_proto.c | 24 ++----------------------
 2 files changed, 6 insertions(+), 49 deletions(-)

diff --git a/sys/netinet/in_proto.c b/sys/netinet/in_proto.c
index 4eb037dbeed0..fa0530500a15 100644
--- a/sys/netinet/in_proto.c
+++ b/sys/netinet/in_proto.c
@@ -51,6 +51,8 @@ __FBSDID("$FreeBSD$");
 #include <sys/queue.h>
 #include <sys/sysctl.h>
 
+#include <netinet/in.h>
+
 /*
  * While this file provides the domain and protocol switch tables for IPv4, it
  * also provides the sysctl node declarations for net.inet.* often shared with
@@ -58,33 +60,6 @@ __FBSDID("$FreeBSD$");
  * support compile out everything but these sysctl nodes.
  */
 #ifdef INET
-#include <net/if.h>
-#include <net/if_var.h>
-#include <net/route.h>
-#include <net/vnet.h>
-#endif /* INET */
-
-#if defined(INET) || defined(INET6)
-#include <netinet/in.h>
-#endif
-
-#ifdef INET
-#include <netinet/in_systm.h>
-#include <netinet/in_var.h>
-#include <netinet/ip.h>
-#include <netinet/ip_var.h>
-#include <netinet/ip_icmp.h>
-#include <netinet/igmp_var.h>
-#include <netinet/tcp.h>
-#include <netinet/tcp_timer.h>
-#include <netinet/tcp_var.h>
-#include <netinet/udp.h>
-#include <netinet/udp_var.h>
-#include <netinet/ip_encap.h>
-
-/*
- * TCP/IP protocol family: IP, ICMP, UDP, TCP.
- */
 
 #ifdef SCTP
 #include <netinet/in_pcb.h>
@@ -97,6 +72,8 @@ __FBSDID("$FreeBSD$");
 extern struct protosw rip_protosw;
 /* netinet/udp_usrreq.c */
 extern struct protosw udp_protosw, udplite_protosw;
+/* netinet/tcp_usrreq.c */
+extern struct protosw tcp_protosw;
 
 FEATURE(inet, "Internet Protocol version 4");
 
diff --git a/sys/netinet6/in6_proto.c b/sys/netinet6/in6_proto.c
index da15e6e2d13d..f0e1920d09f8 100644
--- a/sys/netinet6/in6_proto.c
+++ b/sys/netinet6/in6_proto.c
@@ -85,31 +85,9 @@ __FBSDID("$FreeBSD$");
 #include <sys/systm.h>
 #include <sys/sysctl.h>
 
-#include <net/if.h>
-#include <net/if_var.h>
-#include <net/radix.h>
-#include <net/route.h>
-
 #include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/in_var.h>
-#include <netinet/ip_encap.h>
-#include <netinet/ip.h>
-#include <netinet/ip_var.h>
-#include <netinet/ip6.h>
-#include <netinet6/ip6_var.h>
 #include <netinet/icmp6.h>
-
-#include <netinet/tcp.h>
-#include <netinet/tcp_timer.h>
-#include <netinet/tcp_var.h>
-#include <netinet/udp.h>
-#include <netinet/udp_var.h>
-#include <netinet6/tcp6_var.h>
 #include <netinet6/raw_ip6.h>
-#include <netinet6/udp6_var.h>
-#include <netinet6/pim6_var.h>
-#include <netinet6/nd6.h>
 
 #ifdef SCTP
 #include <netinet/in_pcb.h>
@@ -123,6 +101,8 @@ __FBSDID("$FreeBSD$");
 extern struct protosw rip6_protosw;
 /* netinet6/udp6_usrreq.c */
 extern struct protosw udp6_protosw, udplite6_protosw;
+/* netinet/tcp_usrreq.c */
+extern struct protosw tcp6_protosw;
 
 /*
  * TCP/IP protocol family: IP6, ICMP6, UDP, TCP.