Closed ewildgoose closed 1 year ago
Thoughts: Seems as though the src/lib/Makefile.am isn't including /usr/include in it's -I stanza
I think I'm a bit confused on what SHOULD be happening here? Where is this include on other systems, surely it can't only be me noticing this?
For kernel modules uses option "-nostdinc". Look for a hint in the nDPI/src/protocols/.dcerpc.o.cmd file.
I'm still fixing the errors made when adding new functionality. I will apply the fix for 5.17 a little later.
Thanks for the hint. I have had a quite look at this, but I think the hint isn't enough for me to figure out what I did wrong?
I don't have the dir you mention. Finding the protocols dir I don't have very many .o.cmd files and I don't have .dcerpc.o.cmd file?
I did a grep through the code for -nostdinc and I don't find any clues. Running "make blah -nostdinc" seems to lead to it not compiling anything at all...
Bleaugh. I'm a bit confused. Any chance of a further leg up please?
Find any .o.cmd file in the nDPI/src/protocols/ directory. In it you will find all the options with which the compiler is launched, including all the directories in which the compiler will look for header files are listed there. Are there any of these directories that contain the stdbool.h file?
There is a suspicion that you have some temporary obsolete file. Doing "make distclean" on the nDPI directory. And then run the command:
find -type f \( -name '*.o' -o -name '*.ko' -o -name '*.o.cmd' -o -name '*.ko.cmd' \
-o -name '*.mod' -o -name '*.mod.c' -o -name '*.mod.o' \
-o -name .Module.symvers.cmd -o -name .modules.order.cmd \
-o -name Module.symvers -o -name modules.order \
-o -name '*.mod.cmd' -o -name .cache.mk \) -delete -print
Can you evaluate the following patch please. I concede I'm not sure what I'm doing, so...
Reading docs it seems as though for using bool type in kernel space we need "#include <linux/types.h>"? I'm not clear why everything is compiling for you, but at least on my musl system, I'm having trouble getting stdbool.h being in the search path
This patch works for me on an amd64 musl system. Could someone confirm it does no harm on other systems? (I'll shortly test on i386 and arm 32bit)
Thanks
--- a/src/lib/protocols/dcerpc.c 2022-05-31 18:47:46.908279592 +0000
+++ b/src/lib/protocols/dcerpc.c 2022-05-31 18:50:26.575524062 +0000
@@ -26,7 +26,8 @@
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_RPC
#include "ndpi_api.h"
-#include <stdbool.h>
+/* Define bool for kernel compile */
+#include <linux/types.h>
static void ndpi_int_dcerpc_add_connection(struct ndpi_detection_module_struct
*ndpi_struct, struct ndpi_flow_struct *flow)
Thanks! Fixed in 9f9138c5aa0eda811822a756535aab9b566e1c44
I've just updated to git revision 1367ad9, ie branch flow-4 latest. I corrected the kernel compile with the pull request I sent separately, but this leaves a compile error as follows:
However, I seem to have this file on my system:
Help! I can't figure out what I've busted here?
For background, this is built via gentoo and it's build system. I think I have all needed dependencies, but I'm not really a C guy, and unsure why my includes are busted at this point? How might I go about understanding and debugging this?? (Edited to show the whole compile when run manually from the command line)
Thanks