kernel module linking (general, ipfw table, netgraph)

Andrey V. Elsukov bu7cher at yandex.ru
Thu Sep 6 13:24:47 UTC 2018


On 06.09.2018 14:57, Eugene Grosbein wrote:
>> I am building my module using /usr/src/sys/modules/netgraph/sample and
>> /usr/src/sys/netgraph/ng_sample.* as templates. On the other hand, 
>> ng_socket
>> uses kern_kldload, "sysctl -b kern.function_list | tr '\0' '\n' | grep 
>> kern_kldload"
>> shows it and it works without any problems.
>>
>> Why is that? What have i not noticed that must be done?
> 
> Perhaps, this is KBI mismatch due to VIMAGE kernel option
> that changes symbols like add_table_entry to V_add_table_entry
> and your kernel module should be built WITH_VIMAGE defined too
> to be loadable to such a kernel.

I think VIMAGE only affects variables, but not functions.
The problem is probably due to missing dependency. Look at ng_ipfw
implementation. It depends from ipfw kernel module. Try add such
dependency to your module.

-- 
WBR, Andrey V. Elsukov

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 554 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20180906/692bf6e3/attachment.sig>


More information about the freebsd-hackers mailing list