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

net/ipv4/netfilter/ipt_ECN.c errors during build #8319

Closed
1 of 2 tasks
bengalih opened this issue Apr 22, 2022 · 4 comments
Closed
1 of 2 tasks

net/ipv4/netfilter/ipt_ECN.c errors during build #8319

bengalih opened this issue Apr 22, 2022 · 4 comments
Labels

Comments

@bengalih
Copy link

bengalih commented Apr 22, 2022

Version

Microsoft Windows [Version 10.0.19042.1348]

WSL Version

  • WSL 2
  • WSL 1

Kernel Version

5.10.102.1

Distro Version

Ubuntu 20.04.4 LTS

Other Software

No response

Repro Steps

When performing a build with make multiple errors for net/ipv4/netfilter/ipt_ECN.c are logged (see diag info below).

This appears to be due to the fact that the build is taking place on a non-case sensitive file system.
In this case, NTFS. I tested this theory by configuring case sensitivity on the git clone/build folder using the windows commands:

fsutil.exe file setCaseSensitiveInfo <directory> enable

(more info here: https://docs.microsoft.com/en-us/windows/wsl/case-sensitivity)

This was done prior to cloning the repo.

I performed this test 3 times each with CaseSensitiveInfo enabled and disabled. In all tests, when disabled these errors appeared and when enabled they did not.

It would seem that best practices would indicate performing builds on a case-sensitive file system.

Expected Behavior

Build completes without error

Actual Behavior

Build has multiple errors as shown in diagnostic logs

Diagnostic Logs

net/ipv4/netfilter/ipt_ECN.c:26:46: warning: ‘struct ipt_ECN_info’ declared inside parameter list will not be visible outside of this definition or declaration
26 | set_ect_ip(struct sk_buff *skb, const struct ipt_ECN_info *einfo)
| ^~~~~~~~~~~~
net/ipv4/netfilter/ipt_ECN.c: In function ‘set_ect_ip’:
net/ipv4/netfilter/ipt_ECN.c:30:44: error: dereferencing pointer to incomplete type ‘const struct ipt_ECN_info’
30 | if ((iph->tos & IPT_ECN_IP_MASK) != (einfo->ip_ect & IPT_ECN_IP_MASK)) {
| ^~
net/ipv4/netfilter/ipt_ECN.c: At top level:
net/ipv4/netfilter/ipt_ECN.c:45:47: warning: ‘struct ipt_ECN_info’ declared inside parameter list will not be visible outside of this definition or declaration
45 | set_ect_tcp(struct sk_buff *skb, const struct ipt_ECN_info *einfo)
| ^~~~~~~~~~~~
net/ipv4/netfilter/ipt_ECN.c: In function ‘set_ect_tcp’:
net/ipv4/netfilter/ipt_ECN.c:55:14: error: dereferencing pointer to incomplete type ‘const struct ipt_ECN_info’
55 | if ((!(einfo->operation & IPT_ECN_OP_SET_ECE) ||
| ^~
net/ipv4/netfilter/ipt_ECN.c:55:28: error: ‘IPT_ECN_OP_SET_ECE’ undeclared (first use in this function); did you mean ‘IPT_ECN_OP_MATCH_ECE’?
55 | if ((!(einfo->operation & IPT_ECN_OP_SET_ECE) ||
| ^~~~~~~~~~~~~~~~~~
| IPT_ECN_OP_MATCH_ECE
net/ipv4/netfilter/ipt_ECN.c:55:28: note: each undeclared identifier is reported only once for each function it appears in
net/ipv4/netfilter/ipt_ECN.c:57:28: error: ‘IPT_ECN_OP_SET_CWR’ undeclared (first use in this function); did you mean ‘IPT_ECN_OP_MATCH_CWR’?
57 | (!(einfo->operation & IPT_ECN_OP_SET_CWR) ||
| ^~~~~~~~~~~~~~~~~~
| IPT_ECN_OP_MATCH_CWR
net/ipv4/netfilter/ipt_ECN.c: In function ‘ecn_tg’:
net/ipv4/netfilter/ipt_ECN.c:81:11: error: dereferencing pointer to incomplete type ‘const struct ipt_ECN_info’
81 | if (einfo->operation & IPT_ECN_OP_SET_IP)
| ^~
net/ipv4/netfilter/ipt_ECN.c:81:25: error: ‘IPT_ECN_OP_SET_IP’ undeclared (first use in this function); did you mean ‘IPT_ECN_OP_MATCH_IP’?
81 | if (einfo->operation & IPT_ECN_OP_SET_IP)
| ^~~~~~~~~~~~~~~~~
| IPT_ECN_OP_MATCH_IP
net/ipv4/netfilter/ipt_ECN.c:82:24: error: passing argument 2 of ‘set_ect_ip’ from incompatible pointer type [-Werror=incompatible-pointer-types]
82 | if (!set_ect_ip(skb, einfo))
| ^~~~~
| |
| const struct ipt_ECN_info *
net/ipv4/netfilter/ipt_ECN.c:26:60: note: expected ‘const struct ipt_ECN_info *’ but argument is of type ‘const struct ipt_ECN_info *’
26 | set_ect_ip(struct sk_buff *skb, const struct ipt_ECN_info *einfo)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
net/ipv4/netfilter/ipt_ECN.c:85:26: error: ‘IPT_ECN_OP_SET_ECE’ undeclared (first use in this function); did you mean ‘IPT_ECN_OP_MATCH_ECE’?
85 | if (einfo->operation & (IPT_ECN_OP_SET_ECE | IPT_ECN_OP_SET_CWR) &&
| ^~~~~~~~~~~~~~~~~~
| IPT_ECN_OP_MATCH_ECE
net/ipv4/netfilter/ipt_ECN.c:85:47: error: ‘IPT_ECN_OP_SET_CWR’ undeclared (first use in this function); did you mean ‘IPT_ECN_OP_MATCH_CWR’?
85 | if (einfo->operation & (IPT_ECN_OP_SET_ECE | IPT_ECN_OP_SET_CWR) &&
| ^~~~~~~~~~~~~~~~~~
| IPT_ECN_OP_MATCH_CWR
net/ipv4/netfilter/ipt_ECN.c:87:25: error: passing argument 2 of ‘set_ect_tcp’ from incompatible pointer type [-Werror=incompatible-pointer-types]
87 | if (!set_ect_tcp(skb, einfo))
| ^~~~~
| |
| const struct ipt_ECN_info *
net/ipv4/netfilter/ipt_ECN.c:45:61: note: expected ‘const struct ipt_ECN_info *’ but argument is of type ‘const struct ipt_ECN_info *’
45 | set_ect_tcp(struct sk_buff *skb, const struct ipt_ECN_info *einfo)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
net/ipv4/netfilter/ipt_ECN.c: In function ‘ecn_tg_check’:
net/ipv4/netfilter/ipt_ECN.c:98:11: error: dereferencing pointer to incomplete type ‘const struct ipt_ECN_info’
98 | if (einfo->operation & IPT_ECN_OP_MASK)
| ^~
net/ipv4/netfilter/ipt_ECN.c:98:25: error: ‘IPT_ECN_OP_MASK’ undeclared (first use in this function); did you mean ‘IPT_ECN_IP_MASK’?
98 | if (einfo->operation & IPT_ECN_OP_MASK)
| ^~~~~~~~~~~~~~~
| IPT_ECN_IP_MASK
net/ipv4/netfilter/ipt_ECN.c:104:27: error: ‘IPT_ECN_OP_SET_ECE’ undeclared (first use in this function); did you mean ‘IPT_ECN_OP_MATCH_ECE’?
104 | if ((einfo->operation & (IPT_ECN_OP_SET_ECE|IPT_ECN_OP_SET_CWR)) &&
| ^~~~~~~~~~~~~~~~~~
| IPT_ECN_OP_MATCH_ECE
net/ipv4/netfilter/ipt_ECN.c:104:46: error: ‘IPT_ECN_OP_SET_CWR’ undeclared (first use in this function); did you mean ‘IPT_ECN_OP_MATCH_CWR’?
104 | if ((einfo->operation & (IPT_ECN_OP_SET_ECE|IPT_ECN_OP_SET_CWR)) &&
| ^~~~~~~~~~~~~~~~~~
| IPT_ECN_OP_MATCH_CWR
net/ipv4/netfilter/ipt_ECN.c: At top level:
net/ipv4/netfilter/ipt_ECN.c:116:23: error: invalid application of ‘sizeof’ to incomplete type ‘struct ipt_ECN_info’
116 | .targetsize = sizeof(struct ipt_ECN_info),
| ^~~~~~
cc1: some warnings being treated as errors
make[3]: *** [scripts/Makefile.build:280: net/ipv4/netfilter/ipt_ECN.o] Error 1
make[2]: *** [scripts/Makefile.build:497: net/ipv4/netfilter] Error 2
make[1]: *** [scripts/Makefile.build:497: net/ipv4] Error 2
make[1]: *** Waiting for unfinished jobs....

...

make[2]: *** No rule to make target 'net/netfilter/xt_HL.o', needed by 'net/netfilter/built-in.a'. Stop.
make[2]: *** Waiting for unfinished jobs....
CC net/netfilter/xt_CHECKSUM.o
CC fs/btrfs/backref.o
CC fs/xfs/xfs_buf.o
CC fs/xfs/xfs_dir2_readdir.o
CC drivers/base/module.o
CC drivers/base/platform-msi.o
make[1]: *** [scripts/Makefile.build:497: net/netfilter] Error 2

@OneBlue
Copy link
Collaborator

OneBlue commented Apr 26, 2022

Thanks for reporting this @bengalih.

So if understand correctly you're trying to build the kernel on an NTFS volume ? If so this isn't supported.

To build the kernel I'd recommend using a Linux filesystem (anything in your WSL user's home folder should work)

@bengalih
Copy link
Author

Thanks for reporting this @bengalih.

So if understand correctly you're trying to build the kernel on an NTFS volume ? If so this isn't supported.

To build the kernel I'd recommend using a Linux filesystem (anything in your WSL user's home folder should work)

You understand correctly.
Now that I've experienced the issue and have discovered the solution on my own, it becomes clearer that this doesn't appear to be a supported configuration (i.e. building kernel on non-Linux filesystem).

However, I don't believe this should be closed as "bydesign" without some accompanying update to documentation.

I cannot find any official reference for building a custom kernel on WSL2. As far as file system recommendations, the best I can find is:

https://docs.microsoft.com/en-us/windows/wsl/filesystems

In which it makes the argument for recommendations, but never outright states that you can't cross filesystems. Additionally, by providing us with tools like fsutil that allows changing the case-sensitivity of NTFS systems it is definitely not clear what operations are and are not supported.

It's a bug unless its documented, and if it is by design but undocumented then there are going to be more issues without proper guidance. If possible, please put in a recommendation with those responsible for either creating an official guide to building a kernel on WSL2, or at least update some of the general guidance articles on file-systems to be more clear.

thank you.

@chiruplayer
Copy link

fsutil.exe file setCaseSensitiveInfo <directory> enable

Did running this command give a successful compilation? It didn't for me. I am still getting the same error. I checked the flag with
fsutil.exe file queryCaseSensitiveInfo <path>
and it is enabled.

@bengalih
Copy link
Author

As reported, in my case it did built properly when enabling the feature.
As discussed above however, building on NTFS does not seem to be supported (although not well documented - or documented at all).

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

No branches or pull requests

3 participants