git: 603cdb0f092c - stable/13 - linux(4): Attach netlink on i386.

From: Dmitry Chagin <dchagin_at_FreeBSD.org>
Date: Thu, 09 Feb 2023 07:56:53 UTC
The branch stable/13 has been updated by dchagin:

URL: https://cgit.FreeBSD.org/src/commit/?id=603cdb0f092c741a5774e4bea7a94714d9d835ba

commit 603cdb0f092c741a5774e4bea7a94714d9d835ba
Author:     Dmitry Chagin <dchagin@FreeBSD.org>
AuthorDate: 2023-02-06 14:00:44 +0000
Commit:     Dmitry Chagin <dchagin@FreeBSD.org>
CommitDate: 2023-02-09 07:55:25 +0000

    linux(4): Attach netlink on i386.
    
    Discussed with:         melifaro
    MFC after:              3 days
    
    (cherry picked from commit 07db1f36848c008efb7ab6b37e199212560833ae)
---
 sys/i386/linux/linux_sysvec.c | 3 +++
 sys/modules/linux/Makefile    | 1 +
 2 files changed, 4 insertions(+)

diff --git a/sys/i386/linux/linux_sysvec.c b/sys/i386/linux/linux_sysvec.c
index 39249cb25320..d8eee3f96a93 100644
--- a/sys/i386/linux/linux_sysvec.c
+++ b/sys/i386/linux/linux_sysvec.c
@@ -911,6 +911,7 @@ linux_elf_modevent(module_t mod, int type, void *data)
 				linux_ioctl_register_handler(*lihp);
 			linux_dev_shm_create();
 			linux_osd_jail_register();
+			linux_netlink_register();
 			stclohz = (stathz ? stathz : hz);
 			if (bootverbose)
 				printf("Linux ELF exec handler installed\n");
@@ -931,6 +932,7 @@ linux_elf_modevent(module_t mod, int type, void *data)
 		if (error == 0) {
 			SET_FOREACH(lihp, linux_ioctl_handler_set)
 				linux_ioctl_unregister_handler(*lihp);
+			linux_netlink_deregister();
 			linux_dev_shm_destroy();
 			linux_osd_jail_deregister();
 			if (bootverbose)
@@ -951,4 +953,5 @@ static moduledata_t linux_elf_mod = {
 };
 
 DECLARE_MODULE_TIED(linuxelf, linux_elf_mod, SI_SUB_EXEC, SI_ORDER_ANY);
+MODULE_DEPEND(linuxelf, netlink, 1, 1, 1);
 FEATURE(linux, "Linux 32bit support");
diff --git a/sys/modules/linux/Makefile b/sys/modules/linux/Makefile
index 4e41f8e9403c..fad03e8a8ca0 100644
--- a/sys/modules/linux/Makefile
+++ b/sys/modules/linux/Makefile
@@ -49,6 +49,7 @@ VDSODEPS=linux_vdso_gettc_x86.inc
 SRCS+=	linux${SFX}_support.s
 .else
 SRCS+=	linux_copyout.c
+SRCS+=	linux_netlink.c
 .endif
 DPSRCS=	assym.inc linux${SFX}_genassym.c