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: add netfilter compatible definitions for iptables #9744

Merged
merged 1 commit into from Jul 8, 2023

Conversation

zhhyu7
Copy link
Contributor

@zhhyu7 zhhyu7 commented Jul 8, 2023

Summary

In order to support the compilation of third-party library, we encounter some situations where the macro is not defined, refer to the common implementation of other systems and add relevant definitions.

Impact

Testing

sim:local

include/nuttx/net/netfilter/ip6_tables.h Outdated Show resolved Hide resolved

uint16_t proto;

/* TOS to match iff flags & IP6T_F_TOS */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this "iff flags" ?

Copy link
Contributor Author

@zhhyu7 zhhyu7 Jul 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should be if, The libip6tc.c file contains the following code:

if (e->ipv6..flags & IP6T_F_TOS)
  printf("TOS: %u\n", e->ipv6.tos);
or
if (e->ipv6.flags & IP6T_F_TOS)
  printf("%s-? %d ",
            e->ipv6.invflags & IP6T_INV_TOS ? "! " : "",
            e->ipv6.tos);

type of e->ipv6 is this struct ip6t_ip6.

Copy link
Contributor

@acassis acassis Jul 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zhhyu7 I just got this same comment in the Linux kernel source. Linux kernel uses GPL license that is not compatible with Apache. Be careful to not copy code from Linux (we want to continue to be Linux-like, not a Linux license infractor). That said, in theory header files symbols are not subject to GPL according to RMS: https://linux.slashdot.org/story/11/03/20/1529238/rms-on-header-files-and-derivative-works

But never, ever, ever, look the Linux kernel source code and write a NuttX source code, otherwise you are creating derivative code :-).

In order to support the compilation of third-party library, we encounter
some situations where the macro is not defined, refer to the common
implementation of other systems and add relevant definitions.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
@acassis acassis merged commit 6efeec7 into apache:master Jul 8, 2023
26 checks passed
@zhhyu7 zhhyu7 deleted the upstream-11 branch September 19, 2023 06:12
@jerpelea jerpelea added this to To-Add in Release Notes - 12.3.0 Sep 26, 2023
@jerpelea jerpelea moved this from To-Add to net in Release Notes - 12.3.0 Sep 27, 2023
@jerpelea jerpelea moved this from net to done in Release Notes - 12.3.0 Oct 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants