diff options
author | Phil Sutter <phil@nwl.cc> | 2017-07-28 13:55:45 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2017-08-02 15:03:31 +0200 |
commit | 119a49a5354c16208ec1bd24500a180bcbe86cd2 (patch) | |
tree | 82725fad78b85841ddda3e2d2794824f00a9f39d /src/mnl.c | |
parent | aa4125a0561d7ea656aecfe64670b4ad82d1010b (diff) |
mnl: Consolidate mnl_batch_talk() parameters
The single caller of this function passes struct netlink_ctx fields as
the first two parameters. This can be simplified by passing the context
object itself and having mnl_batch_talk() access it's fields instead.
Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/mnl.c')
-rw-r--r-- | src/mnl.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -246,9 +246,9 @@ static ssize_t mnl_nft_socket_sendmsg(const struct mnl_socket *nl, return sendmsg(mnl_socket_get_fd(nl), &msg, 0); } -int mnl_batch_talk(struct mnl_socket *nl, struct nftnl_batch *batch, - struct list_head *err_list) +int mnl_batch_talk(struct netlink_ctx *ctx, struct list_head *err_list) { + struct mnl_socket *nl = ctx->nf_sock; int ret, fd = mnl_socket_get_fd(nl), portid = mnl_socket_get_portid(nl); char rcv_buf[MNL_SOCKET_BUFFER_SIZE]; fd_set readfds; @@ -257,7 +257,7 @@ int mnl_batch_talk(struct mnl_socket *nl, struct nftnl_batch *batch, .tv_usec = 0 }; - ret = mnl_nft_socket_sendmsg(nl, batch); + ret = mnl_nft_socket_sendmsg(nl, ctx->batch); if (ret == -1) return -1; |