diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2020-10-19 23:51:16 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2020-10-19 23:51:47 +0200 |
commit | 26db6cd9061757d9548cfadc4f921caa1aa6aff7 (patch) | |
tree | 87bdfc020f49110e8bd2da61cafd76a3e7d6777d /src/cmd.c | |
parent | 27362a5bfa4336476038cfe00a699f0b68a984aa (diff) |
src: constify location parameter in cmd_add_loc()
Constify pointer to location object to compile check for unintentional
updates.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/cmd.c')
-rw-r--r-- | src/cmd.c | 17 |
1 files changed, 9 insertions, 8 deletions
@@ -10,7 +10,7 @@ #include <string.h> static int nft_cmd_enoent_table(struct netlink_ctx *ctx, const struct cmd *cmd, - struct location *loc) + const struct location *loc) { struct table *table; @@ -25,7 +25,7 @@ static int nft_cmd_enoent_table(struct netlink_ctx *ctx, const struct cmd *cmd, } static int nft_cmd_enoent_chain(struct netlink_ctx *ctx, const struct cmd *cmd, - struct location *loc) + const struct location *loc) { const struct table *table; struct chain *chain; @@ -42,7 +42,7 @@ static int nft_cmd_enoent_chain(struct netlink_ctx *ctx, const struct cmd *cmd, } static int nft_cmd_enoent_rule(struct netlink_ctx *ctx, const struct cmd *cmd, - struct location *loc) + const struct location *loc) { unsigned int flags = NFT_CACHE_TABLE | NFT_CACHE_CHAIN; @@ -76,7 +76,7 @@ static int nft_cmd_enoent_rule(struct netlink_ctx *ctx, const struct cmd *cmd, } static int nft_cmd_enoent_set(struct netlink_ctx *ctx, const struct cmd *cmd, - struct location *loc) + const struct location *loc) { const struct table *table; struct set *set; @@ -95,7 +95,7 @@ static int nft_cmd_enoent_set(struct netlink_ctx *ctx, const struct cmd *cmd, } static int nft_cmd_enoent_obj(struct netlink_ctx *ctx, const struct cmd *cmd, - struct location *loc) + const struct location *loc) { const struct table *table; struct obj *obj; @@ -112,7 +112,8 @@ static int nft_cmd_enoent_obj(struct netlink_ctx *ctx, const struct cmd *cmd, } static int nft_cmd_enoent_flowtable(struct netlink_ctx *ctx, - const struct cmd *cmd, struct location *loc) + const struct cmd *cmd, + const struct location *loc) { const struct table *table; struct flowtable *ft; @@ -130,7 +131,7 @@ static int nft_cmd_enoent_flowtable(struct netlink_ctx *ctx, } static void nft_cmd_enoent(struct netlink_ctx *ctx, const struct cmd *cmd, - struct location *loc, int err) + const struct location *loc, int err) { int ret = 0; @@ -173,7 +174,7 @@ static void nft_cmd_enoent(struct netlink_ctx *ctx, const struct cmd *cmd, void nft_cmd_error(struct netlink_ctx *ctx, struct cmd *cmd, struct mnl_err *err) { - struct location *loc = NULL; + const struct location *loc = NULL; int i; for (i = 0; i < cmd->num_attrs; i++) { |