From 8f4de3888ce74607d4754fe5a1a8f470af409c09 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Fri, 10 Jun 2016 14:30:56 +0200 Subject: src: return value on setters that internally allocate memory So the client can bail out of memory allocation errors. Or in case of daemon, make sure things are left in consistent state before bailing out. Signed-off-by: Pablo Neira Ayuso --- include/libnftnl/table.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include/libnftnl/table.h') diff --git a/include/libnftnl/table.h b/include/libnftnl/table.h index 8972d09..1f9ab1c 100644 --- a/include/libnftnl/table.h +++ b/include/libnftnl/table.h @@ -29,15 +29,15 @@ enum nftnl_table_attr { bool nftnl_table_is_set(const struct nftnl_table *t, uint16_t attr); void nftnl_table_unset(struct nftnl_table *t, uint16_t attr); void nftnl_table_set(struct nftnl_table *t, uint16_t attr, const void *data); -void nftnl_table_set_data(struct nftnl_table *t, uint16_t attr, - const void *data, uint32_t data_len); +int nftnl_table_set_data(struct nftnl_table *t, uint16_t attr, + const void *data, uint32_t data_len); const void *nftnl_table_get(const struct nftnl_table *t, uint16_t attr); const void *nftnl_table_get_data(const struct nftnl_table *t, uint16_t attr, uint32_t *data_len); void nftnl_table_set_u8(struct nftnl_table *t, uint16_t attr, uint8_t data); void nftnl_table_set_u32(struct nftnl_table *t, uint16_t attr, uint32_t data); -void nftnl_table_set_str(struct nftnl_table *t, uint16_t attr, const char *str); +int nftnl_table_set_str(struct nftnl_table *t, uint16_t attr, const char *str); uint8_t nftnl_table_get_u8(const struct nftnl_table *t, uint16_t attr); uint32_t nftnl_table_get_u32(const struct nftnl_table *t, uint16_t attr); const char *nftnl_table_get_str(const struct nftnl_table *t, uint16_t attr); -- cgit v1.2.3