History

netfilter: nf_tables: add insert operation

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

Eric Leblond committed 13 years ago

Commit 5e948461 parent 99633ab2 files · +34 −6Browse files

Showing the changes to include/uapi/linux (1 of 2 files). Show all

Unified · Split

include/uapi/linux/netfilter/nf_tables.h+2−0
@@ -153,6 +153,7 @@ enum nft_chain_attributes { · 152 unmodified lines
153 * @NFTA_RULE_HANDLE: numeric handle of the rule (NLA_U64)153 * @NFTA_RULE_HANDLE: numeric handle of the rule (NLA_U64)
154 * @NFTA_RULE_EXPRESSIONS: list of expressions (NLA_NESTED: nft_expr_attributes)154 * @NFTA_RULE_EXPRESSIONS: list of expressions (NLA_NESTED: nft_expr_attributes)
155 * @NFTA_RULE_COMPAT: compatibility specifications of the rule (NLA_NESTED: nft_rule_compat_attributes)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 */
157enum nft_rule_attributes {158enum nft_rule_attributes {
158 NFTA_RULE_UNSPEC,159 NFTA_RULE_UNSPEC,
@@ -161,6 +162,7 @@ enum nft_rule_attributes { · 2 unmodified lines
161 NFTA_RULE_HANDLE,162 NFTA_RULE_HANDLE,
162 NFTA_RULE_EXPRESSIONS,163 NFTA_RULE_EXPRESSIONS,
163 NFTA_RULE_COMPAT,164 NFTA_RULE_COMPAT,
165 NFTA_RULE_POSITION,
164 __NFTA_RULE_MAX166 __NFTA_RULE_MAX
165};167};
166#define NFTA_RULE_MAX (__NFTA_RULE_MAX - 1)168#define NFTA_RULE_MAX (__NFTA_RULE_MAX - 1)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t