From 89688c947efc36d25c58c85650414fa3a491732e Mon Sep 17 00:00:00 2001 From: Florian Westphal Date: Tue, 14 Jun 2022 21:56:48 +0200 Subject: netlink_delinearize: postprocess binary ands in concatenations Input: update ether saddr . vlan id timeout 5s @macset ether saddr . vlan id @macset Before this patch, gets rendered as: update @macset { @ll,48,48 . @ll,112,16 & 0xfff timeout 5s } @ll,48,48 . @ll,112,16 & 0xfff @macset After this, listing will show: update @macset { @ll,48,48 . vlan id timeout 5s } @ll,48,48 . vlan id @macset The @ll, ... is due to vlan description replacing the ethernet one, so payload decode fails to take the concatenation apart (the ethernet header payload info is matched vs. vlan template). This will be adjusted by a followup patch. Signed-off-by: Florian Westphal --- include/netlink.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include') diff --git a/include/netlink.h b/include/netlink.h index e8e0f68a..71c888fa 100644 --- a/include/netlink.h +++ b/include/netlink.h @@ -42,10 +42,16 @@ struct netlink_parse_ctx { struct netlink_ctx *nlctx; }; + +#define RULE_PP_IN_CONCATENATION (1 << 0) + +#define RULE_PP_REMOVE_OP_AND (RULE_PP_IN_CONCATENATION) + struct rule_pp_ctx { struct proto_ctx pctx; struct payload_dep_ctx pdctx; struct stmt *stmt; + unsigned int flags; }; extern const struct input_descriptor indesc_netlink; -- cgit v1.2.3