]> git.ipfire.org Git - thirdparty/nftables.git/commit
nftutils: add and use wrappers for getprotoby{name,number}_r(), getservbyport_r()
authorThomas Haller <thaller@redhat.com>
Fri, 18 Aug 2023 14:08:19 +0000 (16:08 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Sun, 20 Aug 2023 21:48:26 +0000 (23:48 +0200)
commit7076523e482110d59c4456f4a795581a2ca39c41
tree9b1cf7707f110fd3402dae19419b17722f66dfd2
parent4646d656466b1f05bd765bbfb4d6d7bf1529bdbd
nftutils: add and use wrappers for getprotoby{name,number}_r(), getservbyport_r()

We should aim to use the thread-safe variants of getprotoby{name,number}
and getservbyport(). However, they may not be available with other libc,
so it requires a configure check. As that is cumbersome, add wrappers
that do that at one place.

These wrappers are thread-safe, if libc provides the reentrant versions.
Use them.

Signed-off-by: Thomas Haller <thaller@redhat.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
configure.ac
src/Makefile.am
src/datatype.c
src/json.c
src/nftutils.c [new file with mode: 0644]
src/nftutils.h [new file with mode: 0644]
src/rule.c