mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-13 05:41:26 +01:00
ktest: make ktest work with Netlink loaded as a module.
MFC after: 2 weeks
This commit is contained in:
parent
08300d8494
commit
0eb0d23335
@ -9,5 +9,6 @@ SYSDIR?=${SRCTOP}/sys
|
|||||||
|
|
||||||
KMOD= ktest_example
|
KMOD= ktest_example
|
||||||
SRCS= ktest_example.c
|
SRCS= ktest_example.c
|
||||||
|
SRCS+= opt_netlink.h
|
||||||
|
|
||||||
.include <bsd.kmod.mk>
|
.include <bsd.kmod.mk>
|
||||||
|
@ -94,7 +94,7 @@ static struct ktest_module_info _module_info = { \
|
|||||||
}; \
|
}; \
|
||||||
\
|
\
|
||||||
static moduledata_t _module_data = { \
|
static moduledata_t _module_data = { \
|
||||||
"__" #_n "_module", \
|
#_n, \
|
||||||
ktest_default_modevent, \
|
ktest_default_modevent, \
|
||||||
&_module_info, \
|
&_module_info, \
|
||||||
}; \
|
}; \
|
||||||
@ -102,6 +102,7 @@ static moduledata_t _module_data = { \
|
|||||||
DECLARE_MODULE(ktest_##_n, _module_data, SI_SUB_PSEUDO, SI_ORDER_ANY); \
|
DECLARE_MODULE(ktest_##_n, _module_data, SI_SUB_PSEUDO, SI_ORDER_ANY); \
|
||||||
MODULE_VERSION(ktest_##_n, 1); \
|
MODULE_VERSION(ktest_##_n, 1); \
|
||||||
MODULE_DEPEND(ktest_##_n, ktestmod, 1, 1, 1); \
|
MODULE_DEPEND(ktest_##_n, ktestmod, 1, 1, 1); \
|
||||||
|
MODULE_DEPEND(ktest_##_n, netlink, 1, 1, 1); \
|
||||||
|
|
||||||
#endif /* _KERNEL */
|
#endif /* _KERNEL */
|
||||||
|
|
||||||
|
@ -91,7 +91,7 @@ class KtestLoader(object):
|
|||||||
|
|
||||||
ret = []
|
ret = []
|
||||||
for rx_msg in NetlinkMultipartIterator(self.nlsock, nlmsg_seq, self.family_id):
|
for rx_msg in NetlinkMultipartIterator(self.nlsock, nlmsg_seq, self.family_id):
|
||||||
# test_msg.print_message()
|
# rx_msg.print_message()
|
||||||
tst = {
|
tst = {
|
||||||
"mod_name": rx_msg.get_nla(KtestAttrType.KTEST_ATTR_MOD_NAME).text,
|
"mod_name": rx_msg.get_nla(KtestAttrType.KTEST_ATTR_MOD_NAME).text,
|
||||||
"name": rx_msg.get_nla(KtestAttrType.KTEST_ATTR_TEST_NAME).text,
|
"name": rx_msg.get_nla(KtestAttrType.KTEST_ATTR_TEST_NAME).text,
|
||||||
|
Loading…
Reference in New Issue
Block a user