From patchwork Mon Nov 16 14:02:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Phil Sutter X-Patchwork-Id: 1400941 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=netfilter-devel-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=nwl.cc Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4CZW4g2gJjz9sPB for ; Tue, 17 Nov 2020 01:03:15 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728712AbgKPODF (ORCPT ); Mon, 16 Nov 2020 09:03:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40360 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726657AbgKPODE (ORCPT ); Mon, 16 Nov 2020 09:03:04 -0500 Received: from orbyte.nwl.cc (orbyte.nwl.cc [IPv6:2001:41d0:e:133a::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 73EE5C0613CF for ; Mon, 16 Nov 2020 06:03:04 -0800 (PST) Received: from localhost ([::1]:51046 helo=tatos) by orbyte.nwl.cc with esmtp (Exim 4.94) (envelope-from ) id 1kef5y-0001Rq-UV; Mon, 16 Nov 2020 15:03:03 +0100 From: Phil Sutter To: Pablo Neira Ayuso Cc: netfilter-devel@vger.kernel.org Subject: [iptables PATCH 0/3] Merge some common code Date: Mon, 16 Nov 2020 15:02:35 +0100 Message-Id: <20201116140238.25955-1-phil@nwl.cc> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org This is basically fallout from an upcoming larger code merge around arptables: Patch 1 extends MAC address parsing capabilities of libxtables so the various implementations in extensions and xtables code may be dropped. Patch 2 is a requirement for patch 3 but rather large: It changes the code to not use arptables-specific inv-flags (ARPT_INV_*) anymore as they clash badly with iptables-ones (IPT_INV_*). Patch 3 merges the three copies of 'commands_v_options' table along with generic_opt_check() routine as well as 'optflags' array and opt2char() routine. Both are extended to work for arptables as well. Phil Sutter (3): libxtables: Extend MAC address printing/parsing support xtables-arp: Don't use ARPT_INV_* xshared: Merge some command option-related code extensions/libarpt_mangle.c | 13 +-- extensions/libebt_arp.c | 50 +--------- extensions/libebt_stp.c | 60 ++---------- extensions/libxt_mac.c | 15 +-- include/xtables.h | 3 + iptables/ip6tables.c | 79 ---------------- iptables/iptables.c | 80 ---------------- iptables/nft-arp.c | 92 +++++++------------ iptables/nft-arp.h | 7 ++ iptables/nft-bridge.c | 37 +------- .../ipt-save/dumps/ipt-save-filter.txt | 4 +- iptables/xshared.c | 74 +++++++++++++++ iptables/xshared.h | 20 ++-- iptables/xtables-arp.c | 86 +++-------------- iptables/xtables-eb-translate.c | 8 +- iptables/xtables-eb.c | 59 ++---------- iptables/xtables.c | 80 ---------------- libxtables/xtables.c | 73 +++++++++++++++ 18 files changed, 248 insertions(+), 592 deletions(-)