Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package libnftnl for openSUSE:Factory checked in at 2026-09-04 12:36:09 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libnftnl (Old) and /work/SRC/openSUSE:Factory/.libnftnl.new.1265 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libnftnl" Fri Sep 4 12:36:09 2026 rev:34 rq:1374971 version:1.3.2 Changes: -------- --- /work/SRC/openSUSE:Factory/libnftnl/libnftnl.changes 2025-12-05 16:51:10.686693976 +0100 +++ /work/SRC/openSUSE:Factory/.libnftnl.new.1265/libnftnl.changes 2026-09-04 12:36:39.979695357 +0200 @@ -1,0 +2,16 @@ +Mon Aug 31 19:08:06 UTC 2026 - Jan Engelhardt <[email protected]> + +- Update to release 1.3.2 + * Support for connlimit stateful objects + * Now validates geneve class and type attribute size in setter + and validates that the kernel does not provide too long geneve + data attributes. + * Do not print userdata content through snprintf API. + * Enhancements for the snprint API to display data according to + size and byteorder, this includes new functions + nftnl_{expr,set_elem}_set_imm() to decorate the data. + * More improvements for the snprintf() API for set elements: no + colon is printed if data is not provided, print object names in + maps and print flags only if non-zero. + +------------------------------------------------------------------- Old: ---- libnftnl-1.3.1.tar.xz libnftnl-1.3.1.tar.xz.sig New: ---- libnftnl-1.3.2.tar.xz libnftnl-1.3.2.tar.xz.sig ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libnftnl.spec ++++++ --- /var/tmp/diff_new_pack.TKhdA8/_old 2026-09-04 12:36:41.320742442 +0200 +++ /var/tmp/diff_new_pack.TKhdA8/_new 2026-09-04 12:36:41.324742582 +0200 @@ -1,7 +1,7 @@ # # spec file for package libnftnl # -# Copyright (c) 2025 SUSE LLC +# Copyright (c) 2026 SUSE LLC and contributors # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,7 +18,7 @@ Name: libnftnl %define lname libnftnl11 -Version: 1.3.1 +Version: 1.3.2 Release: 0 Summary: Userspace library to access the nftables Netlink interface License: GPL-2.0-or-later ++++++ _scmsync.obsinfo ++++++ --- /var/tmp/diff_new_pack.TKhdA8/_old 2026-09-04 12:36:41.415745777 +0200 +++ /var/tmp/diff_new_pack.TKhdA8/_new 2026-09-04 12:36:41.428746233 +0200 @@ -1,5 +1,5 @@ -mtime: 1764822549 -commit: a70e17adf0e4a2093c43f041a3d00c3e7370c9c2fa14e0a6814a8417b628317d +mtime: 1788203350 +commit: 0b05fd8c8552427e2c110682addf028495f9bbdd7e3abc6626cef2def7236962 url: https://src.opensuse.org/jengelh/libnftnl revision: master ++++++ build.specials.obscpio ++++++ ++++++ build.specials.obscpio ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/.gitignore new/.gitignore --- old/.gitignore 1970-01-01 01:00:00.000000000 +0100 +++ new/.gitignore 2026-08-31 21:09:10.000000000 +0200 @@ -0,0 +1 @@ +.osc ++++++ libnftnl-1.3.1.tar.xz -> libnftnl-1.3.2.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnftnl-1.3.1/Make_global.am new/libnftnl-1.3.2/Make_global.am --- old/libnftnl-1.3.1/Make_global.am 2025-12-03 13:01:22.054555093 +0100 +++ new/libnftnl-1.3.2/Make_global.am 2026-08-31 19:14:29.762427659 +0200 @@ -18,7 +18,7 @@ # set age to 0. # </snippet> # -LIBVERSION=18:0:7 +LIBVERSION=19:0:8 AM_CPPFLAGS = ${regular_CPPFLAGS} -I${top_srcdir}/include ${LIBMNL_CFLAGS} ${LIBMXML_CFLAGS} AM_CFLAGS = ${regular_CFLAGS} ${GCC_FVISIBILITY_HIDDEN} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnftnl-1.3.1/Makefile.in new/libnftnl-1.3.2/Makefile.in --- old/libnftnl-1.3.1/Makefile.in 2025-12-03 13:01:26.334585691 +0100 +++ new/libnftnl-1.3.2/Makefile.in 2026-08-31 19:14:35.574483629 +0200 @@ -394,7 +394,7 @@ # set age to 0. # </snippet> # -LIBVERSION = 18:0:7 +LIBVERSION = 19:0:8 AM_CPPFLAGS = ${regular_CPPFLAGS} -I${top_srcdir}/include ${LIBMNL_CFLAGS} ${LIBMXML_CFLAGS} AM_CFLAGS = ${regular_CFLAGS} ${GCC_FVISIBILITY_HIDDEN} ACLOCAL_AMFLAGS = -I m4 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnftnl-1.3.1/configure new/libnftnl-1.3.2/configure --- old/libnftnl-1.3.1/configure 2025-12-03 13:01:25.930582805 +0100 +++ new/libnftnl-1.3.2/configure 2026-08-31 19:14:35.182479855 +0200 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.72 for libnftnl 1.3.1. +# Generated by GNU Autoconf 2.72 for libnftnl 1.3.2. # # # Copyright (C) 1992-1996, 1998-2017, 2020-2023 Free Software Foundation, @@ -611,8 +611,8 @@ # Identity of this package. PACKAGE_NAME='libnftnl' PACKAGE_TARNAME='libnftnl' -PACKAGE_VERSION='1.3.1' -PACKAGE_STRING='libnftnl 1.3.1' +PACKAGE_VERSION='1.3.2' +PACKAGE_STRING='libnftnl 1.3.2' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1357,7 +1357,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 libnftnl 1.3.1 to adapt to many kinds of systems. +'configure' configures libnftnl 1.3.2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1428,7 +1428,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of libnftnl 1.3.1:";; + short | recursive ) echo "Configuration of libnftnl 1.3.2:";; esac cat <<\_ACEOF @@ -1546,7 +1546,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -libnftnl configure 1.3.1 +libnftnl configure 1.3.2 generated by GNU Autoconf 2.72 Copyright (C) 2023 Free Software Foundation, Inc. @@ -1770,7 +1770,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by libnftnl $as_me 1.3.1, which was +It was created by libnftnl $as_me 1.3.2, which was generated by GNU Autoconf 2.72. Invocation command line was $ $0$ac_configure_args_raw @@ -4665,7 +4665,7 @@ # Define the identity of the package. PACKAGE='libnftnl' - VERSION='1.3.1' + VERSION='1.3.2' printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h @@ -15461,7 +15461,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by libnftnl $as_me 1.3.1, which was +This file was extended by libnftnl $as_me 1.3.2, which was generated by GNU Autoconf 2.72. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -15529,7 +15529,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -libnftnl config.status 1.3.1 +libnftnl config.status 1.3.2 configured by $0, generated by GNU Autoconf 2.72, with options \\"\$ac_cs_config\\" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnftnl-1.3.1/configure.ac new/libnftnl-1.3.2/configure.ac --- old/libnftnl-1.3.1/configure.ac 2025-12-03 13:01:22.054555093 +0100 +++ new/libnftnl-1.3.2/configure.ac 2026-08-31 19:14:29.762427659 +0200 @@ -1,6 +1,6 @@ dnl Process this file with autoconf to create configure. -AC_INIT([libnftnl], [1.3.1]) +AC_INIT([libnftnl], [1.3.2]) AC_CONFIG_AUX_DIR([build-aux]) AC_CANONICAL_HOST AC_CONFIG_MACRO_DIR([m4]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnftnl-1.3.1/examples/Makefile.in new/libnftnl-1.3.2/examples/Makefile.in --- old/libnftnl-1.3.1/examples/Makefile.in 2025-12-03 13:01:26.374585976 +0100 +++ new/libnftnl-1.3.2/examples/Makefile.in 2026-08-31 19:14:35.614484014 +0200 @@ -543,7 +543,7 @@ # set age to 0. # </snippet> # -LIBVERSION = 18:0:7 +LIBVERSION = 19:0:8 AM_CPPFLAGS = ${regular_CPPFLAGS} -I${top_srcdir}/include ${LIBMNL_CFLAGS} ${LIBMXML_CFLAGS} AM_CFLAGS = ${regular_CFLAGS} ${GCC_FVISIBILITY_HIDDEN} nft_table_add_SOURCES = nft-table-add.c diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnftnl-1.3.1/examples/nft-rule-add.c new/libnftnl-1.3.2/examples/nft-rule-add.c --- old/libnftnl-1.3.1/examples/nft-rule-add.c 2025-12-03 13:01:22.058555121 +0100 +++ new/libnftnl-1.3.2/examples/nft-rule-add.c 2026-08-31 19:14:29.762427659 +0200 @@ -5,6 +5,7 @@ * This software has been sponsored by Sophos Astaro <http://www.sophos.com> */ +#define _GNU_SOURCE /* for tcphdr.dest */ #include <stdlib.h> #include <time.h> #include <string.h> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnftnl-1.3.1/include/data_reg.h new/libnftnl-1.3.2/include/data_reg.h --- old/libnftnl-1.3.1/include/data_reg.h 2025-12-03 13:01:22.058555121 +0100 +++ new/libnftnl-1.3.2/include/data_reg.h 2026-08-31 19:14:29.762427659 +0200 @@ -21,6 +21,8 @@ struct { uint32_t val[NFT_DATA_VALUE_MAXLEN / sizeof(uint32_t)]; uint32_t len; + uint32_t byteorder; + uint8_t sizes[NFT_REG32_COUNT]; }; struct { uint32_t verdict; @@ -35,6 +37,7 @@ struct nlattr; int nftnl_parse_data(union nftnl_data_reg *data, struct nlattr *attr, int *type); -int nftnl_data_cpy(union nftnl_data_reg *dreg, const void *src, uint32_t len); +int nftnl_data_cpy(union nftnl_data_reg *dreg, const void *src, + uint32_t len, uint32_t byteorder, uint8_t *sizes); #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnftnl-1.3.1/include/expr_ops.h new/libnftnl-1.3.2/include/expr_ops.h --- old/libnftnl-1.3.1/include/expr_ops.h 2025-12-03 13:01:22.058555121 +0100 +++ new/libnftnl-1.3.2/include/expr_ops.h 2026-08-31 19:14:29.762427659 +0200 @@ -19,7 +19,7 @@ struct attr_policy *attr_policy; void (*init)(const struct nftnl_expr *e); void (*free)(const struct nftnl_expr *e); - int (*set)(struct nftnl_expr *e, uint16_t type, const void *data, uint32_t data_len); + int (*set)(struct nftnl_expr *e, uint16_t type, const void *data, uint32_t data_len, uint32_t byteorder); const void *(*get)(const struct nftnl_expr *e, uint16_t type, uint32_t *data_len); int (*parse)(struct nftnl_expr *e, struct nlattr *attr); void (*build)(struct nlmsghdr *nlh, const struct nftnl_expr *e); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnftnl-1.3.1/include/libnftnl/expr.h new/libnftnl-1.3.2/include/libnftnl/expr.h --- old/libnftnl-1.3.1/include/libnftnl/expr.h 2025-12-03 13:01:22.058555121 +0100 +++ new/libnftnl-1.3.2/include/libnftnl/expr.h 2026-08-31 19:14:29.762427659 +0200 @@ -21,6 +21,7 @@ bool nftnl_expr_is_set(const struct nftnl_expr *expr, uint16_t type); int nftnl_expr_set(struct nftnl_expr *expr, uint16_t type, const void *data, uint32_t data_len); +int nftnl_expr_set_imm(struct nftnl_expr *expr, uint16_t type, const void *data, uint32_t data_len, uint32_t byteorder); #define nftnl_expr_set_data nftnl_expr_set void nftnl_expr_set_u8(struct nftnl_expr *expr, uint16_t type, uint8_t data); void nftnl_expr_set_u16(struct nftnl_expr *expr, uint16_t type, uint16_t data); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnftnl-1.3.1/include/libnftnl/object.h new/libnftnl-1.3.2/include/libnftnl/object.h --- old/libnftnl-1.3.1/include/libnftnl/object.h 2025-12-03 13:01:22.058555121 +0100 +++ new/libnftnl-1.3.2/include/libnftnl/object.h 2026-08-31 19:14:29.762427659 +0200 @@ -146,6 +146,12 @@ NFTNL_TUNNEL_GENEVE_DATA, }; +enum { + NFTNL_OBJ_CONNLIMIT_COUNT = NFTNL_OBJ_BASE, + NFTNL_OBJ_CONNLIMIT_FLAGS, + __NFTNL_OBJ_CONNLIMIT_MAX, +}; + struct nftnl_tunnel_opt; struct nftnl_tunnel_opts; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnftnl-1.3.1/include/libnftnl/set.h new/libnftnl-1.3.2/include/libnftnl/set.h --- old/libnftnl-1.3.1/include/libnftnl/set.h 2025-12-03 13:01:22.058555121 +0100 +++ new/libnftnl-1.3.2/include/libnftnl/set.h 2026-08-31 19:14:29.762427659 +0200 @@ -42,8 +42,6 @@ struct nftnl_set *nftnl_set_alloc(void); void nftnl_set_free(const struct nftnl_set *s); -struct nftnl_set *nftnl_set_clone(const struct nftnl_set *set); - bool nftnl_set_is_set(const struct nftnl_set *s, uint16_t attr); void nftnl_set_unset(struct nftnl_set *s, uint16_t attr); int nftnl_set_set(struct nftnl_set *s, uint16_t attr, const void *data) __attribute__((deprecated)); @@ -125,12 +123,11 @@ struct nftnl_set_elem *nftnl_set_elem_alloc(void); void nftnl_set_elem_free(struct nftnl_set_elem *s); -struct nftnl_set_elem *nftnl_set_elem_clone(struct nftnl_set_elem *elem); - void nftnl_set_elem_add(struct nftnl_set *s, struct nftnl_set_elem *elem); void nftnl_set_elem_unset(struct nftnl_set_elem *s, uint16_t attr); int nftnl_set_elem_set(struct nftnl_set_elem *s, uint16_t attr, const void *data, uint32_t data_len); +int nftnl_set_elem_set_imm(struct nftnl_set_elem *s, uint16_t attr, const void *data, uint32_t data_len, uint32_t byteorder, uint8_t *sizes); void nftnl_set_elem_set_u32(struct nftnl_set_elem *s, uint16_t attr, uint32_t val); void nftnl_set_elem_set_u64(struct nftnl_set_elem *s, uint16_t attr, uint64_t val); int nftnl_set_elem_set_str(struct nftnl_set_elem *s, uint16_t attr, const char *str); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnftnl-1.3.1/include/obj.h new/libnftnl-1.3.2/include/obj.h --- old/libnftnl-1.3.1/include/obj.h 2025-12-03 13:01:22.058555121 +0100 +++ new/libnftnl-1.3.2/include/obj.h 2026-08-31 19:14:29.762427659 +0200 @@ -83,6 +83,10 @@ struct nftnl_obj_secmark { char ctx[NFT_SECMARK_CTX_MAXLEN]; } secmark; + struct nftnl_obj_connlimit { + uint32_t count; + uint32_t flags; + } connlimit; } data; }; @@ -108,6 +112,7 @@ extern struct obj_ops obj_ops_synproxy; extern struct obj_ops obj_ops_tunnel; extern struct obj_ops obj_ops_secmark; +extern struct obj_ops obj_ops_connlimit; #define nftnl_obj_data(obj) (void *)&obj->data diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnftnl-1.3.1/include/utils.h new/libnftnl-1.3.2/include/utils.h --- old/libnftnl-1.3.1/include/utils.h 2025-12-03 13:01:22.058555121 +0100 +++ new/libnftnl-1.3.2/include/utils.h 2026-08-31 19:14:29.762427659 +0200 @@ -91,4 +91,14 @@ int nftnl_parse_str_attr(const struct nlattr *tb, int attr, const char **field, uint32_t *flags); +static inline uint32_t bytesum(uint8_t *buf, size_t buflen) +{ + uint32_t ret = 0; + + while (buflen--) + ret += buf[buflen]; + + return ret; +} + #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnftnl-1.3.1/src/Makefile.am new/libnftnl-1.3.2/src/Makefile.am --- old/libnftnl-1.3.1/src/Makefile.am 2025-12-03 13:01:22.058555121 +0100 +++ new/libnftnl-1.3.2/src/Makefile.am 2026-08-31 19:14:29.762427659 +0200 @@ -71,4 +71,5 @@ obj/ct_timeout.c \ obj/secmark.c \ obj/ct_expect.c \ + obj/connlimit.c \ libnftnl.map diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnftnl-1.3.1/src/Makefile.in new/libnftnl-1.3.2/src/Makefile.in --- old/libnftnl-1.3.1/src/Makefile.in 2025-12-03 13:01:26.442586461 +0100 +++ new/libnftnl-1.3.2/src/Makefile.in 2026-08-31 19:14:35.682484669 +0200 @@ -149,7 +149,8 @@ expr/redir.lo expr/hash.lo expr/socket.lo expr/synproxy.lo \ expr/osf.lo expr/xfrm.lo obj/counter.lo obj/ct_helper.lo \ obj/quota.lo obj/tunnel.lo obj/limit.lo obj/synproxy.lo \ - obj/ct_timeout.lo obj/secmark.lo obj/ct_expect.lo + obj/ct_timeout.lo obj/secmark.lo obj/ct_expect.lo \ + obj/connlimit.lo libnftnl_la_OBJECTS = $(am_libnftnl_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) @@ -201,11 +202,12 @@ expr/$(DEPDIR)/rt.Plo expr/$(DEPDIR)/socket.Plo \ expr/$(DEPDIR)/synproxy.Plo expr/$(DEPDIR)/target.Plo \ expr/$(DEPDIR)/tproxy.Plo expr/$(DEPDIR)/tunnel.Plo \ - expr/$(DEPDIR)/xfrm.Plo obj/$(DEPDIR)/counter.Plo \ - obj/$(DEPDIR)/ct_expect.Plo obj/$(DEPDIR)/ct_helper.Plo \ - obj/$(DEPDIR)/ct_timeout.Plo obj/$(DEPDIR)/limit.Plo \ - obj/$(DEPDIR)/quota.Plo obj/$(DEPDIR)/secmark.Plo \ - obj/$(DEPDIR)/synproxy.Plo obj/$(DEPDIR)/tunnel.Plo + expr/$(DEPDIR)/xfrm.Plo obj/$(DEPDIR)/connlimit.Plo \ + obj/$(DEPDIR)/counter.Plo obj/$(DEPDIR)/ct_expect.Plo \ + obj/$(DEPDIR)/ct_helper.Plo obj/$(DEPDIR)/ct_timeout.Plo \ + obj/$(DEPDIR)/limit.Plo obj/$(DEPDIR)/quota.Plo \ + obj/$(DEPDIR)/secmark.Plo obj/$(DEPDIR)/synproxy.Plo \ + obj/$(DEPDIR)/tunnel.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -402,7 +404,7 @@ # set age to 0. # </snippet> # -LIBVERSION = 18:0:7 +LIBVERSION = 19:0:8 AM_CPPFLAGS = ${regular_CPPFLAGS} -I${top_srcdir}/include ${LIBMNL_CFLAGS} ${LIBMXML_CFLAGS} AM_CFLAGS = ${regular_CFLAGS} ${GCC_FVISIBILITY_HIDDEN} lib_LTLIBRARIES = libnftnl.la @@ -476,6 +478,7 @@ obj/ct_timeout.c \ obj/secmark.c \ obj/ct_expect.c \ + obj/connlimit.c \ libnftnl.map all: all-am @@ -607,6 +610,7 @@ obj/ct_timeout.lo: obj/$(am__dirstamp) obj/$(DEPDIR)/$(am__dirstamp) obj/secmark.lo: obj/$(am__dirstamp) obj/$(DEPDIR)/$(am__dirstamp) obj/ct_expect.lo: obj/$(am__dirstamp) obj/$(DEPDIR)/$(am__dirstamp) +obj/connlimit.lo: obj/$(am__dirstamp) obj/$(DEPDIR)/$(am__dirstamp) libnftnl.la: $(libnftnl_la_OBJECTS) $(libnftnl_la_DEPENDENCIES) $(EXTRA_libnftnl_la_DEPENDENCIES) $(AM_V_CCLD)$(libnftnl_la_LINK) -rpath $(libdir) $(libnftnl_la_OBJECTS) $(libnftnl_la_LIBADD) $(LIBS) @@ -678,6 +682,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@expr/$(DEPDIR)/tproxy.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@expr/$(DEPDIR)/tunnel.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@expr/$(DEPDIR)/xfrm.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@obj/$(DEPDIR)/connlimit.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@obj/$(DEPDIR)/counter.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@obj/$(DEPDIR)/ct_expect.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@obj/$(DEPDIR)/ct_helper.Plo@am__quote@ # am--include-marker @@ -914,6 +919,7 @@ -rm -f expr/$(DEPDIR)/tproxy.Plo -rm -f expr/$(DEPDIR)/tunnel.Plo -rm -f expr/$(DEPDIR)/xfrm.Plo + -rm -f obj/$(DEPDIR)/connlimit.Plo -rm -f obj/$(DEPDIR)/counter.Plo -rm -f obj/$(DEPDIR)/ct_expect.Plo -rm -f obj/$(DEPDIR)/ct_helper.Plo @@ -1025,6 +1031,7 @@ -rm -f expr/$(DEPDIR)/tproxy.Plo -rm -f expr/$(DEPDIR)/tunnel.Plo -rm -f expr/$(DEPDIR)/xfrm.Plo + -rm -f obj/$(DEPDIR)/connlimit.Plo -rm -f obj/$(DEPDIR)/counter.Plo -rm -f obj/$(DEPDIR)/ct_expect.Plo -rm -f obj/$(DEPDIR)/ct_helper.Plo diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnftnl-1.3.1/src/expr/bitwise.c new/libnftnl-1.3.2/src/expr/bitwise.c --- old/libnftnl-1.3.1/src/expr/bitwise.c 2025-12-03 13:01:22.058555121 +0100 +++ new/libnftnl-1.3.2/src/expr/bitwise.c 2026-08-31 19:14:29.766427696 +0200 @@ -30,7 +30,7 @@ static int nftnl_expr_bitwise_set(struct nftnl_expr *e, uint16_t type, - const void *data, uint32_t data_len) + const void *data, uint32_t data_len, uint32_t byteorder) { struct nftnl_expr_bitwise *bitwise = nftnl_expr_data(e); @@ -51,11 +51,14 @@ memcpy(&bitwise->len, data, data_len); break; case NFTNL_EXPR_BITWISE_MASK: - return nftnl_data_cpy(&bitwise->mask, data, data_len); + return nftnl_data_cpy(&bitwise->mask, data, + data_len, byteorder, NULL); case NFTNL_EXPR_BITWISE_XOR: - return nftnl_data_cpy(&bitwise->xor, data, data_len); + return nftnl_data_cpy(&bitwise->xor, data, + data_len, byteorder, NULL); case NFTNL_EXPR_BITWISE_DATA: - return nftnl_data_cpy(&bitwise->data, data, data_len); + return nftnl_data_cpy(&bitwise->data, data, + data_len, byteorder, NULL); } return 0; } @@ -225,13 +228,16 @@ 0, DATA_VALUE); SNPRINTF_BUFFER_SIZE(ret, remain, offset); - ret = snprintf(buf + offset, remain, ") ^ "); + ret = snprintf(buf + offset, remain, " ) ^ "); SNPRINTF_BUFFER_SIZE(ret, remain, offset); ret = nftnl_data_reg_snprintf(buf + offset, remain, &bitwise->xor, 0, DATA_VALUE); SNPRINTF_BUFFER_SIZE(ret, remain, offset); + ret = snprintf(buf + offset, remain, " "); + SNPRINTF_BUFFER_SIZE(ret, remain, offset); + return offset; } @@ -248,7 +254,7 @@ 0, DATA_VALUE); SNPRINTF_BUFFER_SIZE(ret, remain, offset); - ret = snprintf(buf + offset, remain, ") "); + ret = snprintf(buf + offset, remain, " ) "); SNPRINTF_BUFFER_SIZE(ret, remain, offset); return offset; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnftnl-1.3.1/src/expr/byteorder.c new/libnftnl-1.3.2/src/expr/byteorder.c --- old/libnftnl-1.3.1/src/expr/byteorder.c 2025-12-03 13:01:22.058555121 +0100 +++ new/libnftnl-1.3.2/src/expr/byteorder.c 2026-08-31 19:14:29.766427696 +0200 @@ -27,7 +27,7 @@ static int nftnl_expr_byteorder_set(struct nftnl_expr *e, uint16_t type, - const void *data, uint32_t data_len) + const void *data, uint32_t data_len, uint32_t byteorderp) { struct nftnl_expr_byteorder *byteorder = nftnl_expr_data(e); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnftnl-1.3.1/src/expr/cmp.c new/libnftnl-1.3.2/src/expr/cmp.c --- old/libnftnl-1.3.1/src/expr/cmp.c 2025-12-03 13:01:22.058555121 +0100 +++ new/libnftnl-1.3.2/src/expr/cmp.c 2026-08-31 19:14:29.766427696 +0200 @@ -26,7 +26,7 @@ static int nftnl_expr_cmp_set(struct nftnl_expr *e, uint16_t type, - const void *data, uint32_t data_len) + const void *data, uint32_t data_len, uint32_t byteorder) { struct nftnl_expr_cmp *cmp = nftnl_expr_data(e); @@ -38,7 +38,8 @@ memcpy(&cmp->op, data, data_len); break; case NFTNL_EXPR_CMP_DATA: - return nftnl_data_cpy(&cmp->data, data, data_len); + return nftnl_data_cpy(&cmp->data, data, + data_len, byteorder, NULL); } return 0; } @@ -163,6 +164,9 @@ 0, DATA_VALUE); SNPRINTF_BUFFER_SIZE(ret, remain, offset); + ret = snprintf(buf + offset, remain, " "); + SNPRINTF_BUFFER_SIZE(ret, remain, offset); + return offset; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnftnl-1.3.1/src/expr/connlimit.c new/libnftnl-1.3.2/src/expr/connlimit.c --- old/libnftnl-1.3.1/src/expr/connlimit.c 2025-12-03 13:01:22.058555121 +0100 +++ new/libnftnl-1.3.2/src/expr/connlimit.c 2026-08-31 19:14:29.766427696 +0200 @@ -23,7 +23,7 @@ static int nftnl_expr_connlimit_set(struct nftnl_expr *e, uint16_t type, - const void *data, uint32_t data_len) + const void *data, uint32_t data_len, uint32_t byteorder) { struct nftnl_expr_connlimit *connlimit = nftnl_expr_data(e); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnftnl-1.3.1/src/expr/counter.c new/libnftnl-1.3.2/src/expr/counter.c --- old/libnftnl-1.3.1/src/expr/counter.c 2025-12-03 13:01:22.058555121 +0100 +++ new/libnftnl-1.3.2/src/expr/counter.c 2026-08-31 19:14:29.766427696 +0200 @@ -25,7 +25,7 @@ static int nftnl_expr_counter_set(struct nftnl_expr *e, uint16_t type, - const void *data, uint32_t data_len) + const void *data, uint32_t data_len, uint32_t byteorder) { struct nftnl_expr_counter *ctr = nftnl_expr_data(e); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnftnl-1.3.1/src/expr/ct.c new/libnftnl-1.3.2/src/expr/ct.c --- old/libnftnl-1.3.1/src/expr/ct.c 2025-12-03 13:01:22.058555121 +0100 +++ new/libnftnl-1.3.2/src/expr/ct.c 2026-08-31 19:14:29.766427696 +0200 @@ -29,7 +29,7 @@ static int nftnl_expr_ct_set(struct nftnl_expr *e, uint16_t type, - const void *data, uint32_t data_len) + const void *data, uint32_t data_len, uint32_t byteorder) { struct nftnl_expr_ct *ct = nftnl_expr_data(e); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnftnl-1.3.1/src/expr/data_reg.c new/libnftnl-1.3.2/src/expr/data_reg.c --- old/libnftnl-1.3.1/src/expr/data_reg.c 2025-12-03 13:01:22.058555121 +0100 +++ new/libnftnl-1.3.2/src/expr/data_reg.c 2026-08-31 19:14:29.766427696 +0200 @@ -20,20 +20,64 @@ #include <libnftnl/rule.h> #include "internal.h" +static bool big_endian_host(void) +{ + uint16_t v = 1; + + return v == htons(v); +} + +static int __reg_value_snprintf(char *buf, size_t remain, + uint8_t *data, size_t datalen, + bool reverse, const char *pfx) +{ + int offset = 0, ret, i, idx; + const char *sep = ""; + + for (i = 0; i < datalen; i++) { + if ((i % 4) == 0) { + ret = snprintf(buf + offset, remain, "%s%s", sep, pfx); + SNPRINTF_BUFFER_SIZE(ret, remain, offset); + sep = " "; + } + if (reverse) + idx = datalen - i - 1; + else + idx = i; + + ret = snprintf(buf + offset, remain, "%.2x", data[idx]); + SNPRINTF_BUFFER_SIZE(ret, remain, offset); + } + + return offset; +} + static int nftnl_data_reg_value_snprintf_default(char *buf, size_t remain, const union nftnl_data_reg *reg, uint32_t flags) { + uint32_t byteorder = big_endian_host() ? 0 : reg->byteorder; const char *pfx = flags & DATA_F_NOPFX ? "" : "0x"; - int offset = 0, ret, i; - + int offset = 0, ret, i, pos = 0; - - for (i = 0; i < div_round_up(reg->len, sizeof(uint32_t)); i++) { - ret = snprintf(buf + offset, remain, - "%s%.8x ", pfx, reg->val[i]); + for (i = 0; i < array_size(reg->sizes); i++) { + int curlen = reg->sizes[i] ?: reg->len; + bool reverse = byteorder & (1 << i); + + if (i > 0) { + ret = snprintf(buf + offset, remain, " . "); + SNPRINTF_BUFFER_SIZE(ret, remain, offset); + } + + ret = __reg_value_snprintf(buf + offset, remain, + (void *)®->val[pos], + curlen, reverse, pfx); SNPRINTF_BUFFER_SIZE(ret, remain, offset); + + pos += div_round_up(curlen, sizeof(uint32_t)); + if (pos >= reg->len / sizeof(uint32_t)) + break; } return offset; @@ -46,11 +90,11 @@ { int remain = size, offset = 0, ret = 0; - ret = snprintf(buf, size, "%s ", nftnl_verdict2str(reg->verdict)); + ret = snprintf(buf, size, "%s", nftnl_verdict2str(reg->verdict)); SNPRINTF_BUFFER_SIZE(ret, remain, offset); if (reg->chain != NULL) { - ret = snprintf(buf + offset, remain, "-> %s ", reg->chain); + ret = snprintf(buf + offset, remain, " -> %s", reg->chain); SNPRINTF_BUFFER_SIZE(ret, remain, offset); } @@ -202,7 +246,8 @@ return ret; } -int nftnl_data_cpy(union nftnl_data_reg *dreg, const void *src, uint32_t len) +int nftnl_data_cpy(union nftnl_data_reg *dreg, const void *src, + uint32_t len, uint32_t byteorder, uint8_t *sizes) { int ret = 0; @@ -213,5 +258,10 @@ memcpy(dreg->val, src, len); dreg->len = len; + dreg->byteorder = byteorder; + if (sizes) + memcpy(dreg->sizes, sizes, sizeof(dreg->sizes)); + else + memset(dreg->sizes, 0, sizeof(dreg->sizes)); return ret; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnftnl-1.3.1/src/expr/dup.c new/libnftnl-1.3.2/src/expr/dup.c --- old/libnftnl-1.3.1/src/expr/dup.c 2025-12-03 13:01:22.058555121 +0100 +++ new/libnftnl-1.3.2/src/expr/dup.c 2026-08-31 19:14:29.766427696 +0200 @@ -21,8 +21,9 @@ enum nft_registers sreg_dev; }; -static int nftnl_expr_dup_set(struct nftnl_expr *e, uint16_t type, - const void *data, uint32_t data_len) +static int +nftnl_expr_dup_set(struct nftnl_expr *e, uint16_t type, + const void *data, uint32_t data_len, uint32_t byteorder) { struct nftnl_expr_dup *dup = nftnl_expr_data(e); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnftnl-1.3.1/src/expr/dynset.c new/libnftnl-1.3.2/src/expr/dynset.c --- old/libnftnl-1.3.1/src/expr/dynset.c 2025-12-03 13:01:22.062555150 +0100 +++ new/libnftnl-1.3.2/src/expr/dynset.c 2026-08-31 19:14:29.766427696 +0200 @@ -30,7 +30,7 @@ static int nftnl_expr_dynset_set(struct nftnl_expr *e, uint16_t type, - const void *data, uint32_t data_len) + const void *data, uint32_t data_len, uint32_t byteorder) { struct nftnl_expr_dynset *dynset = nftnl_expr_data(e); struct nftnl_expr *expr, *next; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnftnl-1.3.1/src/expr/exthdr.c new/libnftnl-1.3.2/src/expr/exthdr.c --- old/libnftnl-1.3.1/src/expr/exthdr.c 2025-12-03 13:01:22.062555150 +0100 +++ new/libnftnl-1.3.2/src/expr/exthdr.c 2026-08-31 19:14:29.766427696 +0200 @@ -36,7 +36,7 @@ static int nftnl_expr_exthdr_set(struct nftnl_expr *e, uint16_t type, - const void *data, uint32_t data_len) + const void *data, uint32_t data_len, uint32_t byteorder) { struct nftnl_expr_exthdr *exthdr = nftnl_expr_data(e); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnftnl-1.3.1/src/expr/fib.c new/libnftnl-1.3.2/src/expr/fib.c --- old/libnftnl-1.3.1/src/expr/fib.c 2025-12-03 13:01:22.062555150 +0100 +++ new/libnftnl-1.3.2/src/expr/fib.c 2026-08-31 19:14:29.766427696 +0200 @@ -25,7 +25,7 @@ static int nftnl_expr_fib_set(struct nftnl_expr *e, uint16_t result, - const void *data, uint32_t data_len) + const void *data, uint32_t data_len, uint32_t byteorder) { struct nftnl_expr_fib *fib = nftnl_expr_data(e); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnftnl-1.3.1/src/expr/flow_offload.c new/libnftnl-1.3.2/src/expr/flow_offload.c --- old/libnftnl-1.3.1/src/expr/flow_offload.c 2025-12-03 13:01:22.062555150 +0100 +++ new/libnftnl-1.3.2/src/expr/flow_offload.c 2026-08-31 19:14:29.766427696 +0200 @@ -14,8 +14,9 @@ char *table_name; }; -static int nftnl_expr_flow_set(struct nftnl_expr *e, uint16_t type, - const void *data, uint32_t data_len) +static int +nftnl_expr_flow_set(struct nftnl_expr *e, uint16_t type, + const void *data, uint32_t data_len, uint32_t byteorder) { struct nftnl_expr_flow *flow = nftnl_expr_data(e); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnftnl-1.3.1/src/expr/fwd.c new/libnftnl-1.3.2/src/expr/fwd.c --- old/libnftnl-1.3.1/src/expr/fwd.c 2025-12-03 13:01:22.062555150 +0100 +++ new/libnftnl-1.3.2/src/expr/fwd.c 2026-08-31 19:14:29.766427696 +0200 @@ -22,8 +22,9 @@ uint32_t nfproto; }; -static int nftnl_expr_fwd_set(struct nftnl_expr *e, uint16_t type, - const void *data, uint32_t data_len) +static int +nftnl_expr_fwd_set(struct nftnl_expr *e, uint16_t type, + const void *data, uint32_t data_len, uint32_t byteorder) { struct nftnl_expr_fwd *fwd = nftnl_expr_data(e); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnftnl-1.3.1/src/expr/hash.c new/libnftnl-1.3.2/src/expr/hash.c --- old/libnftnl-1.3.1/src/expr/hash.c 2025-12-03 13:01:22.062555150 +0100 +++ new/libnftnl-1.3.2/src/expr/hash.c 2026-08-31 19:14:29.766427696 +0200 @@ -27,7 +27,7 @@ static int nftnl_expr_hash_set(struct nftnl_expr *e, uint16_t type, - const void *data, uint32_t data_len) + const void *data, uint32_t data_len, uint32_t byteorder) { struct nftnl_expr_hash *hash = nftnl_expr_data(e); switch (type) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnftnl-1.3.1/src/expr/immediate.c new/libnftnl-1.3.2/src/expr/immediate.c --- old/libnftnl-1.3.1/src/expr/immediate.c 2025-12-03 13:01:22.062555150 +0100 +++ new/libnftnl-1.3.2/src/expr/immediate.c 2026-08-31 19:14:29.766427696 +0200 @@ -23,7 +23,7 @@ static int nftnl_expr_immediate_set(struct nftnl_expr *e, uint16_t type, - const void *data, uint32_t data_len) + const void *data, uint32_t data_len, uint32_t byteorder) { struct nftnl_expr_immediate *imm = nftnl_expr_data(e); @@ -32,7 +32,8 @@ memcpy(&imm->dreg, data, data_len); break; case NFTNL_EXPR_IMM_DATA: - return nftnl_data_cpy(&imm->data, data, data_len); + return nftnl_data_cpy(&imm->data, data, + data_len, byteorder, NULL); case NFTNL_EXPR_IMM_VERDICT: memcpy(&imm->data.verdict, data, data_len); break; @@ -201,6 +202,9 @@ SNPRINTF_BUFFER_SIZE(ret, remain, offset); } + ret = snprintf(buf + offset, remain, " "); + SNPRINTF_BUFFER_SIZE(ret, remain, offset); + return offset; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnftnl-1.3.1/src/expr/inner.c new/libnftnl-1.3.2/src/expr/inner.c --- old/libnftnl-1.3.1/src/expr/inner.c 2025-12-03 13:01:22.062555150 +0100 +++ new/libnftnl-1.3.2/src/expr/inner.c 2026-08-31 19:14:29.766427696 +0200 @@ -35,7 +35,7 @@ static int nftnl_expr_inner_set(struct nftnl_expr *e, uint16_t type, - const void *data, uint32_t data_len) + const void *data, uint32_t data_len, uint32_t byteorder) { struct nftnl_expr_inner *inner = nftnl_expr_data(e); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnftnl-1.3.1/src/expr/last.c new/libnftnl-1.3.2/src/expr/last.c --- old/libnftnl-1.3.1/src/expr/last.c 2025-12-03 13:01:22.062555150 +0100 +++ new/libnftnl-1.3.2/src/expr/last.c 2026-08-31 19:14:29.766427696 +0200 @@ -21,8 +21,9 @@ uint32_t set; }; -static int nftnl_expr_last_set(struct nftnl_expr *e, uint16_t type, - const void *data, uint32_t data_len) +static int +nftnl_expr_last_set(struct nftnl_expr *e, uint16_t type, + const void *data, uint32_t data_len, uint32_t byteorder) { struct nftnl_expr_last *last = nftnl_expr_data(e); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnftnl-1.3.1/src/expr/limit.c new/libnftnl-1.3.2/src/expr/limit.c --- old/libnftnl-1.3.1/src/expr/limit.c 2025-12-03 13:01:22.062555150 +0100 +++ new/libnftnl-1.3.2/src/expr/limit.c 2026-08-31 19:14:29.766427696 +0200 @@ -28,7 +28,7 @@ static int nftnl_expr_limit_set(struct nftnl_expr *e, uint16_t type, - const void *data, uint32_t data_len) + const void *data, uint32_t data_len, uint32_t byteorder) { struct nftnl_expr_limit *limit = nftnl_expr_data(e); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnftnl-1.3.1/src/expr/log.c new/libnftnl-1.3.2/src/expr/log.c --- old/libnftnl-1.3.1/src/expr/log.c 2025-12-03 13:01:22.062555150 +0100 +++ new/libnftnl-1.3.2/src/expr/log.c 2026-08-31 19:14:29.766427696 +0200 @@ -27,8 +27,9 @@ const char *prefix; }; -static int nftnl_expr_log_set(struct nftnl_expr *e, uint16_t type, - const void *data, uint32_t data_len) +static int +nftnl_expr_log_set(struct nftnl_expr *e, uint16_t type, + const void *data, uint32_t data_len, uint32_t byteorder) { struct nftnl_expr_log *log = nftnl_expr_data(e); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnftnl-1.3.1/src/expr/lookup.c new/libnftnl-1.3.2/src/expr/lookup.c --- old/libnftnl-1.3.1/src/expr/lookup.c 2025-12-03 13:01:22.062555150 +0100 +++ new/libnftnl-1.3.2/src/expr/lookup.c 2026-08-31 19:14:29.766427696 +0200 @@ -27,7 +27,7 @@ static int nftnl_expr_lookup_set(struct nftnl_expr *e, uint16_t type, - const void *data, uint32_t data_len) + const void *data, uint32_t data_len, uint32_t byteorder) { struct nftnl_expr_lookup *lookup = nftnl_expr_data(e); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnftnl-1.3.1/src/expr/masq.c new/libnftnl-1.3.2/src/expr/masq.c --- old/libnftnl-1.3.1/src/expr/masq.c 2025-12-03 13:01:22.062555150 +0100 +++ new/libnftnl-1.3.2/src/expr/masq.c 2026-08-31 19:14:29.766427696 +0200 @@ -24,7 +24,7 @@ static int nftnl_expr_masq_set(struct nftnl_expr *e, uint16_t type, - const void *data, uint32_t data_len) + const void *data, uint32_t data_len, uint32_t byteorder) { struct nftnl_expr_masq *masq = nftnl_expr_data(e); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnftnl-1.3.1/src/expr/match.c new/libnftnl-1.3.2/src/expr/match.c --- old/libnftnl-1.3.1/src/expr/match.c 2025-12-03 13:01:22.062555150 +0100 +++ new/libnftnl-1.3.2/src/expr/match.c 2026-08-31 19:14:29.766427696 +0200 @@ -32,7 +32,7 @@ static int nftnl_expr_match_set(struct nftnl_expr *e, uint16_t type, - const void *data, uint32_t data_len) + const void *data, uint32_t data_len, uint32_t byteorder) { struct nftnl_expr_match *mt = nftnl_expr_data(e); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnftnl-1.3.1/src/expr/meta.c new/libnftnl-1.3.2/src/expr/meta.c --- old/libnftnl-1.3.1/src/expr/meta.c 2025-12-03 13:01:22.062555150 +0100 +++ new/libnftnl-1.3.2/src/expr/meta.c 2026-08-31 19:14:29.766427696 +0200 @@ -29,7 +29,7 @@ static int nftnl_expr_meta_set(struct nftnl_expr *e, uint16_t type, - const void *data, uint32_t data_len) + const void *data, uint32_t data_len, uint32_t byteorder) { struct nftnl_expr_meta *meta = nftnl_expr_data(e); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnftnl-1.3.1/src/expr/nat.c new/libnftnl-1.3.2/src/expr/nat.c --- old/libnftnl-1.3.1/src/expr/nat.c 2025-12-03 13:01:22.062555150 +0100 +++ new/libnftnl-1.3.2/src/expr/nat.c 2026-08-31 19:14:29.766427696 +0200 @@ -32,7 +32,7 @@ static int nftnl_expr_nat_set(struct nftnl_expr *e, uint16_t type, - const void *data, uint32_t data_len) + const void *data, uint32_t data_len, uint32_t byteorder) { struct nftnl_expr_nat *nat = nftnl_expr_data(e); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnftnl-1.3.1/src/expr/numgen.c new/libnftnl-1.3.2/src/expr/numgen.c --- old/libnftnl-1.3.1/src/expr/numgen.c 2025-12-03 13:01:22.062555150 +0100 +++ new/libnftnl-1.3.2/src/expr/numgen.c 2026-08-31 19:14:29.766427696 +0200 @@ -24,7 +24,7 @@ static int nftnl_expr_ng_set(struct nftnl_expr *e, uint16_t type, - const void *data, uint32_t data_len) + const void *data, uint32_t data_len, uint32_t byteorder) { struct nftnl_expr_ng *ng = nftnl_expr_data(e); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnftnl-1.3.1/src/expr/objref.c new/libnftnl-1.3.2/src/expr/objref.c --- old/libnftnl-1.3.1/src/expr/objref.c 2025-12-03 13:01:22.062555150 +0100 +++ new/libnftnl-1.3.2/src/expr/objref.c 2026-08-31 19:14:29.766427696 +0200 @@ -28,8 +28,9 @@ } set; }; -static int nftnl_expr_objref_set(struct nftnl_expr *e, uint16_t type, - const void *data, uint32_t data_len) +static int +nftnl_expr_objref_set(struct nftnl_expr *e, uint16_t type, + const void *data, uint32_t data_len, uint32_t byteorder) { struct nftnl_expr_objref *objref = nftnl_expr_data(e); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnftnl-1.3.1/src/expr/osf.c new/libnftnl-1.3.2/src/expr/osf.c --- old/libnftnl-1.3.1/src/expr/osf.c 2025-12-03 13:01:22.062555150 +0100 +++ new/libnftnl-1.3.2/src/expr/osf.c 2026-08-31 19:14:29.766427696 +0200 @@ -18,8 +18,9 @@ uint32_t flags; }; -static int nftnl_expr_osf_set(struct nftnl_expr *e, uint16_t type, - const void *data, uint32_t data_len) +static int +nftnl_expr_osf_set(struct nftnl_expr *e, uint16_t type, + const void *data, uint32_t data_len, uint32_t byteorder) { struct nftnl_expr_osf *osf = nftnl_expr_data(e); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnftnl-1.3.1/src/expr/payload.c new/libnftnl-1.3.2/src/expr/payload.c --- old/libnftnl-1.3.1/src/expr/payload.c 2025-12-03 13:01:22.062555150 +0100 +++ new/libnftnl-1.3.2/src/expr/payload.c 2026-08-31 19:14:29.766427696 +0200 @@ -33,7 +33,7 @@ static int nftnl_expr_payload_set(struct nftnl_expr *e, uint16_t type, - const void *data, uint32_t data_len) + const void *data, uint32_t data_len, uint32_t byteorder) { struct nftnl_expr_payload *payload = nftnl_expr_data(e); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnftnl-1.3.1/src/expr/queue.c new/libnftnl-1.3.2/src/expr/queue.c --- old/libnftnl-1.3.1/src/expr/queue.c 2025-12-03 13:01:22.062555150 +0100 +++ new/libnftnl-1.3.2/src/expr/queue.c 2026-08-31 19:14:29.766427696 +0200 @@ -22,8 +22,9 @@ uint16_t flags; }; -static int nftnl_expr_queue_set(struct nftnl_expr *e, uint16_t type, - const void *data, uint32_t data_len) +static int +nftnl_expr_queue_set(struct nftnl_expr *e, uint16_t type, + const void *data, uint32_t data_len, uint32_t byteorder) { struct nftnl_expr_queue *queue = nftnl_expr_data(e); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnftnl-1.3.1/src/expr/quota.c new/libnftnl-1.3.2/src/expr/quota.c --- old/libnftnl-1.3.1/src/expr/quota.c 2025-12-03 13:01:22.062555150 +0100 +++ new/libnftnl-1.3.2/src/expr/quota.c 2026-08-31 19:14:29.766427696 +0200 @@ -22,8 +22,9 @@ uint32_t flags; }; -static int nftnl_expr_quota_set(struct nftnl_expr *e, uint16_t type, - const void *data, uint32_t data_len) +static int +nftnl_expr_quota_set(struct nftnl_expr *e, uint16_t type, + const void *data, uint32_t data_len, uint32_t byteorder) { struct nftnl_expr_quota *quota = nftnl_expr_data(e); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnftnl-1.3.1/src/expr/range.c new/libnftnl-1.3.2/src/expr/range.c --- old/libnftnl-1.3.1/src/expr/range.c 2025-12-03 13:01:22.062555150 +0100 +++ new/libnftnl-1.3.2/src/expr/range.c 2026-08-31 19:14:29.766427696 +0200 @@ -23,8 +23,9 @@ enum nft_range_ops op; }; -static int nftnl_expr_range_set(struct nftnl_expr *e, uint16_t type, - const void *data, uint32_t data_len) +static int +nftnl_expr_range_set(struct nftnl_expr *e, uint16_t type, + const void *data, uint32_t data_len, uint32_t byteorder) { struct nftnl_expr_range *range = nftnl_expr_data(e); @@ -36,9 +37,11 @@ memcpy(&range->op, data, data_len); break; case NFTNL_EXPR_RANGE_FROM_DATA: - return nftnl_data_cpy(&range->data_from, data, data_len); + return nftnl_data_cpy(&range->data_from, data, + data_len, byteorder, NULL); case NFTNL_EXPR_RANGE_TO_DATA: - return nftnl_data_cpy(&range->data_to, data, data_len); + return nftnl_data_cpy(&range->data_to, data, + data_len, byteorder, NULL); } return 0; } @@ -176,10 +179,16 @@ 0, DATA_VALUE); SNPRINTF_BUFFER_SIZE(ret, remain, offset); + ret = snprintf(buf + offset, remain, " "); + SNPRINTF_BUFFER_SIZE(ret, remain, offset); + ret = nftnl_data_reg_snprintf(buf + offset, remain, &range->data_to, 0, DATA_VALUE); SNPRINTF_BUFFER_SIZE(ret, remain, offset); + ret = snprintf(buf + offset, remain, " "); + SNPRINTF_BUFFER_SIZE(ret, remain, offset); + return offset; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnftnl-1.3.1/src/expr/redir.c new/libnftnl-1.3.2/src/expr/redir.c --- old/libnftnl-1.3.1/src/expr/redir.c 2025-12-03 13:01:22.062555150 +0100 +++ new/libnftnl-1.3.2/src/expr/redir.c 2026-08-31 19:14:29.766427696 +0200 @@ -24,7 +24,7 @@ static int nftnl_expr_redir_set(struct nftnl_expr *e, uint16_t type, - const void *data, uint32_t data_len) + const void *data, uint32_t data_len, uint32_t byteorder) { struct nftnl_expr_redir *redir = nftnl_expr_data(e); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnftnl-1.3.1/src/expr/reject.c new/libnftnl-1.3.2/src/expr/reject.c --- old/libnftnl-1.3.1/src/expr/reject.c 2025-12-03 13:01:22.062555150 +0100 +++ new/libnftnl-1.3.2/src/expr/reject.c 2026-08-31 19:14:29.766427696 +0200 @@ -22,8 +22,9 @@ uint8_t icmp_code; }; -static int nftnl_expr_reject_set(struct nftnl_expr *e, uint16_t type, - const void *data, uint32_t data_len) +static int +nftnl_expr_reject_set(struct nftnl_expr *e, uint16_t type, + const void *data, uint32_t data_len, uint32_t byteorder) { struct nftnl_expr_reject *reject = nftnl_expr_data(e); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnftnl-1.3.1/src/expr/rt.c new/libnftnl-1.3.2/src/expr/rt.c --- old/libnftnl-1.3.1/src/expr/rt.c 2025-12-03 13:01:22.062555150 +0100 +++ new/libnftnl-1.3.2/src/expr/rt.c 2026-08-31 19:14:29.766427696 +0200 @@ -22,7 +22,7 @@ static int nftnl_expr_rt_set(struct nftnl_expr *e, uint16_t type, - const void *data, uint32_t data_len) + const void *data, uint32_t data_len, uint32_t byteorder) { struct nftnl_expr_rt *rt = nftnl_expr_data(e); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnftnl-1.3.1/src/expr/socket.c new/libnftnl-1.3.2/src/expr/socket.c --- old/libnftnl-1.3.1/src/expr/socket.c 2025-12-03 13:01:22.062555150 +0100 +++ new/libnftnl-1.3.2/src/expr/socket.c 2026-08-31 19:14:29.766427696 +0200 @@ -23,7 +23,7 @@ static int nftnl_expr_socket_set(struct nftnl_expr *e, uint16_t type, - const void *data, uint32_t data_len) + const void *data, uint32_t data_len, uint32_t byteorder) { struct nftnl_expr_socket *socket = nftnl_expr_data(e); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnftnl-1.3.1/src/expr/synproxy.c new/libnftnl-1.3.2/src/expr/synproxy.c --- old/libnftnl-1.3.1/src/expr/synproxy.c 2025-12-03 13:01:22.062555150 +0100 +++ new/libnftnl-1.3.2/src/expr/synproxy.c 2026-08-31 19:14:29.766427696 +0200 @@ -16,8 +16,9 @@ uint32_t flags; }; -static int nftnl_expr_synproxy_set(struct nftnl_expr *e, uint16_t type, - const void *data, uint32_t data_len) +static int +nftnl_expr_synproxy_set(struct nftnl_expr *e, uint16_t type, + const void *data, uint32_t data_len, uint32_t byteorder) { struct nftnl_expr_synproxy *synproxy = nftnl_expr_data(e); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnftnl-1.3.1/src/expr/target.c new/libnftnl-1.3.2/src/expr/target.c --- old/libnftnl-1.3.1/src/expr/target.c 2025-12-03 13:01:22.062555150 +0100 +++ new/libnftnl-1.3.2/src/expr/target.c 2026-08-31 19:14:29.766427696 +0200 @@ -32,7 +32,7 @@ static int nftnl_expr_target_set(struct nftnl_expr *e, uint16_t type, - const void *data, uint32_t data_len) + const void *data, uint32_t data_len, uint32_t byteorder) { struct nftnl_expr_target *tg = nftnl_expr_data(e); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnftnl-1.3.1/src/expr/tproxy.c new/libnftnl-1.3.2/src/expr/tproxy.c --- old/libnftnl-1.3.1/src/expr/tproxy.c 2025-12-03 13:01:22.062555150 +0100 +++ new/libnftnl-1.3.2/src/expr/tproxy.c 2026-08-31 19:14:29.766427696 +0200 @@ -24,7 +24,7 @@ static int nftnl_expr_tproxy_set(struct nftnl_expr *e, uint16_t type, - const void *data, uint32_t data_len) + const void *data, uint32_t data_len, uint32_t byteorder) { struct nftnl_expr_tproxy *tproxy = nftnl_expr_data(e); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnftnl-1.3.1/src/expr/tunnel.c new/libnftnl-1.3.2/src/expr/tunnel.c --- old/libnftnl-1.3.1/src/expr/tunnel.c 2025-12-03 13:01:22.062555150 +0100 +++ new/libnftnl-1.3.2/src/expr/tunnel.c 2026-08-31 19:14:29.766427696 +0200 @@ -20,8 +20,9 @@ enum nft_registers dreg; }; -static int nftnl_expr_tunnel_set(struct nftnl_expr *e, uint16_t type, - const void *data, uint32_t data_len) +static int +nftnl_expr_tunnel_set(struct nftnl_expr *e, uint16_t type, + const void *data, uint32_t data_len, uint32_t byteorder) { struct nftnl_expr_tunnel *tunnel = nftnl_expr_data(e); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnftnl-1.3.1/src/expr/xfrm.c new/libnftnl-1.3.2/src/expr/xfrm.c --- old/libnftnl-1.3.1/src/expr/xfrm.c 2025-12-03 13:01:22.062555150 +0100 +++ new/libnftnl-1.3.2/src/expr/xfrm.c 2026-08-31 19:14:29.766427696 +0200 @@ -22,7 +22,7 @@ static int nftnl_expr_xfrm_set(struct nftnl_expr *e, uint16_t type, - const void *data, uint32_t data_len) + const void *data, uint32_t data_len, uint32_t byteorder) { struct nftnl_expr_xfrm *x = nftnl_expr_data(e); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnftnl-1.3.1/src/expr.c new/libnftnl-1.3.2/src/expr.c --- old/libnftnl-1.3.1/src/expr.c 2025-12-03 13:01:22.058555121 +0100 +++ new/libnftnl-1.3.2/src/expr.c 2026-08-31 19:14:29.766427696 +0200 @@ -59,9 +59,9 @@ return expr->flags & (1 << type); } -EXPORT_SYMBOL(nftnl_expr_set); -int nftnl_expr_set(struct nftnl_expr *expr, uint16_t type, - const void *data, uint32_t data_len) +static int __nftnl_expr_set(struct nftnl_expr *expr, uint16_t type, + const void *data, uint32_t data_len, + uint32_t byteorder) { switch(type) { case NFTNL_EXPR_NAME: /* cannot be modified */ @@ -77,13 +77,27 @@ expr->ops->attr_policy[type].maxlen < data_len) return -1; - if (expr->ops->set(expr, type, data, data_len) < 0) + if (expr->ops->set(expr, type, data, data_len, byteorder) < 0) return -1; } expr->flags |= (1 << type); return 0; } +EXPORT_SYMBOL(nftnl_expr_set); +int nftnl_expr_set(struct nftnl_expr *expr, uint16_t type, + const void *data, uint32_t data_len) +{ + return __nftnl_expr_set(expr, type, data, data_len, 0); +} + +EXPORT_SYMBOL(nftnl_expr_set_imm); +int nftnl_expr_set_imm(struct nftnl_expr *expr, uint16_t type, + const void *data, uint32_t data_len, uint32_t byteorder) +{ + return __nftnl_expr_set(expr, type, data, data_len, byteorder); +} + EXPORT_SYMBOL(nftnl_expr_set_u8); void nftnl_expr_set_u8(struct nftnl_expr *expr, uint16_t type, uint8_t data) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnftnl-1.3.1/src/libnftnl.map new/libnftnl-1.3.2/src/libnftnl.map --- old/libnftnl-1.3.1/src/libnftnl.map 2025-12-03 13:01:22.062555150 +0100 +++ new/libnftnl-1.3.2/src/libnftnl.map 2026-08-31 19:14:29.766427696 +0200 @@ -399,3 +399,8 @@ nftnl_tunnel_opts_add; nftnl_tunnel_opts_free; } LIBNFTNL_17; + +LIBNFTNL_19 { + nftnl_expr_set_imm; + nftnl_set_elem_set_imm; +} LIBNFTNL_18; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnftnl-1.3.1/src/obj/connlimit.c new/libnftnl-1.3.2/src/obj/connlimit.c --- old/libnftnl-1.3.1/src/obj/connlimit.c 1970-01-01 01:00:00.000000000 +0100 +++ new/libnftnl-1.3.2/src/obj/connlimit.c 2026-08-31 19:14:29.766427696 +0200 @@ -0,0 +1,129 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* + * (C) 2025 by Fernando Fernandez Mancera <[email protected]> + */ + +#include <stdio.h> +#include <stdint.h> +#include <arpa/inet.h> + +#include <linux/netfilter/nf_tables.h> + +#include <internal.h> +#include <libmnl/libmnl.h> +#include <libnftnl/object.h> + +#include "obj.h" + +static int nftnl_obj_connlimit_set(struct nftnl_obj *e, uint16_t type, + const void *data, uint32_t data_len) +{ + struct nftnl_obj_connlimit *connlimit = nftnl_obj_data(e); + + switch(type) { + case NFTNL_OBJ_CONNLIMIT_COUNT: + memcpy(&connlimit->count, data, data_len); + break; + case NFTNL_OBJ_CONNLIMIT_FLAGS: + memcpy(&connlimit->flags, data, data_len); + break; + } + return 0; +} + +static const void *nftnl_obj_connlimit_get(const struct nftnl_obj *e, + uint16_t type, uint32_t *data_len) +{ + struct nftnl_obj_connlimit *connlimit = nftnl_obj_data(e); + + switch (type) { + case NFTNL_OBJ_CONNLIMIT_COUNT: + *data_len = sizeof(connlimit->count); + return &connlimit->count; + case NFTNL_OBJ_CONNLIMIT_FLAGS: + *data_len = sizeof(connlimit->flags); + return &connlimit->flags; + } + return NULL; +} + +static int nftnl_obj_connlimit_cb(const struct nlattr *attr, void *data) +{ + int type = mnl_attr_get_type(attr); + const struct nlattr **tb = data; + + if (mnl_attr_type_valid(attr, NFTA_CONNLIMIT_MAX) < 0) + return MNL_CB_OK; + + switch (type) { + case NFTA_CONNLIMIT_COUNT: + case NFTA_CONNLIMIT_FLAGS: + if (mnl_attr_validate(attr, MNL_TYPE_U32) < 0) + abi_breakage(); + break; + } + + tb[type] = attr; + return MNL_CB_OK; +} + +static void nftnl_obj_connlimit_build(struct nlmsghdr *nlh, + const struct nftnl_obj *e) +{ + struct nftnl_obj_connlimit *connlimit = nftnl_obj_data(e); + + if (e->flags & (1 << NFTNL_OBJ_CONNLIMIT_COUNT)) + mnl_attr_put_u32(nlh, NFTA_CONNLIMIT_COUNT, + htonl(connlimit->count)); + if (e->flags & (1 << NFTNL_OBJ_CONNLIMIT_FLAGS)) + mnl_attr_put_u32(nlh, NFTA_CONNLIMIT_FLAGS, + htonl(connlimit->flags)); +} + +static int nftnl_obj_connlimit_parse(struct nftnl_obj *e, struct nlattr *attr) +{ + struct nftnl_obj_connlimit *connlimit = nftnl_obj_data(e); + struct nlattr *tb[NFTA_CONNLIMIT_MAX + 1] = {}; + + if (mnl_attr_parse_nested(attr, nftnl_obj_connlimit_cb, tb) < 0) + return -1; + + if (tb[NFTA_CONNLIMIT_COUNT]) { + connlimit->count = ntohl(mnl_attr_get_u32(tb[NFTA_CONNLIMIT_COUNT])); + e->flags |= (1 << NFTNL_OBJ_CONNLIMIT_COUNT); + } + if (tb[NFTA_CONNLIMIT_FLAGS]) { + connlimit->flags = ntohl(mnl_attr_get_u32(tb[NFTA_CONNLIMIT_FLAGS])); + e->flags |= (1 << NFTNL_OBJ_CONNLIMIT_FLAGS); + } + + return 0; +} + +static int nftnl_obj_connlimit_snprintf(char *buf, size_t len, + uint32_t flags, + const struct nftnl_obj *e) +{ + struct nftnl_obj_connlimit *connlimit = nftnl_obj_data(e); + + return snprintf(buf, len, "count %u flags %x ", + connlimit->count, connlimit->flags); +} + +static struct attr_policy obj_connlimit_attr_policy[__NFTNL_OBJ_CONNLIMIT_MAX] = { + [NFTNL_OBJ_CONNLIMIT_COUNT] = { .maxlen = sizeof(uint32_t) }, + [NFTNL_OBJ_CONNLIMIT_FLAGS] = { .maxlen = sizeof(uint32_t) }, +}; + +struct obj_ops obj_ops_connlimit = { + .name = "connlimit", + .type = NFT_OBJECT_CONNLIMIT, + .alloc_len = sizeof(struct nftnl_obj_connlimit), + .nftnl_max_attr = __NFTNL_OBJ_CONNLIMIT_MAX, + .attr_policy = obj_connlimit_attr_policy, + .set = nftnl_obj_connlimit_set, + .get = nftnl_obj_connlimit_get, + .parse = nftnl_obj_connlimit_parse, + .build = nftnl_obj_connlimit_build, + .output = nftnl_obj_connlimit_snprintf, +}; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnftnl-1.3.1/src/obj/tunnel.c new/libnftnl-1.3.2/src/obj/tunnel.c --- old/libnftnl-1.3.1/src/obj/tunnel.c 2025-12-03 13:01:22.062555150 +0100 +++ new/libnftnl-1.3.2/src/obj/tunnel.c 2026-08-31 19:14:29.766427696 +0200 @@ -596,6 +596,11 @@ if (tb[NFTA_TUNNEL_KEY_GENEVE_DATA]) { uint32_t len = mnl_attr_get_payload_len(tb[NFTA_TUNNEL_KEY_GENEVE_DATA]); + if (len > NFTNL_TUNNEL_GENEVE_DATA_MAXLEN) { + free(opt); + return -1; + } + memcpy(opt->geneve.data, mnl_attr_get_payload(tb[NFTA_TUNNEL_KEY_GENEVE_DATA]), len); @@ -861,9 +866,17 @@ { switch(type) { case NFTNL_TUNNEL_GENEVE_CLASS: + if (data_len != sizeof(uint16_t)) { + errno = EINVAL; + return -1; + } memcpy(&opt->geneve.geneve_class, data, data_len); break; case NFTNL_TUNNEL_GENEVE_TYPE: + if (data_len != sizeof(uint8_t)) { + errno = EINVAL; + return -1; + } memcpy(&opt->geneve.type, data, data_len); break; case NFTNL_TUNNEL_GENEVE_DATA: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnftnl-1.3.1/src/object.c new/libnftnl-1.3.2/src/object.c --- old/libnftnl-1.3.1/src/object.c 2025-12-03 13:01:22.062555150 +0100 +++ new/libnftnl-1.3.2/src/object.c 2026-08-31 19:14:29.766427696 +0200 @@ -30,6 +30,7 @@ [NFT_OBJECT_SECMARK] = &obj_ops_secmark, [NFT_OBJECT_CT_EXPECT] = &obj_ops_ct_expect, [NFT_OBJECT_SYNPROXY] = &obj_ops_synproxy, + [NFT_OBJECT_CONNLIMIT] = &obj_ops_connlimit, }; static struct obj_ops *nftnl_obj_ops_lookup(uint32_t type) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnftnl-1.3.1/src/rule.c new/libnftnl-1.3.2/src/rule.c --- old/libnftnl-1.3.1/src/rule.c 2025-12-03 13:01:22.062555150 +0100 +++ new/libnftnl-1.3.2/src/rule.c 2026-08-31 19:14:29.766427696 +0200 @@ -509,8 +509,8 @@ uint32_t type, uint32_t flags) { struct nftnl_expr *expr; - int ret, offset = 0, i; const char *sep = ""; + int ret, offset = 0; if (r->flags & (1 << NFTNL_RULE_FAMILY)) { ret = snprintf(buf + offset, remain, "%s%s", sep, @@ -573,21 +573,10 @@ } if (r->user.len) { - ret = snprintf(buf + offset, remain, "\n userdata = { "); - SNPRINTF_BUFFER_SIZE(ret, remain, offset); - - for (i = 0; i < r->user.len; i++) { - char *c = r->user.data; - - ret = snprintf(buf + offset, remain, - isprint(c[i]) ? "%c" : "\\x%02hhx", - c[i]); - SNPRINTF_BUFFER_SIZE(ret, remain, offset); - } - - ret = snprintf(buf + offset, remain, " }"); + ret = snprintf(buf + offset, remain, + "\n userdata len %d sum 0x%x", + r->user.len, bytesum(r->user.data, r->user.len)); SNPRINTF_BUFFER_SIZE(ret, remain, offset); - } return offset; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnftnl-1.3.1/src/set.c new/libnftnl-1.3.2/src/set.c --- old/libnftnl-1.3.1/src/set.c 2025-12-03 13:01:22.062555150 +0100 +++ new/libnftnl-1.3.2/src/set.c 2026-08-31 19:14:29.766427696 +0200 @@ -360,45 +360,6 @@ return val ? *val : 0; } -struct nftnl_set *nftnl_set_clone(const struct nftnl_set *set) -{ - struct nftnl_set *newset; - struct nftnl_set_elem *elem, *newelem; - - newset = nftnl_set_alloc(); - if (newset == NULL) - return NULL; - - memcpy(newset, set, sizeof(*set)); - - if (set->flags & (1 << NFTNL_SET_TABLE)) { - newset->table = strdup(set->table); - if (!newset->table) - goto err; - } - if (set->flags & (1 << NFTNL_SET_NAME)) { - newset->name = strdup(set->name); - if (!newset->name) - goto err; - } - - INIT_LIST_HEAD(&newset->element_list); - list_for_each_entry(elem, &set->element_list, head) { - newelem = nftnl_set_elem_clone(elem); - if (newelem == NULL) - goto err; - - list_add_tail(&newelem->head, &newset->element_list); - } - - newset->type = NULL; - - return newset; -err: - nftnl_set_free(newset); - return NULL; -} - static void nftnl_set_nlmsg_build_desc_size_payload(struct nlmsghdr *nlh, struct nftnl_set *s) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnftnl-1.3.1/src/set_elem.c new/libnftnl-1.3.2/src/set_elem.c --- old/libnftnl-1.3.1/src/set_elem.c 2025-12-03 13:01:22.062555150 +0100 +++ new/libnftnl-1.3.2/src/set_elem.c 2026-08-31 19:14:29.766427696 +0200 @@ -108,9 +108,9 @@ [NFTNL_SET_ELEM_EXPIRATION] = sizeof(uint64_t), }; -EXPORT_SYMBOL(nftnl_set_elem_set); -int nftnl_set_elem_set(struct nftnl_set_elem *s, uint16_t attr, - const void *data, uint32_t data_len) +static int +__nftnl_set_elem_set(struct nftnl_set_elem *s, uint16_t attr, const void *data, + uint32_t data_len, uint32_t byteorder, uint8_t *sizes) { struct nftnl_expr *expr, *tmp; @@ -122,11 +122,13 @@ memcpy(&s->set_elem_flags, data, sizeof(s->set_elem_flags)); break; case NFTNL_SET_ELEM_KEY: /* NFTA_SET_ELEM_KEY */ - if (nftnl_data_cpy(&s->key, data, data_len) < 0) + if (nftnl_data_cpy(&s->key, data, + data_len, byteorder, sizes) < 0) return -1; break; case NFTNL_SET_ELEM_KEY_END: /* NFTA_SET_ELEM_KEY_END */ - if (nftnl_data_cpy(&s->key_end, data, data_len) < 0) + if (nftnl_data_cpy(&s->key_end, data, + data_len, byteorder, sizes) < 0) return -1; break; case NFTNL_SET_ELEM_VERDICT: /* NFTA_SET_ELEM_DATA */ @@ -141,7 +143,8 @@ return -1; break; case NFTNL_SET_ELEM_DATA: /* NFTA_SET_ELEM_DATA */ - if (nftnl_data_cpy(&s->data, data, data_len) < 0) + if (nftnl_data_cpy(&s->data, data, + data_len, byteorder, sizes) < 0) return -1; break; case NFTNL_SET_ELEM_TIMEOUT: /* NFTA_SET_ELEM_TIMEOUT */ @@ -180,6 +183,21 @@ return 0; } +EXPORT_SYMBOL(nftnl_set_elem_set); +int nftnl_set_elem_set(struct nftnl_set_elem *s, uint16_t attr, + const void *data, uint32_t data_len) +{ + return __nftnl_set_elem_set(s, attr, data, data_len, 0, NULL); +} + +EXPORT_SYMBOL(nftnl_set_elem_set_imm); +int nftnl_set_elem_set_imm(struct nftnl_set_elem *s, uint16_t attr, + const void *data, uint32_t data_len, + uint32_t byteorder, uint8_t *sizes) +{ + return __nftnl_set_elem_set(s, attr, data, data_len, byteorder, sizes); +} + EXPORT_SYMBOL(nftnl_set_elem_set_u32); void nftnl_set_elem_set_u32(struct nftnl_set_elem *s, uint16_t attr, uint32_t val) { @@ -274,28 +292,6 @@ return val; } -struct nftnl_set_elem *nftnl_set_elem_clone(struct nftnl_set_elem *elem) -{ - struct nftnl_set_elem *newelem; - - newelem = nftnl_set_elem_alloc(); - if (newelem == NULL) - return NULL; - - memcpy(newelem, elem, sizeof(*elem)); - - if (elem->flags & (1 << NFTNL_SET_ELEM_CHAIN)) { - newelem->data.chain = strdup(elem->data.chain); - if (!newelem->data.chain) - goto err; - } - - return newelem; -err: - nftnl_set_elem_free(newelem); - return NULL; -} - EXPORT_SYMBOL(nftnl_set_elem_nlmsg_build_payload); void nftnl_set_elem_nlmsg_build_payload(struct nlmsghdr *nlh, struct nftnl_set_elem *e) @@ -687,7 +683,7 @@ int nftnl_set_elem_snprintf_default(char *buf, size_t remain, const struct nftnl_set_elem *e) { - int ret, dregtype = DATA_VALUE, offset = 0, i; + int ret, dregtype = DATA_NONE, offset = 0; ret = snprintf(buf, remain, "element "); SNPRINTF_BUFFER_SIZE(ret, remain, offset); @@ -705,33 +701,34 @@ SNPRINTF_BUFFER_SIZE(ret, remain, offset); } - ret = snprintf(buf + offset, remain, " : "); - SNPRINTF_BUFFER_SIZE(ret, remain, offset); - - if (e->flags & (1 << NFTNL_SET_ELEM_VERDICT)) + if (e->flags & (1 << NFTNL_SET_ELEM_DATA)) + dregtype = DATA_VALUE; + else if (e->flags & (1 << NFTNL_SET_ELEM_CHAIN)) + dregtype = DATA_CHAIN; + else if (e->flags & (1 << NFTNL_SET_ELEM_VERDICT)) dregtype = DATA_VERDICT; - ret = nftnl_data_reg_snprintf(buf + offset, remain, &e->data, - DATA_F_NOPFX, dregtype); - SNPRINTF_BUFFER_SIZE(ret, remain, offset); - - ret = snprintf(buf + offset, remain, "%u [end]", e->set_elem_flags); - SNPRINTF_BUFFER_SIZE(ret, remain, offset); - - if (e->user.len) { - ret = snprintf(buf + offset, remain, " userdata = { "); + if (dregtype != DATA_NONE) { + ret = snprintf(buf + offset, remain, " : "); SNPRINTF_BUFFER_SIZE(ret, remain, offset); - for (i = 0; i < e->user.len; i++) { - char *c = e->user.data; + ret = nftnl_data_reg_snprintf(buf + offset, remain, &e->data, + DATA_F_NOPFX, dregtype); + SNPRINTF_BUFFER_SIZE(ret, remain, offset); + } else if (e->flags & (1 << NFTNL_SET_ELEM_OBJREF)) { + ret = snprintf(buf + offset, remain, " : %s", e->objref); + SNPRINTF_BUFFER_SIZE(ret, remain, offset); + } - ret = snprintf(buf + offset, remain, - isprint(c[i]) ? "%c" : "\\x%02hhx", - c[i]); - SNPRINTF_BUFFER_SIZE(ret, remain, offset); - } + if (e->set_elem_flags) { + ret = snprintf(buf + offset, remain, " flags %u", e->set_elem_flags); + SNPRINTF_BUFFER_SIZE(ret, remain, offset); + } - ret = snprintf(buf + offset, remain, " }"); + if (e->user.len) { + ret = snprintf(buf + offset, remain, + " userdata len %d sum 0x%x", + e->user.len, bytesum(e->user.data, e->user.len)); SNPRINTF_BUFFER_SIZE(ret, remain, offset); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnftnl-1.3.1/tests/Makefile.in new/libnftnl-1.3.2/tests/Makefile.in --- old/libnftnl-1.3.1/tests/Makefile.in 2025-12-03 13:01:26.490586805 +0100 +++ new/libnftnl-1.3.2/tests/Makefile.in 2026-08-31 19:14:35.730485132 +0200 @@ -741,7 +741,7 @@ # set age to 0. # </snippet> # -LIBVERSION = 18:0:7 +LIBVERSION = 19:0:8 AM_CPPFLAGS = ${regular_CPPFLAGS} -I${top_srcdir}/include ${LIBMNL_CFLAGS} ${LIBMXML_CFLAGS} AM_CFLAGS = ${regular_CFLAGS} ${GCC_FVISIBILITY_HIDDEN} TESTS = $(check_PROGRAMS)
