diff mbox series

[libnftnl] chain: Removed non-defined functions

Message ID f5b5ce9e42b038cb43064764385813fedd556bf1.1703646281.git.nvinson234@gmail.com
State Accepted
Headers show
Series [libnftnl] chain: Removed non-defined functions | expand

Commit Message

Nicholas Vinson Dec. 27, 2023, 3:05 a.m. UTC
The functions nftnl_chain_parse(), nftnl_chain_parse_file(),
nftnl_set_elems_foreach(), and nftnl_obj_unset() are no longer defined
and removed from the code.

The functions nftnl_chain_parse(), nftnl_chain_parse_file() were removed
with commit 80077787f8f21da1efd8dc27a4c5767ab47a1df6.

The function nftnl_set_elems_foreach() does not appear to have ever been
defined.

The function nftnl_obj_unset() does not appear to have ever been
defined, but declared within commit
5573d0146c1ae71ac5b3e4ba6a12c00585646a1a

However, libnftnl.map still lists these functions which causes libnftnl
to fail to link with ld.lld as the option --undefined-version is
disabled by default.

Fixes Gentoo bug 914710 (https://bugs.gentoo.org/914710)

Signed-off-by: Nicholas Vinson <nvinson234@gmail.com>
---
 include/libnftnl/chain.h  | 4 ----
 include/libnftnl/object.h | 1 -
 src/libnftnl.map          | 5 -----
 3 files changed, 10 deletions(-)

Comments

Pablo Neira Ayuso Jan. 2, 2024, 1:27 p.m. UTC | #1
On Tue, Dec 26, 2023 at 10:05:17PM -0500, Nicholas Vinson wrote:
> The functions nftnl_chain_parse(), nftnl_chain_parse_file(),
> nftnl_set_elems_foreach(), and nftnl_obj_unset() are no longer defined
> and removed from the code.
> 
> The functions nftnl_chain_parse(), nftnl_chain_parse_file() were removed
> with commit 80077787f8f21da1efd8dc27a4c5767ab47a1df6.
> 
> The function nftnl_set_elems_foreach() does not appear to have ever been
> defined.
> 
> The function nftnl_obj_unset() does not appear to have ever been
> defined, but declared within commit
> 5573d0146c1ae71ac5b3e4ba6a12c00585646a1a

I have provided a patch to support nftnl_obj_unset() for consistency
with other existing objects.

Unless anyone says otherwise, I'll apply this with minor updates
(stripping of the nftnl_obj_unset() update), thanks.
diff mbox series

Patch

diff --git a/include/libnftnl/chain.h b/include/libnftnl/chain.h
index f56e581..bac1f5f 100644
--- a/include/libnftnl/chain.h
+++ b/include/libnftnl/chain.h
@@ -71,10 +71,6 @@  struct nlmsghdr;
 
 void nftnl_chain_nlmsg_build_payload(struct nlmsghdr *nlh, const struct nftnl_chain *t);
 
-int nftnl_chain_parse(struct nftnl_chain *c, enum nftnl_parse_type type,
-		    const char *data, struct nftnl_parse_err *err);
-int nftnl_chain_parse_file(struct nftnl_chain *c, enum nftnl_parse_type type,
-			 FILE *fp, struct nftnl_parse_err *err);
 int nftnl_chain_snprintf(char *buf, size_t size, const struct nftnl_chain *t, uint32_t type, uint32_t flags);
 int nftnl_chain_fprintf(FILE *fp, const struct nftnl_chain *c, uint32_t type, uint32_t flags);
 
diff --git a/include/libnftnl/object.h b/include/libnftnl/object.h
index 4b2d90f..94d6b94 100644
--- a/include/libnftnl/object.h
+++ b/include/libnftnl/object.h
@@ -122,7 +122,6 @@  struct nftnl_obj *nftnl_obj_alloc(void);
 void nftnl_obj_free(const struct nftnl_obj *ne);
 
 bool nftnl_obj_is_set(const struct nftnl_obj *ne, uint16_t attr);
-void nftnl_obj_unset(struct nftnl_obj *ne, uint16_t attr);
 void nftnl_obj_set_data(struct nftnl_obj *ne, uint16_t attr, const void *data,
 			uint32_t data_len);
 void nftnl_obj_set(struct nftnl_obj *ne, uint16_t attr, const void *data) __attribute__((deprecated));
diff --git a/src/libnftnl.map b/src/libnftnl.map
index ad8f2af..02d8b34 100644
--- a/src/libnftnl.map
+++ b/src/libnftnl.map
@@ -47,8 +47,6 @@  global:
   nftnl_chain_get_s32;
   nftnl_chain_get_u64;
   nftnl_chain_get_str;
-  nftnl_chain_parse;
-  nftnl_chain_parse_file;
   nftnl_chain_snprintf;
   nftnl_chain_fprintf;
   nftnl_chain_nlmsg_build_payload;
@@ -174,8 +172,6 @@  global:
   nftnl_set_elems_nlmsg_build_payload;
   nftnl_set_elems_nlmsg_parse;
 
-  nftnl_set_elems_foreach;
-
   nftnl_set_elems_iter_create;
   nftnl_set_elems_iter_cur;
   nftnl_set_elems_iter_next;
@@ -274,7 +270,6 @@  global:
   nftnl_obj_alloc;
   nftnl_obj_free;
   nftnl_obj_is_set;
-  nftnl_obj_unset;
   nftnl_obj_set;
   nftnl_obj_get;
   nftnl_obj_set_u8;