This patch adds a new rule attribute NFTA_RULE_POSITION which is used to store the position of a rule relatively to the others. By providing the create command and specifying the position, the rule is inserted after the rule with the handle equal to the provided position. Regarding notification, the position attribute specifies the handle of the previous rule to make sure we don't point to any stale rule in notifications coming from the commit path. This patch includes the following fix from Pablo: * nf_tables: fix rule deletion event reporting
Showing the changes to include/uapi/linux (1 of 2 files). Show all
Unified · Split
| @@ -153,6 +153,7 @@ enum nft_chain_attributes { · 152 unmodified lines | ||
| 153 | 153 | * @NFTA_RULE_HANDLE: numeric handle of the rule (NLA_U64) |
| 154 | 154 | * @NFTA_RULE_EXPRESSIONS: list of expressions (NLA_NESTED: nft_expr_attributes) |
| 155 | 155 | * @NFTA_RULE_COMPAT: compatibility specifications of the rule (NLA_NESTED: nft_rule_compat_attributes) |
| 156 | + * @NFTA_RULE_POSITION: numeric handle of the previous rule (NLA_U64) | |
| 156 | 157 | */ |
| 157 | 158 | enum nft_rule_attributes { |
| 158 | 159 | NFTA_RULE_UNSPEC, |
| @@ -161,6 +162,7 @@ enum nft_rule_attributes { · 2 unmodified lines | ||
| 161 | 162 | NFTA_RULE_HANDLE, |
| 162 | 163 | NFTA_RULE_EXPRESSIONS, |
| 163 | 164 | NFTA_RULE_COMPAT, |
| 165 | + NFTA_RULE_POSITION, | |
| 164 | 166 | __NFTA_RULE_MAX |
| 165 | 167 | }; |
| 166 | 168 | #define NFTA_RULE_MAX (__NFTA_RULE_MAX - 1) |