]> git.ipfire.org Git - thirdparty/nftables.git/commit
datatype: fix table listing if name resolution is not available
authorPablo Neira Ayuso <pablo@netfilter.org>
Sat, 6 Jul 2013 14:38:18 +0000 (16:38 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Sat, 6 Jul 2013 14:47:28 +0000 (16:47 +0200)
commitcdc8e6f7e27dcd552d820ce97871b6486d0fea0c
tree0d99430f56aa2b781289818343afe30303c4ad3f
parentda015ff415f021294aed8668ddf212acb279cd68
datatype: fix table listing if name resolution is not available

nft list table filter returns garbage here for IP and IPv6 addresses if
no name resolution is available. The output looks good if `-n' is used
in that case.

The problem is that getnameinfo() returns:

EAI_AGAIN   -3    /* Temporary failure in name resolution.  */

Without working name resolution. To fix this, force a fall back to
numeric resolution in that case.

While at it, fix also possible resolution of services in case of
that /etc/services is missing in the system.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/datatype.c