why a modules is loaded into kernel even if the config option is m

the config option which determines whether the udp_tunnel module is compiled into the kernel is CONFIG_NET_UDP_TUNNEL. And the CONFIG_NET_UDP_TUNNEL in .config of Ubuntu is M, which should not be loaded into kernel automatically. But the result below shows that the udp_tunnel is loaded into kernel, which is confused to me.

$ modinfo udp_tunnel
filename:       /lib/modules/5.3.0-51-generic/kernel/net/ipv4/udp_tunnel.ko
license:        GPL
srcversion:     0A315BA6124B0664F4D23FB
depends:        
retpoline:      Y
intree:         Y
name:           udp_tunnel
vermagic:       5.3.0-51-generic SMP mod_unload 
signat:         PKCS#7
signer:         
sig_key:        
sig_hashalgo:   md4

$ echo $?
0

shows the modules udp_tunnel is loaded into the kernel and

0
задан 6 July 2020 в 07:30

1 ответ

Поиск информации о модуле не означает, что он загружен. modinfo также будет искать его в / lib / modules / version .

Если вы хотите узнать, загружен ли он, используйте lsmod. Пример:

doug@s18:/boot$ lsmod | grep udp
xt_tcpudp              20480  9
x_tables               45056  9 xt_conntrack,iptable_filter,xt_tcpudp,xt_CHECKSUM,ip6_tables,ipt_REJECT,ip_tables,xt_MASQUERADE,iptable_mangle

Теперь, если модуль принудительно загружен:

doug@s18:/boot$ sudo modprobe udp_tunnel
[sudo] password for doug:
doug@s18:/boot$ lsmod | grep udp
udp_tunnel             16384  0
xt_tcpudp              20480  9
x_tables               45056  9 xt_conntrack,iptable_filter,xt_tcpudp,xt_CHECKSUM,ip6_tables,ipt_REJECT,ip_tables,xt_MASQUERADE,iptable_mangle
1
ответ дан 30 July 2020 в 22:13

Другие вопросы по тегам:

Похожие вопросы: