38 Commits

Author SHA1 Message Date
HuangHaitao e4107a428d upgrade iptables to 1.8.11
Signed-off-by: HuangHaitao <huanghaitao16@huawei.com>
2025-07-03 01:20:09 +08:00
maosiping d0aaba08cd update to 1.8.7-5.oe2203
Signed-off-by: maosiping <maosiping@huawei.com>
Signed-off-by: liyufan <liyufan5@huawei.com>
Signed-off-by: maosiping <maosiping@huawei.com>
2023-04-21 09:29:01 +08:00
Phil Sutter 341279e090 libiptc: Extend struct xtc_ops
Add a few more callbacks used by iptables-save.

Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Florian Westphal <fw@strlen.de>
2018-11-13 12:12:47 +01:00
Felix Janda 0bb1859e2d include: remove libc5 support code
Current code makes the assumption that !defined(__GLIBC__) means libc5
which is very unlikely the case nowadays.

Fixes compile error because of conflict between kernel and musl headers.

Signed-off-by: Florian Westphal <fw@strlen.de>
2015-05-08 16:02:56 +02:00
Pablo Neira Ayuso cccfff9309 libip6t_NETMAP: Use xtables_ip6mask_to_cidr and get rid of libip6tc dependency
This patch changes the NETMAP target extension (IPv6 side) to use
the xtables_ip6mask_to_cidr available in libxtables.

As a side effect, we get rid of the libip6tc dependency.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2013-03-29 16:41:32 +01:00
Pablo Neira Ayuso 7c1b69b975 Revert "libiptc: Returns the position the entry was inserted"
This reverts commit d65702c5c5.

This is breaking my iptables scripts:

iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables: Incompatible with this kernel.
2012-03-01 00:27:50 +01:00
Jonh Wendell d65702c5c5 libiptc: Returns the position the entry was inserted
Jan Engelhardt showed no objections to this patch.
2012-02-29 13:48:00 +01:00
Jan Engelhardt de4d2d3b71 libiptc: use a family-invariant xtc_ops struct for code reduction
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
2011-09-11 17:31:35 +02:00
Jan Engelhardt 14da56743c src: resolve old macro names that are indirections
Command used:

	git grep -f <(pcregrep -hior
	'(?<=#define\s)IP6?(T_\w+)(?=\s+X\1)' include/)

and then fix all occurrences.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
2011-09-11 17:31:35 +02:00
Jan Engelhardt 1639fe8657 libiptc: combine common types: _handle
No real API/ABI change incurred, since the definition of the structs'
types is not visible anyhow.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
2011-09-11 17:31:35 +02:00
Jan Engelhardt 7e5e866a36 libiptc: replace ipt_chainlabel by xt_chainlabel
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
2011-09-11 17:31:34 +02:00
Jan Engelhardt 2325c0fedf libiptc: combine common types
Make an xt_chainlabel type out of ipt_chainlabel and ip6t_chainlabel,
and add backward-API #defines. The ABI naturally does not change
either, so no soversion bump.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
2011-09-11 17:31:34 +02:00
Jan Engelhardt dcd1ad8910 src: replace old IP*T_ALIGN macros
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
2011-05-12 12:09:13 +02:00
Stefan Tomanek d59b9db031 iptables: add -C to check for existing rules
It is often useful to check whether a specific rule is already present
in a chain without actually modifying the iptables config.

Services like fail2ban usually employ techniques like grepping through
the output of "iptables -L" which is quite error prone.

This patch adds a new operation -C to the iptables command which
mostly works like -D; it can detect and indicate the existence of the
specified rule by modifying the exit code. The new operation
TC_CHECK_ENTRY uses the same code as the -D operation, whose functions
got a dry-run parameter appended.

Signed-off-by: Stefan Tomanek <stefan.tomanek@wertarbyte.de>
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
2011-03-08 23:12:05 +01:00
Jan Engelhardt 4e41854423 extensions: add missing limits.h include
Thanks to Stephen Hemminger for noticing.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
2009-02-21 15:44:19 +01:00
Jan Engelhardt 1c9015b2cb libiptc: remove indirections
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
2008-11-10 17:00:41 +01:00
Jan Engelhardt fd1873110f libiptc: remove typedef indirection
Don't you hate it when iptc_handle_t *x actually is a double-indirection
struct iptc_handle **? This also shows the broken constness model, since
"const iptc_handle_t x" = "iptc_handle_t const x" =
"struct iptc_handle *const x", which is like no const at all.
Lots of things to do then.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
2008-11-10 16:59:27 +01:00
Jan Engelhardt ef18e81479 src: remove dependency on libiptc headers
xtables.h does not need really need libxtc.h, and we can drop it from
the install as it is internal-only.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
2008-08-04 12:47:48 +02:00
Jan Engelhardt 33690a1aec Fix all remaining warnings (missing declarations, missing prototypes) 2008-04-13 07:17:58 +02:00
Max Kellermann 9ee386a1b6 fix gcc warnings
Max Kellermann <max@duempel.org>
2008-01-29 13:48:05 +00:00
Jan Engelhardt 5e9eaed23d use <linux/types.h>
Remove our own definitions of the Linux types and use <linux/types.h>
instead. libiptc needs it too, or otherwise will choke on union
nf_inet_addr.

Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de>
2007-12-17 13:12:01 +00:00
Yasuyuki KOZAKAI 0d502bcdbc Introduces xtables match/target registration
- moves lib_dir to xtables.c
- introduces struct pfinfo which has protocol family dependent infomations.
- unifies load_ip[6]tables_ko() and moves them as load_xtables_ko()
- introduces xt_{match,match_rule,target,tryload} and replaces
  ip[6]t_* with them
- unifies following functions and move them to xtables.c
        - find_{match,find_target}
        - compatible_revision, compatible_{match,target}_revision
- introduces xtables_register_{match,target} and make
  register_{match,target}[6] call them. xtables_register_* register ONLY
  matches/targets matched protocol family

Some concepts:
- source compatibility for libip[6]t_xxx.c with warning on compilation
  not binary compatibility.
- binary compatibility between 2.4/2.6 kernel and iptables/ip6tables,
  of cause.
- xtables is enough to support only one address family at runtime.
  Then xtables keeps infomations of only the focused address famiy
  in struct afinfo.
2007-07-24 05:52:07 +00:00
Martin Josefsson 8371e15a49 Fix the previous fix
No more segfaults or compilewarnings.
2003-05-05 19:33:40 +00:00
Martin Josefsson 841e4aed23 fix memory leak(s) in libiptc. Reverts the previous (wrong) patch. (Martin Josefsson) 2003-05-02 15:30:11 +00:00
Andreas Herrmann 0de3243515 fix IP6T_MIN_ALIGN macro (Andreas Herrmann) 2002-02-25 09:00:36 +00:00
Harald Welte b516647672 pkttype match (new) + scorefile,
libiptc C++ compatibility + scorefile
2001-04-19 16:35:39 +00:00
Harald Welte 0fbf055c9e libiptc counter functions 2001-01-05 15:22:37 +00:00
Rusty Russell 8946325322 Added <linux/in6.h> for libc5. 2000-11-06 09:26:52 +00:00
Rusty Russell 5eed48af25 Philip Blundell's IPv6 patches. 2000-06-02 20:12:24 +00:00
Philip Blundell 8c700900e2 Philip Blundell's IPv6 fixes. 2000-05-15 02:17:52 +00:00
Philip Blundell 88eb835ad2 Philip Blundell's IPv6 fixes. 2000-05-10 00:25:04 +00:00
Rusty Russell 79dee0702b IPv6 enhancements. 2000-05-02 16:45:16 +00:00
Rusty Russell 228e98dd63 Alignment fixes (requires kernel patch). 2000-04-27 10:28:06 +00:00
Rusty Russell 849779c4ad More fixes and testsuite enhancements. 2000-04-23 15:51:51 +00:00
Rusty Russell edf14cf4b5 Changes to allow matching (for delete) on part of a rule, for rules which
change in the kernel (eg. ipt_limit).
2000-04-19 11:26:44 +00:00
Rusty Russell 01059cb18b Added linux/types.h for non-glibc systems. 2000-04-19 11:25:06 +00:00
James Morris 3e9316494b James Morris' limits.h patch. 2000-03-24 01:52:39 +00:00
Marc Boucher e6869a8f59 reorganized tree after kernel merge 2000-03-20 06:03:29 +00:00