Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package ipset for openSUSE:Factory checked in at 2023-09-29 21:12:46 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ipset (Old) and /work/SRC/openSUSE:Factory/.ipset.new.28202 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ipset" Fri Sep 29 21:12:46 2023 rev:47 rq:1114054 version:7.19 Changes: -------- --- /work/SRC/openSUSE:Factory/ipset/ipset.changes 2023-01-07 17:16:49.881123980 +0100 +++ /work/SRC/openSUSE:Factory/.ipset.new.28202/ipset.changes 2023-09-29 21:13:03.732641053 +0200 @@ -1,0 +2,6 @@ +Thu Sep 21 07:10:20 UTC 2023 - Jan Engelhardt <jeng...@inai.de> + +- Update to release 7.19 + * Add json output to list command + +------------------------------------------------------------------- Old: ---- ipset-7.17.tar.bz2 New: ---- ipset-7.19.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ipset.spec ++++++ --- /var/tmp/diff_new_pack.34MFAG/_old 2023-09-29 21:13:04.928684207 +0200 +++ /var/tmp/diff_new_pack.34MFAG/_new 2023-09-29 21:13:04.928684207 +0200 @@ -1,7 +1,7 @@ # # spec file for package ipset # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -25,7 +25,7 @@ %define ipset_build_kmp 0 %endif Name: ipset -Version: 7.17 +Version: 7.19 Release: 0 Summary: Netfilter ipset administration utility License: GPL-2.0-only ++++++ ipset-7.17.tar.bz2 -> ipset-7.19.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ipset-7.17/ChangeLog new/ipset-7.19/ChangeLog --- old/ipset-7.17/ChangeLog 2022-12-30 12:57:30.000000000 +0100 +++ new/ipset-7.19/ChangeLog 2023-09-21 08:14:18.000000000 +0200 @@ -1,3 +1,18 @@ +7.19 + - build: Fix the double-prefix in pkgconfig (Sam James) + +7.18 + - Add json output to list command (Thomas Oberhammer) + - tests: hash:ip,port.t: Replace VRRP by GRE protocol (Phil Sutter) + - tests: hash:ip,port.t: 'vrrp' is printed as 'carp' (Phil Sutter) + - tests: cidr.sh: Add ipcalc fallback (Phil Sutter) + - tests: xlate: Make test input valid (Phil Sutter) + - tests: xlate: Test built binary by default (Phil Sutter) + - xlate: Drop dead code (Phil Sutter) + - xlate: Fix for fd leak in error path (Phil Sutter) + - configure.ac: fix bashisms (Sam James) + - lib/Makefile.am: fix pkgconfig dir (Sam James) + 7.17 - Tests: When verifying comments/timeouts, make sure entries don't expire - Tests: Make sure the internal batches add the correct number of elements diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ipset-7.17/Makefile.in new/ipset-7.19/Makefile.in --- old/ipset-7.17/Makefile.in 2022-12-30 12:59:42.000000000 +0100 +++ new/ipset-7.19/Makefile.in 2023-09-21 08:15:45.000000000 +0200 @@ -365,6 +365,7 @@ HAVE_SKB_PROTOCOL = @HAVE_SKB_PROTOCOL@ HAVE_STATE_IN_XT_ACTION_PARAM = @HAVE_STATE_IN_XT_ACTION_PARAM@ HAVE_STRSCPY = @HAVE_STRSCPY@ +HAVE_STRSCPY_PAD = @HAVE_STRSCPY_PAD@ HAVE_STRUCT_XT_ACTION_PARAM = @HAVE_STRUCT_XT_ACTION_PARAM@ HAVE_SYNCHRONIZE_RCU_BH = @HAVE_SYNCHRONIZE_RCU_BH@ HAVE_SYSTEM_POWER_EFFICIENT_WQ = @HAVE_SYSTEM_POWER_EFFICIENT_WQ@ @@ -482,6 +483,7 @@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ +pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ipset-7.17/configure new/ipset-7.19/configure --- old/ipset-7.17/configure 2022-12-30 12:59:42.000000000 +0100 +++ new/ipset-7.19/configure 2023-09-21 08:15:44.000000000 +0200 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for ipset 7.17. +# Generated by GNU Autoconf 2.69 for ipset 7.19. # # Report bugs to <kad...@netfilter.org>. # @@ -594,8 +594,8 @@ # Identity of this package. PACKAGE_NAME='ipset' PACKAGE_TARNAME='ipset' -PACKAGE_VERSION='7.17' -PACKAGE_STRING='ipset 7.17' +PACKAGE_VERSION='7.19' +PACKAGE_STRING='ipset 7.19' PACKAGE_BUGREPORT='kad...@netfilter.org' PACKAGE_URL='' @@ -652,6 +652,7 @@ HAVE_SKB_PROTOCOL HAVE_LIST_FOR_EACH_ENTRY_RCU_FOUR_ARGS HAVE_SYNCHRONIZE_RCU_BH +HAVE_STRSCPY_PAD HAVE_STRSCPY HAVE_NLA_STRSCPY HAVE_LOCKDEP_NFNL_IS_HELD @@ -724,6 +725,7 @@ WITH_KBUILDDIR_TRUE WITH_KMOD_FALSE WITH_KMOD_TRUE +pkgconfigdir PKG_CONFIG_LIBDIR PKG_CONFIG_PATH PKG_CONFIG @@ -876,6 +878,7 @@ with_ltdl_include with_ltdl_lib enable_ltdl_install +with_pkgconfigdir with_kmod with_kbuild with_ksource @@ -1452,7 +1455,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures ipset 7.17 to adapt to many kinds of systems. +\`configure' configures ipset 7.19 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1523,7 +1526,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of ipset 7.17:";; + short | recursive ) echo "Configuration of ipset 7.19:";; esac cat <<\_ACEOF @@ -1563,6 +1566,8 @@ --with-included-ltdl use the GNU ltdl sources included here --with-ltdl-include=DIR use the ltdl headers installed in DIR --with-ltdl-lib=DIR use the libltdl.la installed in DIR + --with-pkgconfigdir pkg-config installation directory + ['${libdir}/pkgconfig'] --with-kmod=yes/no Build the kernel module (default: yes) --with-kbuild=PATH Path to kernel build directory --with-ksource=PATH Path to kernel source directory, if not the same as @@ -1661,7 +1666,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -ipset configure 7.17 +ipset configure 7.19 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2039,7 +2044,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by ipset $as_me 7.17, which was +It was created by ipset $as_me 7.19, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2971,7 +2976,7 @@ # Define the identity of the package. PACKAGE='ipset' - VERSION='7.17' + VERSION='7.19' cat >>confdefs.h <<_ACEOF @@ -13448,6 +13453,21 @@ fi fi + + +# Check whether --with-pkgconfigdir was given. +if test "${with_pkgconfigdir+set}" = set; then : + withval=$with_pkgconfigdir; +else + with_pkgconfigdir='${libdir}/pkgconfig' +fi + +pkgconfigdir=$with_pkgconfigdir + + + + + case "$host" in *-*-linux* | *-*-uclinux*) ;; *) as_fn_error $? "Linux systems supported exclusively!" "$LINENO" 5;; @@ -13461,7 +13481,7 @@ BUILDKMOD="yes"; fi - if test "$BUILDKMOD" == "yes"; then + if test "$BUILDKMOD" = "yes"; then WITH_KMOD_TRUE= WITH_KMOD_FALSE='#' else @@ -13534,7 +13554,7 @@ fi -if test "$BUILDKMOD" == "yes" +if test "$BUILDKMOD" = "yes" then if test "$KBUILDDIR" != "" then @@ -14701,7 +14721,7 @@ done -if test "$BUILDKMOD" == "yes" +if test "$BUILDKMOD" = "yes" then { $as_echo "$as_me:${as_lineno-$LINENO}: checking kernel source for INIT_DEFERRABLE_WORK" >&5 @@ -15518,6 +15538,21 @@ fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking kernel source for strscpy_pad() in string.h" >&5 +$as_echo_n "checking kernel source for strscpy_pad() in string.h... " >&6; } +if test -f $ksourcedir/include/linux/timer.h && \ + $GREP -q ' strscpy_pad' $ksourcedir/include/linux/string.h; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + HAVE_STRSCPY_PAD=define + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + HAVE_STRSCPY=undef + +fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking kernel source for synchronize_rcu_bh() in rcutiny.h and rcupdate.h" >&5 $as_echo_n "checking kernel source for synchronize_rcu_bh() in rcutiny.h and rcupdate.h... " >&6; } if test -f $ksourcedir/include/linux/rcupdate.h && \ @@ -18280,7 +18315,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by ipset $as_me 7.17, which was +This file was extended by ipset $as_me 7.19, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -18346,7 +18381,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -ipset config.status 7.17 +ipset config.status 7.19 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ipset-7.17/configure.ac new/ipset-7.19/configure.ac --- old/ipset-7.17/configure.ac 2022-12-30 12:57:30.000000000 +0100 +++ new/ipset-7.19/configure.ac 2023-09-21 08:14:18.000000000 +0200 @@ -1,5 +1,5 @@ dnl Boilerplate -AC_INIT([ipset], [7.17], [kad...@netfilter.org]) +AC_INIT([ipset], [7.19], [kad...@netfilter.org]) AC_CONFIG_AUX_DIR([build-aux]) AC_CANONICAL_HOST AC_CONFIG_MACRO_DIR([m4]) @@ -14,6 +14,7 @@ LTDL_INIT([nonrecursive]) PKG_PROG_PKG_CONFIG +PKG_INSTALLDIR dnl Shortcut: Linux supported alone case "$host" in @@ -27,7 +28,7 @@ [Build the kernel module (default: yes)]), [BUILDKMOD="$withval";], [BUILDKMOD="yes";]) -AM_CONDITIONAL(WITH_KMOD, test "$BUILDKMOD" == "yes") +AM_CONDITIONAL(WITH_KMOD, test "$BUILDKMOD" = "yes") dnl Additional arguments dnl Kernel build directory or source tree @@ -76,7 +77,7 @@ AC_SUBST(bashcompdir) fi -if test "$BUILDKMOD" == "yes" +if test "$BUILDKMOD" = "yes" then dnl Sigh: check kernel version dependencies if test "$KBUILDDIR" != "" @@ -204,7 +205,7 @@ dnl Checks for functions AC_CHECK_FUNCS(gethostbyname2) -if test "$BUILDKMOD" == "yes" +if test "$BUILDKMOD" = "yes" then dnl Check kernel incompatibilities... Ugly like hell @@ -752,6 +753,16 @@ else AC_MSG_RESULT(no) AC_SUBST(HAVE_STRSCPY, undef) +fi + +AC_MSG_CHECKING([kernel source for strscpy_pad() in string.h]) +if test -f $ksourcedir/include/linux/timer.h && \ + $GREP -q ' strscpy_pad' $ksourcedir/include/linux/string.h; then + AC_MSG_RESULT(yes) + AC_SUBST(HAVE_STRSCPY_PAD, define) +else + AC_MSG_RESULT(no) + AC_SUBST(HAVE_STRSCPY, undef) fi AC_MSG_CHECKING([kernel source for synchronize_rcu_bh() in rcutiny.h and rcupdate.h]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ipset-7.17/include/libipset/Makefile.in new/ipset-7.19/include/libipset/Makefile.in --- old/ipset-7.17/include/libipset/Makefile.in 2022-12-30 12:59:42.000000000 +0100 +++ new/ipset-7.19/include/libipset/Makefile.in 2023-09-21 08:15:45.000000000 +0200 @@ -246,6 +246,7 @@ HAVE_SKB_PROTOCOL = @HAVE_SKB_PROTOCOL@ HAVE_STATE_IN_XT_ACTION_PARAM = @HAVE_STATE_IN_XT_ACTION_PARAM@ HAVE_STRSCPY = @HAVE_STRSCPY@ +HAVE_STRSCPY_PAD = @HAVE_STRSCPY_PAD@ HAVE_STRUCT_XT_ACTION_PARAM = @HAVE_STRUCT_XT_ACTION_PARAM@ HAVE_SYNCHRONIZE_RCU_BH = @HAVE_SYNCHRONIZE_RCU_BH@ HAVE_SYSTEM_POWER_EFFICIENT_WQ = @HAVE_SYSTEM_POWER_EFFICIENT_WQ@ @@ -363,6 +364,7 @@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ +pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ipset-7.17/include/libipset/session.h new/ipset-7.19/include/libipset/session.h --- old/ipset-7.17/include/libipset/session.h 2022-12-30 12:57:30.000000000 +0100 +++ new/ipset-7.19/include/libipset/session.h 2023-09-21 08:14:18.000000000 +0200 @@ -98,6 +98,7 @@ IPSET_LIST_PLAIN, IPSET_LIST_SAVE, IPSET_LIST_XML, + IPSET_LIST_JSON, }; extern int ipset_session_output(struct ipset_session *session, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ipset-7.17/kernel/ChangeLog new/ipset-7.19/kernel/ChangeLog --- old/ipset-7.17/kernel/ChangeLog 2022-12-30 12:57:30.000000000 +0100 +++ new/ipset-7.19/kernel/ChangeLog 2023-09-21 08:14:18.000000000 +0200 @@ -1,3 +1,18 @@ +7.18 + - netfilter: ipset: Fix race between IPSET_CMD_CREATE and IPSET_CMD_SWAP + (reported by Kyle Zeng) + - netfilter: ipset: add the missing IP_SET_HASH_WITH_NET0 macro for + ip_set_hash_netportnet.c (Kyle Zeng) + - compatibility: handle strscpy_pad() + - netfilter: ipset: refactor deprecated strncpy (Justin Stitt) + - netfilter: ipset: remove rcu_read_lock_bh pair from ip_set_test + (Florian Westphal) + - netfilter: ipset: Replace strlcpy with strscpy (Azeem Shaikh) + - netfilter: ipset: Add schedule point in call_ad(). (Kuniyuki Iwashima) + - net: Kconfig: fix spellos (Randy Dunlap) + - netfilter: ipset: Fix overflow before widen in the bitmap_ip_create() + function. (Gavrilov Ilia) + 7.17 - netfilter: ipset: Rework long task execution when adding/deleting entries - netfilter: ipset: fix hash:net,port,net hang with /0 subnet diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ipset-7.17/kernel/include/linux/netfilter/ipset/ip_set_compat.h.in new/ipset-7.19/kernel/include/linux/netfilter/ipset/ip_set_compat.h.in --- old/ipset-7.17/kernel/include/linux/netfilter/ipset/ip_set_compat.h.in 2022-12-30 12:57:30.000000000 +0100 +++ new/ipset-7.19/kernel/include/linux/netfilter/ipset/ip_set_compat.h.in 2023-09-21 08:14:18.000000000 +0200 @@ -52,6 +52,7 @@ #@HAVE_TYPEDEF_SCTP_SCTPHDR_T@ HAVE_TYPEDEF_SCTP_SCTPHDR_T #@HAVE_TIMER_SETUP@ HAVE_TIMER_SETUP #@HAVE_STRSCPY@ HAVE_STRSCPY +#@HAVE_STRSCPY_PAD@ HAVE_STRSCPY_PAD #@HAVE_SYNCHRONIZE_RCU_BH@ HAVE_SYNCHRONIZE_RCU_BH #@HAVE_LOCKDEP_NFNL_IS_HELD@ HAVE_LOCKDEP_NFNL_IS_HELD #@HAVE_COND_RESCHED_RCU@ HAVE_COND_RESCHED_RCU @@ -514,6 +515,21 @@ } #endif +#ifndef HAVE_STRSCPY_PAD +static inline ssize_t strscpy_pad(char *dest, const char *src, size_t count) +{ + ssize_t written; + + written = strscpy(dest, src, count); + if (written < 0 || written == count - 1) + return written; + + memset(dest + written + 1, 0, count - written - 1); + + return written; +} +#endif + #ifndef HAVE_NLA_STRSCPY #define nla_strscpy nla_strlcpy #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ipset-7.17/kernel/net/netfilter/ipset/Kconfig new/ipset-7.19/kernel/net/netfilter/ipset/Kconfig --- old/ipset-7.17/kernel/net/netfilter/ipset/Kconfig 2022-12-30 12:57:30.000000000 +0100 +++ new/ipset-7.19/kernel/net/netfilter/ipset/Kconfig 2023-09-21 08:14:18.000000000 +0200 @@ -29,7 +29,7 @@ depends on IP_SET help This option adds the bitmap:ip set type support, by which one - can store IPv4 addresses (or network addresse) from a range. + can store IPv4 addresses (or network addresses) from a range. To compile it as a module, choose M here. If unsure, say N. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ipset-7.17/kernel/net/netfilter/ipset/ip_set_bitmap_ip.c new/ipset-7.19/kernel/net/netfilter/ipset/ip_set_bitmap_ip.c --- old/ipset-7.17/kernel/net/netfilter/ipset/ip_set_bitmap_ip.c 2022-12-30 12:57:30.000000000 +0100 +++ new/ipset-7.19/kernel/net/netfilter/ipset/ip_set_bitmap_ip.c 2023-09-21 08:14:18.000000000 +0200 @@ -312,8 +312,8 @@ return -IPSET_ERR_BITMAP_RANGE; pr_debug("mask_bits %u, netmask %u\n", mask_bits, netmask); - hosts = 2 << (32 - netmask - 1); - elements = 2 << (netmask - mask_bits - 1); + hosts = 2U << (32 - netmask - 1); + elements = 2UL << (netmask - mask_bits - 1); } if (elements > IPSET_BITMAP_MAX_RANGE + 1) return -IPSET_ERR_BITMAP_RANGE_SIZE; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ipset-7.17/kernel/net/netfilter/ipset/ip_set_core.c new/ipset-7.19/kernel/net/netfilter/ipset/ip_set_core.c --- old/ipset-7.17/kernel/net/netfilter/ipset/ip_set_core.c 2022-12-30 12:57:30.000000000 +0100 +++ new/ipset-7.19/kernel/net/netfilter/ipset/ip_set_core.c 2023-09-21 08:14:18.000000000 +0200 @@ -684,6 +684,14 @@ * a separate reference counter */ static void +__ip_set_get_netlink(struct ip_set *set) +{ + write_lock_bh(&ip_set_ref_lock); + set->ref_netlink++; + write_unlock_bh(&ip_set_ref_lock); +} + +static void __ip_set_put_netlink(struct ip_set *set) { write_lock_bh(&ip_set_ref_lock); @@ -740,9 +748,7 @@ !(opt->family == set->family || set->family == NFPROTO_UNSPEC)) return 0; - rcu_read_lock_bh(); ret = set->variant->kadt(set, skb, par, IPSET_TEST, opt); - rcu_read_unlock_bh(); if (ret == -EAGAIN) { /* Type requests element to be completed */ @@ -875,7 +881,7 @@ BUG_ON(!set); read_lock_bh(&ip_set_ref_lock); - strncpy(name, set->name, IPSET_MAXNAMELEN); + strscpy_pad(name, set->name, IPSET_MAXNAMELEN); read_unlock_bh(&ip_set_ref_lock); } EXPORT_SYMBOL_GPL(ip_set_name_byindex); @@ -1350,11 +1356,11 @@ goto out; } } - ret = strscpy(set->name, name2, IPSET_MAXNAMELEN); + strscpy_pad(set->name, name2, IPSET_MAXNAMELEN); out: write_unlock_bh(&ip_set_ref_lock); - return ret < 0 ? ret : 0; + return ret; } /* Swap two sets so that name/index points to the other. @@ -1408,9 +1414,9 @@ return -EBUSY; } - strncpy(from_name, from->name, IPSET_MAXNAMELEN); - strncpy(from->name, to->name, IPSET_MAXNAMELEN); - strncpy(to->name, from_name, IPSET_MAXNAMELEN); + strscpy_pad(from_name, from->name, IPSET_MAXNAMELEN); + strscpy_pad(from->name, to->name, IPSET_MAXNAMELEN); + strscpy_pad(to->name, from_name, IPSET_MAXNAMELEN); swap(from->ref, to->ref); ip_set(inst, from_id) = to; @@ -1750,6 +1756,14 @@ bool eexist = flags & IPSET_FLAG_EXIST, retried = false; do { + if (retried) { + __ip_set_get_netlink(set); + nfnl_unlock(NFNL_SUBSYS_IPSET); + cond_resched(); + nfnl_lock(NFNL_SUBSYS_IPSET); + __ip_set_put_netlink(set); + } + ip_set_lock(set); ret = set->variant->uadt(set, tb, adt, &lineno, flags, retried); ip_set_unlock(set); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ipset-7.17/kernel/net/netfilter/ipset/ip_set_hash_netiface.c new/ipset-7.19/kernel/net/netfilter/ipset/ip_set_hash_netiface.c --- old/ipset-7.17/kernel/net/netfilter/ipset/ip_set_hash_netiface.c 2022-12-30 12:57:30.000000000 +0100 +++ new/ipset-7.19/kernel/net/netfilter/ipset/ip_set_hash_netiface.c 2023-09-21 08:14:18.000000000 +0200 @@ -41,7 +41,7 @@ #define IP_SET_HASH_WITH_MULTI #define IP_SET_HASH_WITH_NET0 -#define STRLCPY(a, b) strlcpy(a, b, IFNAMSIZ) +#define STRSCPY(a, b) strscpy(a, b, IFNAMSIZ) /* IPv4 variant */ @@ -183,11 +183,11 @@ if (!eiface) return -EINVAL; - STRLCPY(e.iface, eiface); + STRSCPY(e.iface, eiface); e.physdev = 1; #endif } else { - STRLCPY(e.iface, SRCDIR ? IFACE(in) : IFACE(out)); + STRSCPY(e.iface, SRCDIR ? IFACE(in) : IFACE(out)); } if (strlen(e.iface) == 0) @@ -401,11 +401,11 @@ if (!eiface) return -EINVAL; - STRLCPY(e.iface, eiface); + STRSCPY(e.iface, eiface); e.physdev = 1; #endif } else { - STRLCPY(e.iface, SRCDIR ? IFACE(in) : IFACE(out)); + STRSCPY(e.iface, SRCDIR ? IFACE(in) : IFACE(out)); } if (strlen(e.iface) == 0) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ipset-7.17/kernel/net/netfilter/ipset/ip_set_hash_netportnet.c new/ipset-7.19/kernel/net/netfilter/ipset/ip_set_hash_netportnet.c --- old/ipset-7.17/kernel/net/netfilter/ipset/ip_set_hash_netportnet.c 2022-12-30 12:57:30.000000000 +0100 +++ new/ipset-7.19/kernel/net/netfilter/ipset/ip_set_hash_netportnet.c 2023-09-21 08:14:18.000000000 +0200 @@ -37,6 +37,7 @@ #define IP_SET_HASH_WITH_PROTO #define IP_SET_HASH_WITH_NETS #define IPSET_NET_COUNT 2 +#define IP_SET_HASH_WITH_NET0 /* IPv4 variant */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ipset-7.17/lib/Makefile.am new/ipset-7.19/lib/Makefile.am --- old/ipset-7.17/lib/Makefile.am 2022-12-30 12:57:30.000000000 +0100 +++ new/ipset-7.19/lib/Makefile.am 2023-09-21 08:14:18.000000000 +0200 @@ -46,7 +46,6 @@ EXTRA_DIST = $(IPSET_SETTYPE_LIST) libipset.map -pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libipset.pc dist_man_MANS = libipset.3 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ipset-7.17/lib/Makefile.in new/ipset-7.19/lib/Makefile.in --- old/ipset-7.17/lib/Makefile.in 2022-12-30 12:59:42.000000000 +0100 +++ new/ipset-7.19/lib/Makefile.in 2023-09-21 08:15:45.000000000 +0200 @@ -372,6 +372,7 @@ HAVE_SKB_PROTOCOL = @HAVE_SKB_PROTOCOL@ HAVE_STATE_IN_XT_ACTION_PARAM = @HAVE_STATE_IN_XT_ACTION_PARAM@ HAVE_STRSCPY = @HAVE_STRSCPY@ +HAVE_STRSCPY_PAD = @HAVE_STRSCPY_PAD@ HAVE_STRUCT_XT_ACTION_PARAM = @HAVE_STRUCT_XT_ACTION_PARAM@ HAVE_SYNCHRONIZE_RCU_BH = @HAVE_SYNCHRONIZE_RCU_BH@ HAVE_SYSTEM_POWER_EFFICIENT_WQ = @HAVE_SYSTEM_POWER_EFFICIENT_WQ@ @@ -489,6 +490,7 @@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ +pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ @@ -574,7 +576,6 @@ debug.c EXTRA_DIST = $(IPSET_SETTYPE_LIST) libipset.map -pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libipset.pc dist_man_MANS = libipset.3 all: $(BUILT_SOURCES) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ipset-7.17/lib/ipset.c new/ipset-7.19/lib/ipset.c --- old/ipset-7.17/lib/ipset.c 2022-12-30 12:57:30.000000000 +0100 +++ new/ipset-7.19/lib/ipset.c 2023-09-21 08:14:18.000000000 +0200 @@ -235,7 +235,7 @@ { .name = { "-o", "-output" }, .has_arg = IPSET_MANDATORY_ARG, .flag = IPSET_OPT_MAX, .parse = ipset_parse_output, - .help = "plain|save|xml\n" + .help = "plain|save|xml|json\n" " Specify output mode for listing sets.\n" " Default value for \"list\" command is mode \"plain\"\n" " and for \"save\" command is mode \"save\".", @@ -429,6 +429,8 @@ return ipset_session_output(session, IPSET_LIST_PLAIN); else if (STREQ(str, "xml")) return ipset_session_output(session, IPSET_LIST_XML); + else if (STREQ(str, "json")) + return ipset_session_output(session, IPSET_LIST_JSON); else if (STREQ(str, "save")) return ipset_session_output(session, IPSET_LIST_SAVE); @@ -1876,9 +1878,6 @@ cmd == IPSET_CMD_DEL ? "delete" : "get", ipset_xlate_family(family), table, set); - typename = ipset_data_get(data, IPSET_OPT_TYPENAME); - type = ipset_xlate_set_type(typename); - xlate_set = (struct ipset_xlate_set *) ipset_xlate_set_get(ipset, set); if (xlate_set && xlate_set->interval) @@ -1999,7 +1998,7 @@ ret = build_argv(ipset, c); if (ret < 0) - return ret; + break; cmd = ipset_parser(ipset, ipset->newargc, ipset->newargv); if (cmd < 0) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ipset-7.17/lib/session.c new/ipset-7.19/lib/session.c --- old/ipset-7.17/lib/session.c 2022-12-30 12:57:30.000000000 +0100 +++ new/ipset-7.19/lib/session.c 2023-09-21 08:14:18.000000000 +0200 @@ -860,6 +860,7 @@ const struct ipset_arg *arg; size_t offset = 0; int i, found = 0; + static char last_setname[IPSET_MAXNAMELEN] = ""; D("enter"); /* Check and load type, family */ @@ -894,6 +895,13 @@ case IPSET_LIST_XML: safe_snprintf(session, "<member><elem>"); break; + case IPSET_LIST_JSON: + /* print separator if a member for this set was printed before */ + if (STREQ(ipset_data_setname(data), last_setname)) + safe_snprintf(session, ","); + strcpy(last_setname, ipset_data_setname(data)); + safe_snprintf(session, "\n {\n \"elem\" : \""); + break; case IPSET_LIST_PLAIN: default: break; @@ -902,6 +910,8 @@ safe_dprintf(session, ipset_print_elem, IPSET_OPT_ELEM); if (session->mode == IPSET_LIST_XML) safe_snprintf(session, "</elem>"); + if (session->mode == IPSET_LIST_JSON) + safe_snprintf(session, "\""); for (i = 0; type->cmd[IPSET_ADD].args[i] != IPSET_ARG_NONE; i++) { arg = ipset_keyword(type->cmd[IPSET_ADD].args[i]); @@ -929,6 +939,15 @@ safe_dprintf(session, arg->print, arg->opt); safe_snprintf(session, "</%s>", arg->name[0]); break; + case IPSET_LIST_JSON: + if (arg->has_arg == IPSET_NO_ARG) { + safe_snprintf(session, + ",\n \"%s\" : true", arg->name[0]); + break; + } + safe_snprintf(session, ",\n \"%s\" : ", arg->name[0]); + safe_dprintf(session, arg->print, arg->opt); + break; default: break; } @@ -936,6 +955,8 @@ if (session->mode == IPSET_LIST_XML) safe_snprintf(session, "</member>\n"); + else if (session->mode == IPSET_LIST_JSON) + safe_snprintf(session, "\n }"); else safe_snprintf(session, "\n"); @@ -972,6 +993,7 @@ const struct ipset_arg *arg; uint8_t family; int i; + static bool firstipset = true; for (i = IPSET_ATTR_UNSPEC + 1; i <= IPSET_ATTR_CREATE_MAX; i++) if (nla[i]) { @@ -1007,6 +1029,19 @@ ipset_data_setname(data), type->name, type->revision); break; + case IPSET_LIST_JSON: + if (!firstipset) + safe_snprintf(session, ",\n"); + firstipset = false; + safe_snprintf(session, + " \{\n" + " \"name\" : \"%s\",\n" + " \"type\" : \"%s\",\n" + " \"revision\" : %u,\n" + " \"header\" : \{\n", + ipset_data_setname(data), + type->name, type->revision); + break; default: break; } @@ -1042,6 +1077,22 @@ safe_dprintf(session, arg->print, arg->opt); safe_snprintf(session, "</%s>", arg->name[0]); break; + case IPSET_LIST_JSON: + if (arg->has_arg == IPSET_NO_ARG) { + safe_snprintf(session, + " \"%s\" : true,\n", arg->name[0]); + break; + } + if (arg->opt == IPSET_OPT_FAMILY) { + safe_snprintf(session, " \"%s\" : \"", arg->name[0]); + safe_dprintf(session, arg->print, arg->opt); + safe_snprintf(session, "\",\n", arg->name[0]); + break; + } + safe_snprintf(session, " \"%s\" : ", arg->name[0]); + safe_dprintf(session, arg->print, arg->opt); + safe_snprintf(session, ",\n", arg->name[0]); + break; default: break; } @@ -1079,6 +1130,21 @@ "</header>\n" : "</header>\n<members>\n"); break; + case IPSET_LIST_JSON: + safe_snprintf(session, " \"memsize\" : "); + safe_dprintf(session, ipset_print_number, IPSET_OPT_MEMSIZE); + safe_snprintf(session, ",\n \"references\" : "); + safe_dprintf(session, ipset_print_number, IPSET_OPT_REFERENCES); + if (ipset_data_test(data, IPSET_OPT_ELEMENTS)) { + safe_snprintf(session, ",\n \"numentries\" : "); + safe_dprintf(session, ipset_print_number, IPSET_OPT_ELEMENTS); + } + safe_snprintf(session, "\n"); + safe_snprintf(session, + session->envopts & IPSET_ENV_LIST_HEADER ? + " },\n" : + " },\n \"members\" : ["); + break; default: break; } @@ -1214,11 +1280,24 @@ if (session->saved_setname[0] != '\0') safe_snprintf(session, "</members>\n</ipset>\n"); break; + case IPSET_LIST_JSON: + if (session->envopts & IPSET_ENV_LIST_SETNAME) + break; + if (session->envopts & IPSET_ENV_LIST_HEADER) { + if (session->saved_setname[0] != '\0') + safe_snprintf(session, " }"); + break; + } + if (session->saved_setname[0] != '\0') + safe_snprintf(session, "\n ]\n }"); + break; default: break; } if (callback_done && session->mode == IPSET_LIST_XML) safe_snprintf(session, "</ipsets>\n"); + if (callback_done && session->mode == IPSET_LIST_JSON) + safe_snprintf(session, "\n]\n"); return call_outfn(session) ? MNL_CB_ERROR : MNL_CB_STOP; } @@ -1245,6 +1324,9 @@ if (session->mode == IPSET_LIST_XML) safe_snprintf(session, "<ipset name=\"%s\"/>\n", ipset_data_setname(data)); + if (session->mode == IPSET_LIST_JSON) + safe_snprintf(session, "\"name\" : \"%s\"\n", + ipset_data_setname(data)); else safe_snprintf(session, "%s\n", ipset_data_setname(data)); @@ -2208,6 +2290,11 @@ session->mode == IPSET_LIST_XML) safe_snprintf(session, "<ipsets>\n"); + /* Start the root element in json mode */ + if ((cmd == IPSET_CMD_LIST || cmd == IPSET_CMD_SAVE) && + session->mode == IPSET_LIST_JSON) + safe_snprintf(session, "[\n"); + D("next: build_msg"); /* Build new message or append buffered commands */ ret = build_msg(session, aggregate); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ipset-7.17/src/Makefile.in new/ipset-7.19/src/Makefile.in --- old/ipset-7.17/src/Makefile.in 2022-12-30 12:59:42.000000000 +0100 +++ new/ipset-7.19/src/Makefile.in 2023-09-21 08:15:45.000000000 +0200 @@ -352,6 +352,7 @@ HAVE_SKB_PROTOCOL = @HAVE_SKB_PROTOCOL@ HAVE_STATE_IN_XT_ACTION_PARAM = @HAVE_STATE_IN_XT_ACTION_PARAM@ HAVE_STRSCPY = @HAVE_STRSCPY@ +HAVE_STRSCPY_PAD = @HAVE_STRSCPY_PAD@ HAVE_STRUCT_XT_ACTION_PARAM = @HAVE_STRUCT_XT_ACTION_PARAM@ HAVE_SYNCHRONIZE_RCU_BH = @HAVE_SYNCHRONIZE_RCU_BH@ HAVE_SYSTEM_POWER_EFFICIENT_WQ = @HAVE_SYSTEM_POWER_EFFICIENT_WQ@ @@ -469,6 +470,7 @@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ +pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ipset-7.17/src/ipset.8 new/ipset-7.19/src/ipset.8 --- old/ipset-7.17/src/ipset.8 2022-12-30 12:57:30.000000000 +0100 +++ new/ipset-7.19/src/ipset.8 2023-09-21 08:14:18.000000000 +0200 @@ -21,7 +21,7 @@ .PP COMMANDS := { \fBcreate\fR | \fBadd\fR | \fBdel\fR | \fBtest\fR | \fBdestroy\fR | \fBlist\fR | \fBsave\fR | \fBrestore\fR | \fBflush\fR | \fBrename\fR | \fBswap\fR | \fBhelp\fR | \fBversion\fR | \fB\-\fR } .PP -\fIOPTIONS\fR := { \fB\-exist\fR | \fB\-output\fR { \fBplain\fR | \fBsave\fR | \fBxml\fR } | \fB\-quiet\fR | \fB\-resolve\fR | \fB\-sorted\fR | \fB\-name\fR | \fB\-terse\fR | \fB\-file\fR \fIfilename\fR } +\fIOPTIONS\fR := { \fB\-exist\fR | \fB\-output\fR { \fBplain\fR | \fBsave\fR | \fBxml\fR } | \fBjson\fR } | \fB\-quiet\fR | \fB\-resolve\fR | \fB\-sorted\fR | \fB\-name\fR | \fB\-terse\fR | \fB\-file\fR \fIfilename\fR } .PP \fBipset\fR \fBcreate\fR \fISETNAME\fR \fITYPENAME\fR [ \fICREATE\-OPTIONS\fR ] .PP @@ -118,7 +118,7 @@ The option \fB\-output\fR can be used to control the format of the listing: -\fBplain\fR, \fBsave\fR or \fBxml\fR. +\fBplain\fR, \fBsave\fR, \fBxml\fR or \fBjson\fR. (The default is \fBplain\fR.) If the option @@ -187,7 +187,7 @@ Ignore errors when exactly the same set is to be created or already added entry is added or missing entry is deleted. .TP -\fB\-o\fP, \fB\-output\fP { \fBplain\fR | \fBsave\fR | \fBxml\fR } +\fB\-o\fP, \fB\-output\fP { \fBplain\fR | \fBsave\fR | \fBxml\fR | \fBjson\fR } Select the output format to the \fBlist\fR command. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ipset-7.17/src/ui.c new/ipset-7.19/src/ui.c --- old/ipset-7.17/src/ui.c 2022-12-30 12:57:30.000000000 +0100 +++ new/ipset-7.19/src/ui.c 2023-09-21 08:14:18.000000000 +0200 @@ -180,7 +180,7 @@ { .name = { "-o", "-output" }, .has_arg = IPSET_MANDATORY_ARG, .flag = IPSET_OPT_MAX, .parse = ipset_parse_output, - .help = "plain|save|xml\n" + .help = "plain|save|xml|json\n" " Specify output mode for listing sets.\n" " Default value for \"list\" command is mode \"plain\"\n" " and for \"save\" command is mode \"save\".", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ipset-7.17/tests/cidr.sh new/ipset-7.19/tests/cidr.sh --- old/ipset-7.17/tests/cidr.sh 2022-12-30 12:57:30.000000000 +0100 +++ new/ipset-7.19/tests/cidr.sh 2023-09-21 08:14:18.000000000 +0200 @@ -37,6 +37,30 @@ ipset="../src/ipset" +if which netmask >/dev/null 2>&1; then + net_first_addr() { + netmask -r $1 | cut -d - -f 1 + } + net_last_addr() { + netmask -r $1 | cut -d - -f 2 | cut -d ' ' -f 1 + } +elif which ipcalc >/dev/null 2>&1; then + net_first_addr() { + ipcalc $1 | awk '/^Address:/{print $2}' + } + net_last_addr() { + # Netmask tool prints broadcast address as last one, so + # prefer that instead of HostMax. Also fix for /31 and /32 + # being recognized as special by ipcalc. + ipcalc $1 | awk '/^(Hostroute|HostMax):/{out=$2} + /^Broadcast:/{out=$2} + END{print out}' + } +else + echo "need either netmask or ipcalc tools" + exit 1 +fi + case "$1" in net) $ipset n test hash:net @@ -46,9 +70,9 @@ done <<<"$NETS" while IFS= read x; do - first=`netmask -r $x | cut -d - -f 1` + first=`net_first_addr $x` $ipset test test $first >/dev/null 2>&1 - last=`netmask -r $x | cut -d - -f 2 | cut -d ' ' -f 1` + last=`net_last_addr $x` $ipset test test $last >/dev/null 2>&1 done <<<"$NETS" @@ -67,9 +91,9 @@ n=1 while IFS= read x; do - first=`netmask -r $x | cut -d - -f 1` + first=`net_first_addr $x` $ipset test test $first,$n >/dev/null 2>&1 - last=`netmask -r $x | cut -d - -f 2 | cut -d ' ' -f 1` + last=`net_last_addr $x` $ipset test test $last,$n >/dev/null 2>&1 n=$((n+1)) done <<<"$NETS" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ipset-7.17/tests/hash:ip,port.t new/ipset-7.19/tests/hash:ip,port.t --- old/ipset-7.17/tests/hash:ip,port.t 2022-12-30 12:57:30.000000000 +0100 +++ new/ipset-7.19/tests/hash:ip,port.t 2023-09-21 08:14:18.000000000 +0200 @@ -62,10 +62,10 @@ 0 ipset test test 2.0.0.1,tcp:80 # Test element with UDP protocol 0 ipset test test 2.0.0.1,udp:80 -# Add element with vrrp -0 ipset add test 2.0.0.1,vrrp:0 -# Test element with vrrp -0 ipset test test 2.0.0.1,vrrp:0 +# Add element with GRE +0 ipset add test 2.0.0.1,gre:0 +# Test element with GRE +0 ipset test test 2.0.0.1,gre:0 # Add element with sctp 0 ipset add test 2.0.0.1,sctp:80 # Test element with sctp diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ipset-7.17/tests/hash:ip,port.t.list2 new/ipset-7.19/tests/hash:ip,port.t.list2 --- old/ipset-7.17/tests/hash:ip,port.t.list2 2022-12-30 12:57:30.000000000 +0100 +++ new/ipset-7.19/tests/hash:ip,port.t.list2 2023-09-21 08:14:18.000000000 +0200 @@ -6,6 +6,6 @@ References: 0 Number of entries: 3 Members: +2.0.0.1,gre:0 2.0.0.1,tcp:80 2.0.0.1,udp:80 -2.0.0.1,vrrp:0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ipset-7.17/tests/xlate/ipset-translate new/ipset-7.19/tests/xlate/ipset-translate --- old/ipset-7.17/tests/xlate/ipset-translate 1970-01-01 01:00:00.000000000 +0100 +++ new/ipset-7.19/tests/xlate/ipset-translate 2023-09-29 21:13:05.360699793 +0200 @@ -0,0 +1 @@ +symbolic link to ../../src/ipset diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ipset-7.17/tests/xlate/runtest.sh new/ipset-7.19/tests/xlate/runtest.sh --- old/ipset-7.17/tests/xlate/runtest.sh 2022-12-30 12:57:30.000000000 +0100 +++ new/ipset-7.19/tests/xlate/runtest.sh 2023-09-21 08:14:18.000000000 +0200 @@ -6,14 +6,20 @@ exit 1 fi -IPSET_XLATE=$(which ipset-translate) -if [ ! -x "$IPSET_XLATE" ] ; then - echo "ERROR: ipset-translate is not installed yet" +ipset=${IPSET_BIN:-../../src/ipset} +ipset_xlate=${IPSET_XLATE_BIN:-$(dirname $0)/ipset-translate} + +$ipset restore < xlate.t +rc=$? +$ipset destroy +if [ $rc -ne 0 ] +then + echo -e "[\033[0;31mERROR\033[0m] invalid test input" exit 1 fi TMP=$(mktemp) -ipset-translate restore < xlate.t &> $TMP +$ipset_xlate restore < xlate.t &> $TMP if [ $? -ne 0 ] then cat $TMP diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ipset-7.17/tests/xlate/xlate.t new/ipset-7.19/tests/xlate/xlate.t --- old/ipset-7.17/tests/xlate/xlate.t 2022-12-30 12:57:30.000000000 +0100 +++ new/ipset-7.19/tests/xlate/xlate.t 2023-09-21 08:14:18.000000000 +0200 @@ -11,8 +11,8 @@ create hip5 hash:ip maxelem 24 add hip5 192.168.10.0 create hip6 hash:ip comment -add hip5 192.168.10.1 -add hip5 192.168.10.2 comment "this is a comment" +add hip6 192.168.10.1 +add hip6 192.168.10.2 comment "this is a comment" create ipp1 hash:ip,port add ipp1 192.168.10.1,0 add ipp1 192.168.10.2,5 @@ -23,7 +23,7 @@ add ipp3 192.168.10.3,20 packets 5 bytes 3456 create ipp4 hash:ip,port timeout 4 counters add ipp4 192.168.10.3,20 packets 5 bytes 3456 -create bip1 bitmap:ip range 2.0.0.1-2.1.0.1 timeout 5 +create bip1 bitmap:ip range 2.0.0.1-2.0.1.1 timeout 5 create bip2 bitmap:ip range 10.0.0.0/8 netmask 24 timeout 5 add bip2 10.10.10.0 add bip2 10.10.20.0 timeout 12 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ipset-7.17/tests/xlate/xlate.t.nft new/ipset-7.19/tests/xlate/xlate.t.nft --- old/ipset-7.17/tests/xlate/xlate.t.nft 2022-12-30 12:57:30.000000000 +0100 +++ new/ipset-7.19/tests/xlate/xlate.t.nft 2023-09-21 08:14:18.000000000 +0200 @@ -12,8 +12,8 @@ add set inet global hip5 { type ipv4_addr; size 24; } add element inet global hip5 { 192.168.10.0 } add set inet global hip6 { type ipv4_addr; } -add element inet global hip5 { 192.168.10.1 } -add element inet global hip5 { 192.168.10.2 comment "this is a comment" } +add element inet global hip6 { 192.168.10.1 } +add element inet global hip6 { 192.168.10.2 comment "this is a comment" } add set inet global ipp1 { type ipv4_addr . inet_proto . inet_service; } add element inet global ipp1 { 192.168.10.1 . tcp . 0 } add element inet global ipp1 { 192.168.10.2 . tcp . 5 } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ipset-7.17/utils/Makefile.in new/ipset-7.19/utils/Makefile.in --- old/ipset-7.17/utils/Makefile.in 2022-12-30 12:59:42.000000000 +0100 +++ new/ipset-7.19/utils/Makefile.in 2023-09-21 08:15:45.000000000 +0200 @@ -300,6 +300,7 @@ HAVE_SKB_PROTOCOL = @HAVE_SKB_PROTOCOL@ HAVE_STATE_IN_XT_ACTION_PARAM = @HAVE_STATE_IN_XT_ACTION_PARAM@ HAVE_STRSCPY = @HAVE_STRSCPY@ +HAVE_STRSCPY_PAD = @HAVE_STRSCPY_PAD@ HAVE_STRUCT_XT_ACTION_PARAM = @HAVE_STRUCT_XT_ACTION_PARAM@ HAVE_SYNCHRONIZE_RCU_BH = @HAVE_SYNCHRONIZE_RCU_BH@ HAVE_SYSTEM_POWER_EFFICIENT_WQ = @HAVE_SYSTEM_POWER_EFFICIENT_WQ@ @@ -417,6 +418,7 @@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ +pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ipset-7.17/utils/ipset_bash_completion/ipset new/ipset-7.19/utils/ipset_bash_completion/ipset --- old/ipset-7.17/utils/ipset_bash_completion/ipset 2022-12-30 12:57:30.000000000 +0100 +++ new/ipset-7.19/utils/ipset_bash_completion/ipset 2023-09-21 08:14:18.000000000 +0200 @@ -362,7 +362,7 @@ while read -r; do REPLY="${REPLY#*: }" printf "%s\n" ${REPLY%%:*} -done < <(PATH=${PATH}:/sbin ( command ip -o link show ) 2>/dev/null) +done < <(( PATH=${PATH}:/sbin command ip -o link show ) 2>/dev/null) } _ipset_get_iplist() { @@ -1130,9 +1130,9 @@ # make sure it's not a filename named -o or -output if [[ $str_filename != $prev ]]; then if ((names_only || headers_only)); then - COMPREPLY=( $( compgen -W 'plain xml' -- "$cur" ) ) + COMPREPLY=( $( compgen -W 'plain xml json' -- "$cur" ) ) else - COMPREPLY=( $( compgen -W 'plain save xml' -- "$cur" ) ) + COMPREPLY=( $( compgen -W 'plain save xml json' -- "$cur" ) ) fi return 0 fi