Skip to content

netfilter: remove pf argument from conntrack l4 packet function

Florian Westphal netfilter-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3netfilter: conntrack: add and use nf_l4proto_log_invalidinclude/net/netfilter/nf_conntrack_l4proto.h net/ipv4/netfilter/nf_conntrack_proto_icmp.c net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c +5 more+82 -520 replies
2/3netfilter: conntrack: add and use nf_ct_l4proto_log_invalidinclude/net/netfilter/nf_conntrack_l4proto.h net/netfilter/nf_conntrack_proto.c net/netfilter/nf_conntrack_proto_dccp.c +1 more+45 -340 replies
3/3netfilter: conntrack: remove pf argument from l4 packet functionsinclude/net/netfilter/nf_conntrack_l4proto.h net/ipv4/netfilter/nf_conntrack_proto_icmp.c net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c +7 more+3 -130 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH nf-next 0/3] netfilter: remove pf argument from conntrack l4 packet function

We currently pass pf to the packet() function of the l4 trackers, but this isn't needed -- its only required for the 'log invalid' check and the l4 protocol is also available in the nf_conn entry.

This series adds helpers for logging invalid packets, similar to nf_ct_helper_log().
I added a __cold annotation, it makes gcc rearrange the callsites as they are then considered unlikely and moved away from hotpath.

After this change, packet() gets passed 5 instead of 6 arguments.

 include/net/netfilter/nf_conntrack_l4proto.h   |   21 +++++++--
 net/ipv4/netfilter/nf_conntrack_proto_icmp.c   |   19 ++++----
 net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c |   15 +++----
 net/netfilter/nf_conntrack_core.c              |    2 
 net/netfilter/nf_conntrack_proto.c             |   47 ++++++++++++++++++++++
 net/netfilter/nf_conntrack_proto_dccp.c        |   21 ++-------
 net/netfilter/nf_conntrack_proto_generic.c     |    1 
 net/netfilter/nf_conntrack_proto_gre.c         |    1 
 net/netfilter/nf_conntrack_proto_sctp.c        |    4 -
 net/netfilter/nf_conntrack_proto_tcp.c         |   53 +++++++++----------------
 net/netfilter/nf_conntrack_proto_udp.c         |   41 ++++++++-----------
 11 files changed, 128 insertions(+), 97 deletions(-)