Whamcloud - gitweb
LU-17186 utils: replace gethostby*() with get*info()
authorSebastien Buisson <sbuisson@ddn.com>
Fri, 8 Dec 2023 19:53:12 +0000 (11:53 -0800)
committerAndreas Dilger <adilger@whamcloud.com>
Tue, 2 Jan 2024 08:20:54 +0000 (08:20 +0000)
commit5aaa679d0c44a29f709bfd3a115371c313a098d1
tree9cdbe24d86602ea0973b9d9d67a2e0429ead9c50
parent2ac05bf278d478c88452abffa57d0f754096c333
LU-17186 utils: replace gethostby*() with get*info()

This patch replaces the deprecated gethostbyname() and
gethostbyaddr() functions with getaddrinfo() and getnameinfo()
functions respectively.

The getaddrinfo() function combines the functionality provided by the
gethostbyname() and getservbyname() functions into a single interface,
but unlike the latter functions, getaddrinfo() is reentrant and allows
programs to eliminate IPv4-versus-IPv6 dependencies.

The getnameinfo() function is the inverse of getaddrinfo(): it
converts a socket address to a corresponding host and service, in a
protocol-independent manner. It combines the functionality of
gethostbyaddr() and getservbyport(), but unlike those functions,
getnameinfo() is reentrant and allows programs to eliminate
IPv4-versus-IPv6 dependencies.

Lustre-change: https://review.whamcloud.com/52632
Lustre-commit: TBD (from 99687573d33336a153c1a5b94a4b66ebbcc2d0f1)

Test-Parameters: kerberos=true testlist=sanity-krb5
Test-Parameters: testgroup=review-dne-selinux-ssk-part-2
Signed-off-by: Jian Yu <yujian@whamcloud.com>
Signed-off-by: Sebastien Buisson <sbuisson@ddn.com>
Change-Id: Iacb5583826cd2f7329455bc6cbb4477f9087f15a
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/53386
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
libcfs/autoconf/lustre-libcfs.m4
libcfs/libcfs/util/nidstrings.c
lnet/autoconf/lustre-lnet.m4
lustre/autoconf/lustre-core.m4
lustre/utils/gss/lgss_krb5_utils.c
lustre/utils/gss/lsupport.c
lustre/utils/gss/lsupport.h
lustre/utils/nidlist.c
lustre/utils/portals.c