All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: netdev@vger.kernel.org
Cc: dsahern@kernel.org, jhs@mojatatu.com,
	Stephen Hemminger <stephen@networkplumber.org>
Subject: [PATCH iproute2-next v2 1/3] configure: drop leftovers from removed iptables action
Date: Mon, 30 Nov 2026 09:57:03 -0800	[thread overview]
Message-ID: <20261130175706.336492-1-stephen@networkplumber.org> (raw)

Commit 45dc10463dd5 ("remove support for iptables action") deleted
tc/m_ipt.c and tc/m_xt.c but left the build glue for them behind.

check_xt_old() and check_xt_old_internal_h() probed for xtables older
than iptables 1.4.5 (2009); nothing has read TC_CONFIG_XT_OLD or
TC_CONFIG_XT_OLD_H since. include/xt-internal.h was the private header
they looked for and is now unused. $IPTC and $IPTL in check_xt() were
never assigned. tc/Makefile still had rules to build m_xt.so and
m_xt_old.so from the deleted sources.

No change to the generated config.mk.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 configure             | 74 ++-----------------------------------------
 include/xt-internal.h | 67 ---------------------------------------
 tc/Makefile           | 13 --------
 3 files changed, 2 insertions(+), 152 deletions(-)
 delete mode 100644 include/xt-internal.h

diff --git a/configure b/configure
index 4e68dd44..d81a6a81 100755
--- a/configure
+++ b/configure
@@ -35,7 +35,7 @@ check_xtables()
 
 check_xt()
 {
-    #check if we have xtables from iptables >= 1.4.5.
+    #check that the xtables library is usable
     cat >$TMPDIR/ipttest.c <<EOF
 #include <xtables.h>
 #include <linux/netfilter.h>
@@ -55,7 +55,7 @@ int main(int argc, char **argv)
 }
 EOF
 
-    if $CC -I$INCLUDE $IPTC -o $TMPDIR/ipttest $TMPDIR/ipttest.c $IPTL \
+    if $CC -I$INCLUDE -o $TMPDIR/ipttest $TMPDIR/ipttest.c \
 	$(${PKG_CONFIG} xtables --cflags --libs) -ldl >/dev/null 2>&1; then
 	echo "TC_CONFIG_XT:=y" >>$CONFIG
 	echo "using xtables"
@@ -63,74 +63,6 @@ EOF
     rm -f $TMPDIR/ipttest.c $TMPDIR/ipttest
 }
 
-check_xt_old()
-{
-    # bail if previous XT checks has already succeeded.
-    grep -q TC_CONFIG_XT $CONFIG && return
-
-    #check if we don't need our internal header ..
-    cat >$TMPDIR/ipttest.c <<EOF
-#include <xtables.h>
-char *lib_dir;
-unsigned int global_option_offset = 0;
-const char *program_version = XTABLES_VERSION;
-const char *program_name = "tc-ipt";
-struct afinfo afinfo = {
-	.libprefix      = "libxt_",
-};
-
-void exit_error(enum exittype status, const char *msg, ...)
-{
-}
-
-int main(int argc, char **argv) {
-
-	return 0;
-}
-
-EOF
-
-    if $CC -I$INCLUDE $IPTC -o $TMPDIR/ipttest $TMPDIR/ipttest.c $IPTL -ldl >/dev/null 2>&1; then
-	echo "TC_CONFIG_XT_OLD:=y" >>$CONFIG
-	echo "using old xtables (no need for xt-internal.h)"
-    fi
-    rm -f $TMPDIR/ipttest.c $TMPDIR/ipttest
-}
-
-check_xt_old_internal_h()
-{
-    # bail if previous XT checks has already succeeded.
-    grep -q TC_CONFIG_XT $CONFIG && return
-
-    #check if we need our own internal.h
-    cat >$TMPDIR/ipttest.c <<EOF
-#include <xtables.h>
-#include "xt-internal.h"
-char *lib_dir;
-unsigned int global_option_offset = 0;
-const char *program_version = XTABLES_VERSION;
-const char *program_name = "tc-ipt";
-struct afinfo afinfo = {
-	.libprefix      = "libxt_",
-};
-
-void exit_error(enum exittype status, const char *msg, ...)
-{
-}
-
-int main(int argc, char **argv) {
-
-	return 0;
-}
-
-EOF
-	if $CC -I$INCLUDE $IPTC -o $TMPDIR/ipttest $TMPDIR/ipttest.c $IPTL -ldl >/dev/null 2>&1; then
-	    echo "using old xtables with xt-internal.h"
-	    echo "TC_CONFIG_XT_OLD_H:=y" >>$CONFIG
-	fi
-	rm -f $TMPDIR/ipttest.c $TMPDIR/ipttest
-}
-
 check_lib_dir()
 {
 	LIBDIR=$(echo $LIBDIR | sed "s|\${prefix}|$PREFIX|")
@@ -501,8 +433,6 @@ check_xtables
 if ! grep -q TC_CONFIG_NO_XT $CONFIG; then
 	echo -n " IPT	"
 	check_xt
-	check_xt_old
-	check_xt_old_internal_h
 
 	echo -n " IPSET  "
 	check_ipset
diff --git a/include/xt-internal.h b/include/xt-internal.h
deleted file mode 100644
index 07216140..00000000
--- a/include/xt-internal.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-#ifndef _XTABLES_INTERNAL_H
-#define _XTABLES_INTERNAL_H 1
-
-#ifndef XT_LIB_DIR
-#	define XT_LIB_DIR "/lib/xtables"
-#endif
-
-/* protocol family dependent information */
-struct afinfo {
-	/* protocol family */
-	int family;
-
-	/* prefix of library name (ex "libipt_" */
-	char *libprefix;
-
-	/* used by setsockopt (ex IPPROTO_IP */
-	int ipproto;
-
-	/* kernel module (ex "ip_tables" */
-	char *kmod;
-
-	/* optname to check revision support of match */
-	int so_rev_match;
-
-	/* optname to check revision support of match */
-	int so_rev_target;
-};
-
-enum xt_tryload {
-	DONT_LOAD,
-	DURING_LOAD,
-	TRY_LOAD,
-	LOAD_MUST_SUCCEED
-};
-
-struct xtables_rule_match {
-	struct xtables_rule_match *next;
-	struct xtables_match *match;
-	/* Multiple matches of the same type: the ones before
-	   the current one are completed from parsing point of view */
-	unsigned int completed;
-};
-
-extern char *lib_dir;
-
-extern void *fw_calloc(size_t count, size_t size);
-extern void *fw_malloc(size_t size);
-
-extern const char *modprobe_program;
-extern int xtables_insmod(const char *modname, const char *modprobe, int quiet);
-extern int load_xtables_ko(const char *modprobe, int quiet);
-
-/* This is decleared in ip[6]tables.c */
-extern struct afinfo afinfo;
-
-/* Keeping track of external matches and targets: linked lists.  */
-extern struct xtables_match *xtables_matches;
-extern struct xtables_target *xtables_targets;
-
-extern struct xtables_match *find_match(const char *name, enum xt_tryload,
-					struct xtables_rule_match **match);
-extern struct xtables_target *find_target(const char *name, enum xt_tryload);
-
-extern void _init(void);
-
-#endif /* _XTABLES_INTERNAL_H */
diff --git a/tc/Makefile b/tc/Makefile
index 6264a772..0e48ba38 100644
--- a/tc/Makefile
+++ b/tc/Makefile
@@ -132,24 +132,11 @@ install: all
 	for i in $(TCSO); \
 	do install -m 755 $$i $(MODDESTDIR); \
 	done
-	if [ ! -f $(MODDESTDIR)/m_ipt.so ]; then \
-	if [ -f $(MODDESTDIR)/m_xt.so ]; \
-		then ln -s m_xt.so $(MODDESTDIR)/m_ipt.so ; \
-	elif [ -f $(MODDESTDIR)/m_xt_old.so ]; \
-		then ln -s m_xt_old.so $(MODDESTDIR)/m_ipt.so ; \
-	fi; \
-	fi
 
 clean:
 	rm -f $(TCOBJ) $(TCLIB) libtc.a tc *.so emp_ematch.tab.h; \
 	rm -f emp_ematch.tab.*
 
-m_xt.so: m_xt.c
-	$(QUIET_CC)$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -shared -fpic -o m_xt.so m_xt.c $$($(PKG_CONFIG) xtables --cflags --libs)
-
-m_xt_old.so: m_xt_old.c
-	$(QUIET_CC)$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -shared -fpic -o m_xt_old.so m_xt_old.c $$($(PKG_CONFIG) xtables --cflags --libs)
-
 em_ipset.o: CFLAGS += $$($(PKG_CONFIG) xtables --cflags)
 
 em_ipt.o: CFLAGS += $$($(PKG_CONFIG) xtables --cflags)
-- 
2.53.0


             reply	other threads:[~2026-11-30 17:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-30 17:57 Stephen Hemminger [this message]
2026-11-30 17:57 ` [PATCH iproute2-next v2 2/3] configure: remove dead ipset compat block and IP_CONFIG_SETNS Stephen Hemminger
2026-11-30 17:57 ` [PATCH iproute2-next v2 3/3] configure: use pkg-config instead of hand-rolled probes Stephen Hemminger
2026-12-02 16:40 ` [PATCH iproute2-next v2 1/3] configure: drop leftovers from removed iptables action patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261130175706.336492-1-stephen@networkplumber.org \
    --to=stephen@networkplumber.org \
    --cc=dsahern@kernel.org \
    --cc=jhs@mojatatu.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.