diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2021-09-26 12:27:45 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2021-09-29 18:59:44 +0200 |
commit | d2fb4a860351a9fe77cdab37494328be3268d39b (patch) | |
tree | 0240198b7bce8a01c86d32374946e1191d4a14c6 | |
parent | ba786ac758fba55212e96110413514dba0025a80 (diff) |
monitor: honor NLM_F_EXCL netlink flag
This allow to report for the create command.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r-- | src/monitor.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/monitor.c b/src/monitor.c index ff69234b..8ecb7d19 100644 --- a/src/monitor.c +++ b/src/monitor.c @@ -44,6 +44,7 @@ enum { NFT_OF_EVENT_ADD, NFT_OF_EVENT_INSERT, NFT_OF_EVENT_DEL, + NFT_OF_EVENT_CREATE, }; #define nft_mon_print(monh, ...) nft_print(&monh->ctx->nft->output, __VA_ARGS__) @@ -140,7 +141,10 @@ static uint32_t netlink_msg2nftnl_of(uint32_t type, uint16_t flags) case NFT_MSG_NEWSETELEM: case NFT_MSG_NEWOBJ: case NFT_MSG_NEWFLOWTABLE: - return NFT_OF_EVENT_ADD; + if (flags & NLM_F_EXCL) + return NFT_OF_EVENT_CREATE; + else + return NFT_OF_EVENT_ADD; case NFT_MSG_DELTABLE: case NFT_MSG_DELCHAIN: case NFT_MSG_DELSET: @@ -159,6 +163,8 @@ static const char *nftnl_of2cmd(uint32_t of) switch (of) { case NFT_OF_EVENT_ADD: return "add"; + case NFT_OF_EVENT_CREATE: + return "create"; case NFT_OF_EVENT_INSERT: return "insert"; case NFT_OF_EVENT_DEL: |