From 26db6cd9061757d9548cfadc4f921caa1aa6aff7 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Mon, 19 Oct 2020 23:51:16 +0200 Subject: 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 --- include/rule.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include/rule.h') diff --git a/include/rule.h b/include/rule.h index 10e71047..119fc19d 100644 --- a/include/rule.h +++ b/include/rule.h @@ -704,8 +704,8 @@ struct cmd { struct obj *object; }; struct { - uint16_t offset; - struct location *location; + uint16_t offset; + const struct location *location; } attr[NFT_NLATTR_LOC_MAX]; int num_attrs; const void *arg; @@ -720,7 +720,7 @@ extern struct cmd *cmd_alloc_obj_ct(enum cmd_ops op, int type, const struct location *loc, struct obj *obj); extern void cmd_free(struct cmd *cmd); -void cmd_add_loc(struct cmd *cmd, uint16_t offset, struct location *loc); +void cmd_add_loc(struct cmd *cmd, uint16_t offset, const struct location *loc); #include #include -- cgit v1.2.3