Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in 5.15.86 ct_event #209

Open
DocMAX opened this issue Jan 5, 2023 · 17 comments
Open

Error in 5.15.86 ct_event #209

DocMAX opened this issue Jan 5, 2023 · 17 comments

Comments

@DocMAX
Copy link

DocMAX commented Jan 5, 2023

Test member nf_ct_event_notifier.ct_event net/netfilter/nf_conntrack_ecache.h  undeclared
egrep: warning: egrep is obsolescent; using grep -E
Error: unexpected error from compiler
make -s -B -C /mnt/zeus/hdd/sources/openwrt/sources/snapshot/build_dir/target-arm_cortex-a9+vfpv3-d16_musl_eabi/linux-mvebu_cortexa9/linux-5.15.86 M=/mnt/zeus/hdd/sources/openwrt/sources/snapshot/build_dir/target-arm_cortex-a9+vfpv3-d16_musl_eabi/linux-mvebu_cortexa9/ipt-netflow-40fefb2/cc-test-build modules
/mnt/zeus/hdd/sources/openwrt/sources/snapshot/build_dir/target-arm_cortex-a9+vfpv3-d16_musl_eabi/linux-mvebu_cortexa9/ipt-netflow-40fefb2/cc-test-build/test.c:4:41: error: invalid use of undefined type 'struct nf_ct_event_notifier'
    4 | typeof(((struct nf_ct_event_notifier*)0)->ct_event) test;
      |                                         ^~
make[5]: *** [scripts/Makefile.build:289: /mnt/zeus/hdd/sources/openwrt/sources/snapshot/build_dir/target-arm_cortex-a9+vfpv3-d16_musl_eabi/linux-mvebu_cortexa9/ipt-netflow-40fefb2/cc-test-build/test.o] Error 1
make[4]: *** [Makefile:1903: /mnt/zeus/hdd/sources/openwrt/sources/snapshot/build_dir/target-arm_cortex-a9+vfpv3-d16_musl_eabi/linux-mvebu_cortexa9/ipt-netflow-40fefb2/cc-test-build] Error 2

make[3]: *** [Makefile:30: compat_def.h] Error 3
make[3]: Leaving directory '/mnt/zeus/hdd/sources/openwrt/sources/snapshot/build_dir/target-arm_cortex-a9+vfpv3-d16_musl_eabi/linux-mvebu_cortexa9/ipt-netflow-40fefb2'
make[2]: *** [Makefile:121: /mnt/zeus/hdd/sources/openwrt/sources/snapshot/build_dir/target-arm_cortex-a9+vfpv3-d16_musl_eabi/linux-mvebu_cortexa9/ipt-netflow-40fefb2/.built] Error 2
make[2]: Leaving directory '/mnt/zeus/hdd/sources/openwrt/sources/snapshot/package/network/ipt-netflow'
time: package/network/ipt-netflow/compile#14.33#7.78#21.41
    ERROR: package/network/ipt-netflow failed to build.
make[1]: *** [package/Makefile:116: package/network/ipt-netflow/compile] Error 1
make[1]: Leaving directory '/mnt/zeus/hdd/sources/openwrt/sources/snapshot'
make: *** [/mnt/zeus/hdd/sources/openwrt/sources/snapshot/include/toplevel.mk:231: package/network/ipt-netflow/compile] Fehler 2
@svlobanov
Copy link

It might be openwrt env issue. Do you have the same issue if compile on regular host for regular host? (e.g. debian normal setup)

@kalamlacki
Copy link

ipt-netflow versions 2.6 or 2.5.1 cannot be compiled against openwrt trunk

when you change openwrt MakeFile and comment this:
#PKG_VERSION:=2.6
#PKG_SOURCE_VERSION:=v$(PKG_VERSION)

and uncomment this:

PKG_VERSION:=$(shell (git ls-remote $(PKG_SOURCE_URL) | grep refs/heads/master | cut -f 1 | head -c 7))
PKG_SOURCE_VERSION:=HEAD

then you will compile current master branch and not versions of ipt-netflow on openwrt and it will work fine.

The proof: http://kalamlacki.eu/ipt-netflow/develop_2023_01_06/

@DocMAX
Copy link
Author

DocMAX commented Jan 6, 2023

I compiled exactly as you wrote, here is my makefile. Using current openwrt snapshot source.
http://ix.io/4kui

@kalamlacki
Copy link

What kind of distro were you using for compilation, which openwrt SDK you were using?
I compiled this on Ubuntu 18.04.6

@DocMAX
Copy link
Author

DocMAX commented Jan 6, 2023

Latest Arch Linux. OpenWRT cloned from https://github.com/openwrt/openwrt.git.
Target is Turris Omnia router.
I will try a make dirclean. Sometimes this helps.

@kalamlacki
Copy link

@DocMAX
Copy link
Author

DocMAX commented Jan 6, 2023

i'm not sure what is this about. my procedure is

  1. clone openwrt git
  2. put makefile in /package/network/ipt-netflow
  3. make menuconfig, select my board and software and netflow
  4. compile with make -j16

is something wrong with this?

@kalamlacki
Copy link

xz -d< openwrt-sdk-mvebu-cortexa9_gcc-11.3.0_musl_eabi.Linux-x86_64.tar.xz | tar -xv
cd openwrt-sdk-mvebu-cortexa9_gcc-11.3.0_musl_eabi.Linux-x86_64
./scripts/feeds update -a
./scripts/feeds install iptables
make package/ipt-netflow/compile V=99

@kalamlacki
Copy link

It will take a few minutes to compile

@DocMAX
Copy link
Author

DocMAX commented Jan 6, 2023

what is wrong with my procedure?
what is different to openwrt-sdk-mvebu-cortexa9_gcc-11.3.0_musl_eabi.Linux-x86_64?

@kalamlacki
Copy link

if you do not compile the whole Openwrt from sources SDK is sufficient.
Is my procedure working ?

@DocMAX
Copy link
Author

DocMAX commented Jan 6, 2023

yes compiles with no issues. thanks :-) but i wonder why it's not compiling with the openwrt source.

@DocMAX
Copy link
Author

DocMAX commented Jan 6, 2023

you know what worked? i simply deleted:
./build_dir/target-arm_cortex-a9+vfpv3-d16_musl_eabi/linux-mvebu_cortexa9/linux-5.15.86/include/net/netfilter/nf_conntrack_ecache.h
./build_dir/toolchain-arm_cortex-a9+vfpv3-d16_gcc-11.3.0_musl_eabi/linux-5.15.86/include/net/netfilter/nf_conntrack_ecache.h

and now it compiles without errors, can someone explain??!?!?
(with my method cloning openwrt from github)

@DocMAX
Copy link
Author

DocMAX commented Jan 6, 2023

anything i do on openwrt git snapshot i'm stuck at this "test":
@aabc please advice, thanks!
test.c:4:41: error: invalid use of undefined type 'struct nf_ct_event_notifier'

@DocMAX
Copy link
Author

DocMAX commented Jan 6, 2023

@kalamlacki root cause ist 6a55739
i removed that test what ever it does and now it's compiling fine.
that's why it working in 2.5.1 before, because this commit is missing.
@aabc please have a look.

@kalamlacki
Copy link

@DocMAX I saw that you did fork of ipt-netflow repository. Are you going to maintain it?
The next thing to do is PREMPTING support because modern kernels have this feature turned on and this module does not support it.

@vvfedorenko
Copy link
Contributor

the definition of struct nf_ct_event_notifier is hidden behind CONFIG_NF_CONNTRACK_EVENTS option. If the kernel configuration doesn't have it, you will get such kind of error while running configure --enable-nat-events. Consider changing kernel options in your build, it's disabled by default in OpenWRT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants