79 lines
2.3 KiB
Diff
79 lines
2.3 KiB
Diff
|
From c2e328edd47ac3d3ed127b313d35ed05839441db Mon Sep 17 00:00:00 2001
|
||
|
From: Phil Sutter <psutter@redhat.com>
|
||
|
Date: Thu, 7 Nov 2024 18:38:45 +0100
|
||
|
Subject: [PATCH] mnl: rename to mnl_seqnum_alloc() to mnl_seqnum_inc()
|
||
|
|
||
|
JIRA: https://issues.redhat.com/browse/RHEL-65346
|
||
|
Upstream Status: nftables commit b4ce90d52d564efaced298f6e9c575d6942ecf91
|
||
|
|
||
|
commit b4ce90d52d564efaced298f6e9c575d6942ecf91
|
||
|
Author: Pablo Neira Ayuso <pablo@netfilter.org>
|
||
|
Date: Wed Oct 23 22:15:24 2024 +0200
|
||
|
|
||
|
mnl: rename to mnl_seqnum_alloc() to mnl_seqnum_inc()
|
||
|
|
||
|
rename mnl_seqnum_alloc() to mnl_seqnum_inc().
|
||
|
|
||
|
No functional change is intended.
|
||
|
|
||
|
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
||
|
|
||
|
Signed-off-by: Phil Sutter <psutter@redhat.com>
|
||
|
---
|
||
|
include/mnl.h | 2 +-
|
||
|
src/libnftables.c | 6 +++---
|
||
|
src/mnl.c | 2 +-
|
||
|
3 files changed, 5 insertions(+), 5 deletions(-)
|
||
|
|
||
|
diff --git a/include/mnl.h b/include/mnl.h
|
||
|
index c9502f3..7c465d4 100644
|
||
|
--- a/include/mnl.h
|
||
|
+++ b/include/mnl.h
|
||
|
@@ -8,7 +8,7 @@
|
||
|
|
||
|
struct mnl_socket *nft_mnl_socket_open(void);
|
||
|
|
||
|
-uint32_t mnl_seqnum_alloc(uint32_t *seqnum);
|
||
|
+uint32_t mnl_seqnum_inc(uint32_t *seqnum);
|
||
|
uint32_t mnl_genid_get(struct netlink_ctx *ctx);
|
||
|
|
||
|
struct mnl_err {
|
||
|
diff --git a/src/libnftables.c b/src/libnftables.c
|
||
|
index 2834c99..3550961 100644
|
||
|
--- a/src/libnftables.c
|
||
|
+++ b/src/libnftables.c
|
||
|
@@ -37,9 +37,9 @@ static int nft_netlink(struct nft_ctx *nft,
|
||
|
if (list_empty(cmds))
|
||
|
goto out;
|
||
|
|
||
|
- batch_seqnum = mnl_batch_begin(ctx.batch, mnl_seqnum_alloc(&seqnum));
|
||
|
+ batch_seqnum = mnl_batch_begin(ctx.batch, mnl_seqnum_inc(&seqnum));
|
||
|
list_for_each_entry(cmd, cmds, list) {
|
||
|
- ctx.seqnum = cmd->seqnum = mnl_seqnum_alloc(&seqnum);
|
||
|
+ ctx.seqnum = cmd->seqnum = mnl_seqnum_inc(&seqnum);
|
||
|
ret = do_command(&ctx, cmd);
|
||
|
if (ret < 0) {
|
||
|
netlink_io_error(&ctx, &cmd->location,
|
||
|
@@ -50,7 +50,7 @@ static int nft_netlink(struct nft_ctx *nft,
|
||
|
num_cmds++;
|
||
|
}
|
||
|
if (!nft->check)
|
||
|
- mnl_batch_end(ctx.batch, mnl_seqnum_alloc(&seqnum));
|
||
|
+ mnl_batch_end(ctx.batch, mnl_seqnum_inc(&seqnum));
|
||
|
|
||
|
if (!mnl_batch_ready(ctx.batch))
|
||
|
goto out;
|
||
|
diff --git a/src/mnl.c b/src/mnl.c
|
||
|
index db53a60..c1691da 100644
|
||
|
--- a/src/mnl.c
|
||
|
+++ b/src/mnl.c
|
||
|
@@ -70,7 +70,7 @@ struct mnl_socket *nft_mnl_socket_open(void)
|
||
|
return nf_sock;
|
||
|
}
|
||
|
|
||
|
-uint32_t mnl_seqnum_alloc(unsigned int *seqnum)
|
||
|
+uint32_t mnl_seqnum_inc(unsigned int *seqnum)
|
||
|
{
|
||
|
return (*seqnum)++;
|
||
|
}
|