netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH nf-next v3 00/18] Remove config option checks from netfilter headers.
@ 2019-09-13  8:13 Jeremy Sowden
  2019-09-13  8:13 ` [PATCH nf-next v3 01/18] netfilter: fix include guards Jeremy Sowden
                   ` (19 more replies)
  0 siblings, 20 replies; 23+ messages in thread
From: Jeremy Sowden @ 2019-09-13  8:13 UTC (permalink / raw)
  To: Pablo Neira Ayuso; +Cc: Netfilter Devel

In a previous patch-series [0], I removed all netfilter headers from the
blacklist of headers which could not be compiled standalone.  I did so
by fixing the specific compilation failures of the headers in the list,
usually by adding a preprocessor conditional to check whether a particu-
lar config option was enabled and disable some function definition or
struct member which depended on that option.  While this was effective,
it was not wholly satisfactory since it left a scattering of seemingly
random ifdefs throughout the headers.

0 - https://lore.kernel.org/netfilter-devel/20190813113657.GB4840@azazel.net/T/

The reason why these ad-hoc conditionals were necessary is that there
were inconsistencies in how existing checks were used to disable code
when particular options were turned off.  For example, a header A.h
might define a struct S which was only available if a particular config
option C was enabled, but A.h might be included by header B.h, which
defined a struct T with a struct S member without checking for C.  If
A.h and B.h were included in X.c, which was only compiled if C was
enabled, everything worked as expected; however, trying to compile B.h
standalone when C was disabled would result in a compilation failure.

In the previous versions of this patch-series, I attempted to provide a
more comprehensive solution by identifying the config options relevant
to each header and adding the appropriate conditionals to it where they
do not already exist.  However, based on feedback and looking at some
other examples, it became apparent that a better approach was to
endeavour to fix the inconsistencies that made the new config checks
necessary, with a view to removing as many of them as possible.

Changes since v2:

  * squashed several of the earlier patches;
  * dropped the SPDX patch;
  * dropped most of the later patches adding config checks;
  * added a patch fixing the paramter type of a stub function.
  * added a number of new patches removing config checks.

Changes since v1:

  * fixes for build errors reported by the kbuild test robot;
  * corrected placement of new NF_TPROXY config option.

Jeremy Sowden (18):
  netfilter: fix include guards.
  netfilter: fix coding-style errors.
  netfilter: remove unused function declarations.
  netfilter: inline three headers.
  netfilter: update include directives.
  netfilter: remove nf_conntrack_icmpv6.h header.
  netfilter: move inline function to a more appropriate header.
  netfilter: move code between synproxy headers.
  netfilter: move struct definition function to a more appropriate
    header.
  netfilter: use consistent style when defining inline functions in
    nf_conntrack_ecache.h.
  netfilter: replace defined(CONFIG...) || defined(CONFIG...MODULE) with
    IS_ENABLED(CONFIG...).
  netfilter: wrap two inline functions in config checks.
  netfilter: update stub br_nf_pre_routing_ipv6 parameter to `void
    *priv`.
  netfilter: move nf_conntrack code to linux/nf_conntrack_common.h.
  netfilter: remove CONFIG_NF_CONNTRACK check from nf_conntrack_acct.h.
  netfilter: remove CONFIG_NETFILTER checks from headers.
  netfilter: remove CONFIG_NF_CONNTRACK checks from
    nf_conntrack_zones.h.
  netfilter: remove two unused functions from nf_conntrack_timestamp.h.

 include/linux/netfilter.h                     |  4 +-
 .../linux/netfilter/ipset/ip_set_getport.h    |  2 +-
 include/linux/netfilter/nf_conntrack_common.h | 20 +++++
 include/linux/netfilter/x_tables.h            |  8 +-
 include/linux/netfilter/xt_hashlimit.h        | 11 ---
 include/linux/netfilter/xt_physdev.h          |  8 --
 include/linux/netfilter_arp/arp_tables.h      |  2 -
 include/linux/netfilter_bridge.h              |  7 ++
 include/linux/netfilter_bridge/ebt_802_3.h    | 12 ---
 include/linux/netfilter_bridge/ebtables.h     |  3 +-
 include/linux/netfilter_ipv4/ip_tables.h      |  9 +-
 include/linux/netfilter_ipv6.h                | 28 +++++--
 include/linux/netfilter_ipv6/ip6_tables.h     | 20 +----
 include/linux/skbuff.h                        | 32 ++++---
 include/net/netfilter/br_netfilter.h          |  4 +-
 .../net/netfilter/ipv6/nf_conntrack_icmpv6.h  | 21 -----
 include/net/netfilter/nf_conntrack.h          | 25 ++----
 include/net/netfilter/nf_conntrack_acct.h     |  4 +-
 include/net/netfilter/nf_conntrack_bridge.h   | 11 +--
 include/net/netfilter/nf_conntrack_core.h     |  8 +-
 include/net/netfilter/nf_conntrack_ecache.h   | 84 +++++++++++--------
 include/net/netfilter/nf_conntrack_expect.h   |  2 +-
 include/net/netfilter/nf_conntrack_extend.h   |  2 +-
 include/net/netfilter/nf_conntrack_l4proto.h  | 16 ++--
 include/net/netfilter/nf_conntrack_labels.h   | 11 ++-
 include/net/netfilter/nf_conntrack_synproxy.h | 41 +--------
 include/net/netfilter/nf_conntrack_timeout.h  |  4 +
 .../net/netfilter/nf_conntrack_timestamp.h    | 16 ----
 include/net/netfilter/nf_conntrack_tuple.h    |  4 +-
 include/net/netfilter/nf_conntrack_zones.h    |  6 +-
 include/net/netfilter/nf_flow_table.h         |  6 +-
 include/net/netfilter/nf_nat.h                | 21 ++---
 include/net/netfilter/nf_nat_masquerade.h     |  1 +
 include/net/netfilter/nf_queue.h              |  4 -
 include/net/netfilter/nf_synproxy.h           | 44 +++++++++-
 include/net/netfilter/nf_tables.h             |  8 --
 net/bridge/netfilter/ebt_802_3.c              |  8 +-
 net/bridge/netfilter/nf_conntrack_bridge.c    | 15 ++--
 net/ipv4/netfilter/Kconfig                    |  8 +-
 net/ipv4/netfilter/Makefile                   |  2 +-
 net/ipv6/netfilter.c                          |  4 +-
 net/ipv6/netfilter/ip6t_ipv6header.c          |  4 +-
 net/ipv6/netfilter/nf_log_ipv6.c              |  4 +-
 net/ipv6/netfilter/nf_socket_ipv6.c           |  1 -
 net/netfilter/Kconfig                         |  8 +-
 net/netfilter/Makefile                        |  2 +-
 net/netfilter/nf_conntrack_ecache.c           |  1 +
 net/netfilter/nf_conntrack_expect.c           |  2 +
 net/netfilter/nf_conntrack_helper.c           |  5 +-
 net/netfilter/nf_conntrack_proto_icmpv6.c     |  1 -
 net/netfilter/nf_conntrack_standalone.c       |  1 -
 net/netfilter/nf_conntrack_timeout.c          |  1 +
 net/netfilter/nf_flow_table_core.c            |  1 +
 net/netfilter/nf_nat_core.c                   |  6 +-
 net/netfilter/nft_flow_offload.c              |  3 +-
 net/netfilter/xt_connlimit.c                  |  2 +
 net/netfilter/xt_hashlimit.c                  |  7 +-
 net/netfilter/xt_physdev.c                    |  5 +-
 net/sched/act_ct.c                            |  2 +-
 59 files changed, 265 insertions(+), 337 deletions(-)
 delete mode 100644 include/linux/netfilter/xt_hashlimit.h
 delete mode 100644 include/linux/netfilter/xt_physdev.h
 delete mode 100644 include/linux/netfilter_bridge/ebt_802_3.h
 delete mode 100644 include/net/netfilter/ipv6/nf_conntrack_icmpv6.h

-- 
2.23.0


^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2019-09-13 10:57 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-13  8:13 [PATCH nf-next v3 00/18] Remove config option checks from netfilter headers Jeremy Sowden
2019-09-13  8:13 ` [PATCH nf-next v3 01/18] netfilter: fix include guards Jeremy Sowden
2019-09-13  8:13 ` [PATCH nf-next v3 02/18] netfilter: fix coding-style errors Jeremy Sowden
2019-09-13  8:13 ` [PATCH nf-next v3 03/18] netfilter: remove unused function declarations Jeremy Sowden
2019-09-13  8:13 ` [PATCH nf-next v3 04/18] netfilter: inline three headers Jeremy Sowden
2019-09-13  8:13 ` [PATCH nf-next v3 05/18] netfilter: update include directives Jeremy Sowden
2019-09-13  8:13 ` [PATCH nf-next v3 06/18] netfilter: remove nf_conntrack_icmpv6.h header Jeremy Sowden
2019-09-13  8:13 ` [PATCH nf-next v3 07/18] netfilter: move inline function to a more appropriate header Jeremy Sowden
2019-09-13  8:13 ` [PATCH nf-next v3 08/18] netfilter: move code between synproxy headers Jeremy Sowden
2019-09-13  8:13 ` [PATCH nf-next v3 09/18] netfilter: move struct definition function to a more appropriate header Jeremy Sowden
2019-09-13  8:13 ` [PATCH nf-next v3 10/18] netfilter: use consistent style when defining inline functions in nf_conntrack_ecache.h Jeremy Sowden
2019-09-13  8:13 ` [PATCH nf-next v3 11/18] netfilter: replace defined(CONFIG...) || defined(CONFIG...MODULE) with IS_ENABLED(CONFIG...) Jeremy Sowden
2019-09-13  8:13 ` [PATCH nf-next v3 12/18] netfilter: wrap two inline functions in config checks Jeremy Sowden
2019-09-13  8:13 ` [PATCH nf-next v3 13/18] netfilter: update stub br_nf_pre_routing_ipv6 parameter to `void *priv` Jeremy Sowden
2019-09-13  8:13 ` [PATCH nf-next v3 14/18] netfilter: move nf_conntrack code to linux/nf_conntrack_common.h Jeremy Sowden
2019-09-13  9:27   ` Pablo Neira Ayuso
2019-09-13 10:30     ` Pablo Neira Ayuso
2019-09-13  8:13 ` [PATCH nf-next v3 15/18] netfilter: remove CONFIG_NF_CONNTRACK check from nf_conntrack_acct.h Jeremy Sowden
2019-09-13  8:13 ` [PATCH nf-next v3 16/18] netfilter: remove CONFIG_NETFILTER checks from headers Jeremy Sowden
2019-09-13  8:13 ` [PATCH nf-next v3 17/18] netfilter: remove CONFIG_NF_CONNTRACK checks from nf_conntrack_zones.h Jeremy Sowden
2019-09-13  8:13 ` [PATCH nf-next v3 18/18] netfilter: remove two unused functions from nf_conntrack_timestamp.h Jeremy Sowden
2019-09-13  9:27 ` [PATCH nf-next v3 00/18] Remove config option checks from netfilter headers Pablo Neira Ayuso
2019-09-13 10:57 ` Pablo Neira Ayuso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).