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 1/2] configure: drop leftovers from removed iptables/xtables support
Date: Mon, 30 Nov 2026 09:23:48 -0800 [thread overview]
Message-ID: <20261130172349.209692-1-stephen@networkplumber.org> (raw)
Commit 45dc10463dd5 ("remove support for iptables action") deleted
tc/m_ipt.c and tc/m_xt.c, but left a trail of build glue behind.
- check_xt_old() and check_xt_old_internal_h() probed for xtables
from before iptables 1.4.5 (2009). Nothing has consumed the
resulting TC_CONFIG_XT_OLD and TC_CONFIG_XT_OLD_H symbols since
that commit, so both tests only slowed configure down.
- include/xt-internal.h was the private header those tests looked
for. No source file includes it anymore.
- $IPTC and $IPTL in check_xt() are never assigned; they expanded to
nothing on every build.
- tc/Makefile still had rules to build m_xt.so and m_xt_old.so from
sources that no longer exist, plus install logic symlinking
m_ipt.so at whichever of them it found.
Also refresh the check_xt() comment: check_xtables() already gates on
the pkg-config module being present, so the stale version reference is
just noise.
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
next reply other threads:[~2026-11-30 17:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-30 17:23 Stephen Hemminger [this message]
2026-11-30 17:23 ` [PATCH iproute2-next 2/2] configure: remove stale ipset compat shim and unused IP_CONFIG_SETNS Stephen Hemminger
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=20261130172349.209692-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.