[PATCH nft 1/3] netlink_delinearize: fix decoding of concat data element

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Its possible to use update as follows:

 meta l4proto tcp update @pinned { ip saddr . ct original proto-src : ip daddr . ct original proto-dst }

... but when listing, only the first element of the concatenation is
shown.

Check if the element size is too small and parse subsequent registers as
well.

Signed-off-by: Florian Westphal <fw@xxxxxxxxx>
---
 src/netlink_delinearize.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/netlink_delinearize.c b/src/netlink_delinearize.c
index 0b6cf1072294..376b3550f9e2 100644
--- a/src/netlink_delinearize.c
+++ b/src/netlink_delinearize.c
@@ -1660,6 +1660,14 @@ static void netlink_parse_dynset(struct netlink_parse_ctx *ctx,
 	if (nftnl_expr_is_set(nle, NFTNL_EXPR_DYNSET_SREG_DATA)) {
 		sreg_data = netlink_parse_register(nle, NFTNL_EXPR_DYNSET_SREG_DATA);
 		expr_data = netlink_get_register(ctx, loc, sreg_data);
+
+		if (expr_data->len < set->data->len) {
+			expr_free(expr_data);
+			expr_data = netlink_parse_concat_expr(ctx, loc, sreg_data, set->data->len);
+			if (expr_data == NULL)
+				netlink_error(ctx, loc,
+					      "Could not parse dynset map data expessions");
+		}
 	}
 
 	if (expr_data != NULL) {
-- 
2.38.1




[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux