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

FS#1800 - Error compiling Openwrt if netfilter is disabled on some mediatek targets due to unnecessary include #6752

Open
openwrt-bot opened this issue Aug 20, 2018 · 1 comment
Labels
flyspray kernel pull request/issue with Linux kernel related changes

Comments

@openwrt-bot
Copy link

araujorm:

  • Device problem occurs on - ramips mediatek soc targets (e.g ramips_mt76x8)
  • Software versions of OpenWrt/LEDE release, packages, etc. - master and 18.06 (probably earlier, couldn't confirm); kernel package
  • Steps to reproduce - try to build without netfilter support (e.g. for creating a dumb ap in hardware with very low flash space)

Building Openwrt fails (confirmed on master and 18.06) for some mediatek targets if netfilter is disabled, due to a unnecessary include in OpenWRT kernel source that isn't even present in vanilla/upstream kernel:

In file included from drivers/net/ethernet/mediatek/mtk_eth_soc.c:34:0:
./include/net/netfilter/nf_flow_table.h:19:2: error: unknown type name 'nf_hookfn'
nf_hookfn *hook;
^~~~~~~~~
./include/net/netfilter/nf_flow_table.h:149:23: warning: 'struct nf_hook_state' declared inside parameter list will not be visible outside of this definition or declaration
const struct nf_hook_state *state);
^~~~~~~~~~~~~
./include/net/netfilter/nf_flow_table.h:151:25: warning: 'struct nf_hook_state' declared inside parameter list will not be visible outside of this definition or declaration
const struct nf_hook_state *state);
^~~~~~~~~~~~~

The problem resides in the file linux-4.14.*/drivers/net/ethernet/mediatek/mtk_eth_soc.c at line 34 that has:

#include <net/netfilter/nf_flow_table.h>

By simply removing/commenting the aforementioned line, it is possible to build the image with success. As such, this line seems unnecessary and just causes issues?

This line isn't present in vanilla/upstream kernel as you can see in:

https://github.com/torvalds/linux/blob/master/drivers/net/ethernet/mediatek/mtk_eth_soc.c

The change comes from openwrt file target/linux/ramips/files-4.14/drivers/net/ethernet/mediatek/mtk_eth_soc.c and as such the attached patch fixes this issue for now, but is more a workaround. Maybe who put the include should review and add some ifdefs where appropriate?

For now, my tests indicate that applying this patch does not cause major issues if you build with netfilter (firewall, iptables, etc.) support, but something is probably missing. Can you please check?

Also, please note that the same (unnecessary?) include is present in target/linux/ramips/files-4.14/drivers/net/ethernet/mediatek/mtk_offload.h and probably affects building with some other configurations as well.

Thanks and best regards.

@openwrt-bot
Copy link
Author

hmronline:

I had the same issues , and I can confirm this patch works fine.
Please review and include in master source code.
Thanks!
Hernan.-

@aparcar aparcar added the kernel pull request/issue with Linux kernel related changes label Feb 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flyspray kernel pull request/issue with Linux kernel related changes
Projects
None yet
Development

No branches or pull requests

2 participants