mbox series

[net-next,v1,0/8] netfilter: header compilation fixes

Message ID 20190807141705.4864-1-jeremy@azazel.net
Headers show
Series netfilter: header compilation fixes | expand

Message

Jeremy Sowden Aug. 7, 2019, 2:16 p.m. UTC
A number of netfilter header files are on the header-test blacklist
becuse they cannot be compiled stand-alone.   There are two main reasons
for this: missing inclusions of other headers, and missing conditionals
checking for CONFIG_* symbols.

The first six of these patches rectify these omissions, the seventh
removes some unnecessary "#ifdef __KERNEL__" checks, and the last
removes all the NF headers from the blacklist.

I've cc'ed Masahiro Yamada because the last patch removes 74 lines from
include/Kbuild and may conflict with his kbuild tree.

Jeremy Sowden (8):
  netfilter: inlined four headers files into another one.
  netfilter: added missing includes to a number of header-files.
  netfilter: added missing IS_ENABLED(CONFIG_BRIDGE_NETFILTER) checks to
    header-file.
  netfilter: added missing IS_ENABLED(CONFIG_NF_TABLES) check to
    header-file.
  netfilter: added missing IS_ENABLED(CONFIG_NF_CONNTRACK) checks to
    some header-files.
  netfilter: added missing IS_ENABLED(CONFIG_NETFILTER) checks to some
    header-files.
  netfilter: removed "#ifdef __KERNEL__" guards from some headers.
  kbuild: removed all netfilter headers from header-test blacklist.

 include/Kbuild                                |  74 ------
 include/linux/netfilter/ipset/ip_set.h        | 238 +++++++++++++++++-
 .../linux/netfilter/ipset/ip_set_comment.h    |  73 ------
 .../linux/netfilter/ipset/ip_set_counter.h    |  84 -------
 .../linux/netfilter/ipset/ip_set_getport.h    |   4 +
 .../linux/netfilter/ipset/ip_set_skbinfo.h    |  42 ----
 .../linux/netfilter/ipset/ip_set_timeout.h    |  77 ------
 include/linux/netfilter/nf_conntrack_amanda.h |   4 +
 include/linux/netfilter/nf_conntrack_dccp.h   |   3 -
 include/linux/netfilter/nf_conntrack_ftp.h    |   8 +-
 include/linux/netfilter/nf_conntrack_h323.h   |  11 +-
 .../linux/netfilter/nf_conntrack_h323_asn1.h  |   2 +
 include/linux/netfilter/nf_conntrack_irc.h    |   5 +-
 include/linux/netfilter/nf_conntrack_pptp.h   |  12 +-
 .../linux/netfilter/nf_conntrack_proto_gre.h  |   2 -
 include/linux/netfilter/nf_conntrack_sane.h   |   4 -
 include/linux/netfilter/nf_conntrack_sip.h    |   6 +-
 include/linux/netfilter/nf_conntrack_snmp.h   |   3 +
 include/linux/netfilter/nf_conntrack_tftp.h   |   5 +
 include/linux/netfilter/x_tables.h            |   6 +
 include/linux/netfilter_arp/arp_tables.h      |   2 +
 include/linux/netfilter_bridge/ebtables.h     |   2 +
 include/linux/netfilter_ipv4/ip_tables.h      |   4 +
 include/linux/netfilter_ipv6/ip6_tables.h     |   2 +
 include/net/netfilter/br_netfilter.h          |  12 +
 include/net/netfilter/ipv4/nf_dup_ipv4.h      |   3 +
 include/net/netfilter/ipv6/nf_defrag_ipv6.h   |   4 +-
 include/net/netfilter/ipv6/nf_dup_ipv6.h      |   2 +
 include/net/netfilter/nf_conntrack.h          |  10 +
 include/net/netfilter/nf_conntrack_acct.h     |  13 +
 include/net/netfilter/nf_conntrack_bridge.h   |   6 +
 include/net/netfilter/nf_conntrack_core.h     |   3 +
 include/net/netfilter/nf_conntrack_count.h    |   3 +
 include/net/netfilter/nf_conntrack_l4proto.h  |   4 +
 .../net/netfilter/nf_conntrack_timestamp.h    |   6 +
 include/net/netfilter/nf_conntrack_tuple.h    |   2 +
 include/net/netfilter/nf_dup_netdev.h         |   2 +
 include/net/netfilter/nf_flow_table.h         |   5 +
 include/net/netfilter/nf_nat.h                |   4 +
 include/net/netfilter/nf_nat_helper.h         |   4 +-
 include/net/netfilter/nf_nat_redirect.h       |   3 +
 include/net/netfilter/nf_queue.h              |   7 +
 include/net/netfilter/nf_reject.h             |   3 +
 include/net/netfilter/nf_synproxy.h           |   4 +
 include/net/netfilter/nf_tables.h             |  12 +
 include/net/netfilter/nf_tables_ipv6.h        |   1 +
 include/net/netfilter/nft_fib.h               |   2 +
 include/net/netfilter/nft_meta.h              |   2 +
 include/net/netfilter/nft_reject.h            |   5 +
 include/uapi/linux/netfilter/xt_policy.h      |   1 +
 net/netfilter/ipset/ip_set_hash_gen.h         |   2 +-
 net/netfilter/xt_set.c                        |   1 -
 52 files changed, 409 insertions(+), 390 deletions(-)
 delete mode 100644 include/linux/netfilter/ipset/ip_set_comment.h
 delete mode 100644 include/linux/netfilter/ipset/ip_set_counter.h
 delete mode 100644 include/linux/netfilter/ipset/ip_set_skbinfo.h
 delete mode 100644 include/linux/netfilter/ipset/ip_set_timeout.h

Comments

Pablo Neira Ayuso Aug. 13, 2019, 9:55 a.m. UTC | #1
On Wed, Aug 07, 2019 at 03:16:57PM +0100, Jeremy Sowden wrote:
> A number of netfilter header files are on the header-test blacklist
> becuse they cannot be compiled stand-alone.   There are two main reasons
> for this: missing inclusions of other headers, and missing conditionals
> checking for CONFIG_* symbols.
> 
> The first six of these patches rectify these omissions, the seventh
> removes some unnecessary "#ifdef __KERNEL__" checks, and the last
> removes all the NF headers from the blacklist.
> 
> I've cc'ed Masahiro Yamada because the last patch removes 74 lines from
> include/Kbuild and may conflict with his kbuild tree.

Series applied, one comment below.

> Jeremy Sowden (8):
>   netfilter: inlined four headers files into another one.
>   netfilter: added missing includes to a number of header-files.
>   netfilter: added missing IS_ENABLED(CONFIG_BRIDGE_NETFILTER) checks to
>     header-file.
>   netfilter: added missing IS_ENABLED(CONFIG_NF_TABLES) check to
>     header-file.
>   netfilter: added missing IS_ENABLED(CONFIG_NF_CONNTRACK) checks to
>     some header-files.
>   netfilter: added missing IS_ENABLED(CONFIG_NETFILTER) checks to some
>     header-files.
>   netfilter: removed "#ifdef __KERNEL__" guards from some headers.
>   kbuild: removed all netfilter headers from header-test blacklist.

Would you mind if - before pushing this out - I do this string
replacement for the patch subject?

s/added/add
s/removed/remove
s/inlined/inline

I was told present tense is preferred for description. Otherwise, I'll
leave them as is.

Thanks.
Jeremy Sowden Aug. 13, 2019, 10:04 a.m. UTC | #2
On 2019-08-13, at 11:55:29 +0200, Pablo Neira Ayuso wrote:
> On Wed, Aug 07, 2019 at 03:16:57PM +0100, Jeremy Sowden wrote:
> > A number of netfilter header files are on the header-test blacklist
> > becuse they cannot be compiled stand-alone.   There are two main
> > reasons for this: missing inclusions of other headers, and missing
> > conditionals checking for CONFIG_* symbols.
> >
> > The first six of these patches rectify these omissions, the seventh
> > removes some unnecessary "#ifdef __KERNEL__" checks, and the last
> > removes all the NF headers from the blacklist.
> >
> > I've cc'ed Masahiro Yamada because the last patch removes 74 lines
> > from include/Kbuild and may conflict with his kbuild tree.
>
> Series applied, one comment below.
>
> > Jeremy Sowden (8):
> >   netfilter: inlined four headers files into another one.
> >   netfilter: added missing includes to a number of header-files.
> >   netfilter: added missing IS_ENABLED(CONFIG_BRIDGE_NETFILTER) checks to
> >     header-file.
> >   netfilter: added missing IS_ENABLED(CONFIG_NF_TABLES) check to
> >     header-file.
> >   netfilter: added missing IS_ENABLED(CONFIG_NF_CONNTRACK) checks to
> >     some header-files.
> >   netfilter: added missing IS_ENABLED(CONFIG_NETFILTER) checks to some
> >     header-files.
> >   netfilter: removed "#ifdef __KERNEL__" guards from some headers.
> >   kbuild: removed all netfilter headers from header-test blacklist.
>
> Would you mind if - before pushing this out - I do this string
> replacement for the patch subject?
>
> s/added/add
> s/removed/remove
> s/inlined/inline
>
> I was told present tense is preferred for description. Otherwise, I'll
> leave them as is.

I adopted past tenses because at the point at which one is reading the
description of a commit, one is usually reading about old behaviour and
what has been done to change it.  However, I wasn't aware that there was
a preference and I am happy to switch to the present tense instead, so
by all means feel free to change them.

J.
Pablo Neira Ayuso Aug. 13, 2019, 10:14 a.m. UTC | #3
On Tue, Aug 13, 2019 at 11:04:24AM +0100, Jeremy Sowden wrote:
> On 2019-08-13, at 11:55:29 +0200, Pablo Neira Ayuso wrote:
> > On Wed, Aug 07, 2019 at 03:16:57PM +0100, Jeremy Sowden wrote:
> > > A number of netfilter header files are on the header-test blacklist
> > > becuse they cannot be compiled stand-alone.   There are two main
> > > reasons for this: missing inclusions of other headers, and missing
> > > conditionals checking for CONFIG_* symbols.
> > >
> > > The first six of these patches rectify these omissions, the seventh
> > > removes some unnecessary "#ifdef __KERNEL__" checks, and the last
> > > removes all the NF headers from the blacklist.
> > >
> > > I've cc'ed Masahiro Yamada because the last patch removes 74 lines
> > > from include/Kbuild and may conflict with his kbuild tree.
> >
> > Series applied, one comment below.
> >
> > > Jeremy Sowden (8):
> > >   netfilter: inlined four headers files into another one.
> > >   netfilter: added missing includes to a number of header-files.
> > >   netfilter: added missing IS_ENABLED(CONFIG_BRIDGE_NETFILTER) checks to
> > >     header-file.
> > >   netfilter: added missing IS_ENABLED(CONFIG_NF_TABLES) check to
> > >     header-file.
> > >   netfilter: added missing IS_ENABLED(CONFIG_NF_CONNTRACK) checks to
> > >     some header-files.
> > >   netfilter: added missing IS_ENABLED(CONFIG_NETFILTER) checks to some
> > >     header-files.
> > >   netfilter: removed "#ifdef __KERNEL__" guards from some headers.
> > >   kbuild: removed all netfilter headers from header-test blacklist.
> >
> > Would you mind if - before pushing this out - I do this string
> > replacement for the patch subject?
> >
> > s/added/add
> > s/removed/remove
> > s/inlined/inline
> >
> > I was told present tense is preferred for description. Otherwise, I'll
> > leave them as is.
> 
> I adopted past tenses because at the point at which one is reading the
> description of a commit, one is usually reading about old behaviour and
> what has been done to change it.  However, I wasn't aware that there was
> a preference and I am happy to switch to the present tense instead, so
> by all means feel free to change them.

This is not in the Documentation tree, or I could not find this in a
quick git grep:

https://kernelnewbies.org/PatchPhilosophy

"In patch descriptions and in the subject, it is common and preferable
to use present-tense, imperative language. Write as if you are telling
git what to do with your patch."

I remember though that maintainers have been asking for this in the
past.

Thanks!
Jeremy Sowden Aug. 13, 2019, 11:36 a.m. UTC | #4
On 2019-08-13, at 12:14:03 +0200, Pablo Neira Ayuso wrote:
> On Tue, Aug 13, 2019 at 11:04:24AM +0100, Jeremy Sowden wrote:
> > On 2019-08-13, at 11:55:29 +0200, Pablo Neira Ayuso wrote:
> > > Would you mind if - before pushing this out - I do this string
> > > replacement for the patch subject?
> > >
> > > s/added/add
> > > s/removed/remove
> > > s/inlined/inline
> > >
> > > I was told present tense is preferred for description. Otherwise, I'll
> > > leave them as is.
> >
> > I adopted past tenses because at the point at which one is reading
> > the description of a commit, one is usually reading about old
> > behaviour and what has been done to change it.  However, I wasn't
> > aware that there was a preference and I am happy to switch to the
> > present tense instead, so by all means feel free to change them.
>
> This is not in the Documentation tree, or I could not find this in a
> quick git grep:
>
> https://kernelnewbies.org/PatchPhilosophy
>
> "In patch descriptions and in the subject, it is common and preferable
> to use present-tense, imperative language. Write as if you are telling
> git what to do with your patch."
>
> I remember though that maintainers have been asking for this in the
> past.

Thanks for the pointer.

J.