Skip to content

De-duplicate code here and there

Phil Sutter netfilter-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest7 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7xshared: Share make_delete_mask() between ip{,6}tablesiptables/ip6tables.c iptables/iptables.c iptables/xshared.c +1 more+42 -720 replies
2/7nft-shared: Introduce port_match_single_to_range()iptables/nft-shared.c+37 -930 replies
3/7extensions: libip*t_LOG: Merge extensionsextensions/libipt_LOG.c extensions/libxt_LOG.c+58 -3500 replies
4/7extensions: libebt_ip: Include kernel headerextensions/libebt_ip.c include/linux/netfilter_bridge/ebt_ip.h+13 -340 replies
5/7extensions: libebt_arp, libebt_ip: Use xtables_ipparse_any()extensions/libebt_arp.c extensions/libebt_arp.t extensions/libebt_ip.c+21 -1570 replies
6/7extensions: Collate ICMP types/codes in libxt_icmp.hextensions/libebt_ip.c extensions/libebt_ip6.c extensions/libip6t_icmp6.c +2 more+107 -2060 replies
7/7extensions: Unify ICMP parser into libxt_icmp.hextensions/libebt_ip.c extensions/libebt_ip6.c extensions/libip6t_icmp6.c +2 more+131 -2600 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [iptables PATCH 0/7] De-duplicate code here and there

A series of unrelated patches reducing code size in different ways:

Patch 1 is a typical "move function to xshared.c for common use", patch 2 eliminates some c'n'p programming in nft-shared.c, patch 3 merges libipt_LOG.c and libip6t_LOG.c, patch 4 removes code from libebt_ip.c by including the right header, patch 5 drops some local IP address parsers in favor of the respective libxtables function and patches 6 and 7 move duplicate definitions and code into a header shared by multiple extensions.

Phil Sutter (7):
xshared: Share make_delete_mask() between ip{,6}tables
nft-shared: Introduce port_match_single_to_range()
extensions: libip*t_LOG: Merge extensions
extensions: libebt_ip: Include kernel header
extensions: libebt_arp, libebt_ip: Use xtables_ipparse_any()
extensions: Collate ICMP types/codes in libxt_icmp.h
extensions: Unify ICMP parser into libxt_icmp.h

 extensions/libebt_arp.c                   |  89 +-------
 extensions/libebt_arp.t                   |   3 +
 extensions/libebt_ip.c                    | 262 ++--------------------
 extensions/libebt_ip6.c                   | 111 +--------
 extensions/libip6t_icmp6.c                |  97 +-------
 extensions/libipt_LOG.c                   | 250 ---------------------
 extensions/libipt_icmp.c                  | 110 +--------
 extensions/{libip6t_LOG.c => libxt_LOG.c} | 158 +++++--------
 extensions/libxt_icmp.h                   | 242 +++++++++++++++++++-
 include/linux/netfilter_bridge/ebt_ip.h   |  15 +-
 iptables/ip6tables.c                      |  38 +---
 iptables/iptables.c                       |  38 +---
 iptables/nft-shared.c                     | 130 +++--------
 iptables/xshared.c                        |  34 +++
 iptables/xshared.h                        |   4 +
 15 files changed, 409 insertions(+), 1172 deletions(-)
 delete mode 100644 extensions/libipt_LOG.c
 rename extensions/{libip6t_LOG.c => libxt_LOG.c} (52%)
Signature · 1 line
2.38.0