Skip to contentSkip to conversation

ruleset: deconstify _get interface

PATCH Applied Arturo Borrero Gonzalez 2 participants 2 messages Oct 20, 2014 – Oct 24, 2014 netfilter

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ruleset: deconstify _get interface

Having this interface returning a const pointer makes very hard to modificate the content of a chain contained in a nft_ruleset.

---

Note: I ignore how this affects the current, already released API.

 include/libnftnl/ruleset.h |    2 +-
 src/ruleset.c              |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
include/libnftnl/ruleset.h +1 -1
index 6f89110..1a3e22f 100644
@@ -28,7 +28,7 @@ enum {
 bool nft_ruleset_attr_is_set(const struct nft_ruleset *r, uint16_t attr);
 void nft_ruleset_attr_unset(struct nft_ruleset *r, uint16_t attr);
 void nft_ruleset_attr_set(struct nft_ruleset *r, uint16_t attr, void *data);
-const void *nft_ruleset_attr_get(const struct nft_ruleset *r, uint16_t attr);
+void *nft_ruleset_attr_get(const struct nft_ruleset *r, uint16_t attr);
 
 int nft_ruleset_parse(struct nft_ruleset *rs, enum nft_parse_type type,
 		      const char *data, struct nft_parse_err *err);
src/ruleset.c +1 -1
index 4cfeee6..6bb7582 100644
@@ -111,7 +111,7 @@ void nft_ruleset_attr_set(struct nft_ruleset *r, uint16_t attr, void *data)
 }
 EXPORT_SYMBOL(nft_ruleset_attr_set);
 
-const void *nft_ruleset_attr_get(const struct nft_ruleset *r, uint16_t attr)
+void *nft_ruleset_attr_get(const struct nft_ruleset *r, uint16_t attr)
 {
 	if (!(r->flags & (1 << attr)))
 		return NULL;
maintainer Applied
#1 lore raw
Quoted 2 lines · Arturo Borrero Gonzalez

Having this interface returning a const pointer makes very hard to modificate the content of a chain contained in a nft_ruleset.

Applied, thanks.