netlink: move NETLINK define to opt_global.h

Move the NETLINK define into opt_global.h so we can rely on it being
set correctly, without having to remember to include opt_netlink.h.
This ensures that the NETLINK define is correctly set. If not we
may end up with unloadable modules, due to missing symbols (such as
nlmsg_get_group_writer).

PR:		274306
Reviewed by:	imp, markj
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D42179
This commit is contained in:
Kristof Provost 2023-10-12 21:55:57 +02:00
parent 90367ba750
commit ab393e9548
26 changed files with 5 additions and 42 deletions

View file

@ -27,7 +27,6 @@
#include "opt_inet.h"
#include "opt_inet6.h"
#include "opt_netlink.h"
#include <sys/types.h>
#include <sys/ck.h>

View file

@ -472,7 +472,7 @@ MBUF_PROFILING
MBUF_STRESS_TEST
MROUTING opt_mrouting.h
NFSLOCKD
NETLINK opt_netlink.h
NETLINK opt_global.h
PF_DEFAULT_TO_DROP opt_pf.h
ROUTE_MPATH opt_route.h
ROUTETABLES opt_route.h

View file

@ -5,6 +5,6 @@
KMOD= carp
SRCS= ip_carp.c sha1.c
SRCS+= device_if.h bus_if.h vnode_if.h
SRCS+= opt_carp.h opt_bpf.h opt_inet.h opt_inet6.h opt_ofed.h opt_netlink.h
SRCS+= opt_carp.h opt_bpf.h opt_inet.h opt_inet6.h opt_ofed.h
.include <bsd.kmod.mk>

View file

@ -8,6 +8,5 @@ SYSDIR?=${SRCTOP}/sys
KMOD= ktest
SRCS= ktest.c
SRCS+= opt_netlink.h
.include <bsd.kmod.mk>

View file

@ -8,6 +8,5 @@ SYSDIR?=${SRCTOP}/sys
KMOD= ktest_example
SRCS= ktest_example.c
SRCS+= opt_netlink.h
.include <bsd.kmod.mk>

View file

@ -8,7 +8,6 @@ SYSDIR?=${SRCTOP}/sys
KMOD= ktest_netlink_message_writer
SRCS= ktest_netlink_message_writer.c
SRCS+= opt_netlink.h
.include <bsd.kmod.mk>

View file

@ -70,8 +70,7 @@ SRCS+= imgact_linux.c \
linux_vdso_selector_x86.c \
linux_x86.c \
linux_copyout.c \
linux_netlink.c \
opt_netlink.h
linux_netlink.c
.endif
.if ${MACHINE_CPUARCH} == "i386"

View file

@ -7,8 +7,7 @@
KMOD= linux_common
SRCS= linux_common.c linux_mib.c linux_mmap.c linux_util.c linux_emul.c \
linux_dummy.c linux_errno.c linux_netlink.c \
linux.c device_if.h vnode_if.h bus_if.h opt_inet6.h opt_inet.h \
opt_netlink.h
linux.c device_if.h vnode_if.h bus_if.h opt_inet6.h opt_inet.h
.if ${MACHINE_CPUARCH} == "amd64"
SRCS+= linux_x86.c linux_vdso_selector_x86.c

View file

@ -5,7 +5,7 @@ SRCS = netlink_module.c netlink_domain.c netlink_io.c \
netlink_message_writer.c netlink_generic.c \
netlink_route.c route/iface.c route/iface_drivers.c route/neigh.c \
route/nexthop.c route/rt.c
SRCS+= opt_inet.h opt_inet6.h opt_route.h opt_netlink.h
SRCS+= opt_inet.h opt_inet6.h opt_route.h
CFLAGS+= -DNETLINK_MODULE

View file

@ -32,8 +32,6 @@
* @(#)if.c 8.5 (Berkeley) 1/9/95
*/
#include "opt_netlink.h"
#include <sys/param.h>
#include <sys/eventhandler.h>
#include <sys/malloc.h>

View file

@ -46,7 +46,6 @@
#include "opt_inet.h"
#include "opt_inet6.h"
#include "opt_kern_tls.h"
#include "opt_netlink.h"
#include "opt_vlan.h"
#include "opt_ratelimit.h"

View file

@ -28,8 +28,6 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "opt_netlink.h"
#include <sys/cdefs.h>
#include "opt_bpf.h"
#include "opt_inet.h"

View file

@ -25,8 +25,6 @@
* SUCH DAMAGE.
*/
#include "opt_netlink.h"
#include <tests/ktest.h>
#include <sys/cdefs.h>
#include <sys/systm.h>

View file

@ -30,7 +30,6 @@
* This file contains socket and protocol bindings for netlink.
*/
#include "opt_netlink.h"
#include <sys/param.h>
#include <sys/kernel.h>
#include <sys/malloc.h>

View file

@ -25,8 +25,6 @@
* SUCH DAMAGE.
*/
#include "opt_netlink.h"
#include <sys/cdefs.h>
#include <sys/types.h>
#include <sys/ck.h>

View file

@ -25,8 +25,6 @@
* SUCH DAMAGE.
*/
#include "opt_netlink.h"
#include <sys/param.h>
#include <sys/kernel.h>
#include <sys/malloc.h>

View file

@ -26,8 +26,6 @@
* SUCH DAMAGE.
*/
#include "opt_netlink.h"
#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/ck.h>

View file

@ -25,8 +25,6 @@
* SUCH DAMAGE.
*/
#include "opt_netlink.h"
#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/malloc.h>

View file

@ -26,8 +26,6 @@
* SUCH DAMAGE.
*/
#include "opt_netlink.h"
#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/kernel.h>

View file

@ -25,8 +25,6 @@
* SUCH DAMAGE.
*/
#include "opt_netlink.h"
#include <sys/cdefs.h>
#include "opt_inet.h"
#include "opt_inet6.h"

View file

@ -25,7 +25,6 @@
* SUCH DAMAGE.
*/
#include "opt_netlink.h"
#include <sys/cdefs.h>
#include "opt_inet.h"
#include "opt_inet6.h"

View file

@ -25,8 +25,6 @@
* SUCH DAMAGE.
*/
#include "opt_netlink.h"
#include <sys/cdefs.h>
#include "opt_inet.h"
#include "opt_inet6.h"

View file

@ -25,8 +25,6 @@
* SUCH DAMAGE.
*/
#include "opt_netlink.h"
#include <sys/cdefs.h>
#include "opt_inet.h"
#include "opt_inet6.h"

View file

@ -26,8 +26,6 @@
* SUCH DAMAGE.
*/
#include "opt_netlink.h"
#include <sys/cdefs.h>
#include "opt_inet.h"
#include "opt_inet6.h"

View file

@ -27,8 +27,6 @@
*
*/
#include "opt_netlink.h"
#include <sys/cdefs.h>
#include <sys/param.h>

View file

@ -25,8 +25,6 @@
* SUCH DAMAGE.
*/
#include "opt_netlink.h"
#include <sys/param.h>
#include <sys/refcount.h>
#include <sys/types.h>