Re: Fix inet_ntop and inet_pton on Solaris

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Feb 03, 2020 at 10:22:46AM -0500, Jeffrey Walton wrote:

> inet_ntop and inet_pton were not being detected properly on modern on
> Solaris. This patch revisits the the socket gear configuration on
> SunOS and brings it up to date for Solaris 11.
> 
> According to configure.ac, the three or four functions of interest
> include hstrerror, inet_ntop and inet_pton. The libraries of interest
> are -lresolv -lsocket -lnsl. The configure tests now look for
> inet_ntop and inet_pton in -lsocket -lnsl per the man page. If not
> found, the configure tests fall back to existing behavior by searching
> in -lresolv. And if not found in -lresolv, then NO_INET_NTOP and
> NO_INET_PTON are set.

This makes sense, and the patch looks plausibly correct (which is the
best I can say given my general lack of autoconf knowledge).

I was a little surprised by this hunk:

> diff --git a/Makefile b/Makefile
> index 09f98b777c..7166b19ab4 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1461,15 +1461,15 @@ ifndef LIBC_CONTAINS_LIBINTL
>  	EXTLIBS += -lintl
>  endif
>  endif
> +ifdef NEEDS_RESOLV
> +	EXTLIBS += -lresolv
> +endif
>  ifdef NEEDS_SOCKET
>  	EXTLIBS += -lsocket
>  endif
>  ifdef NEEDS_NSL
>  	EXTLIBS += -lnsl
>  endif
> -ifdef NEEDS_RESOLV
> -	EXTLIBS += -lresolv
> -endif

But I guess it is trying to mimic the "-lresolv -lsocket -lnsl" order
you mentioned in the Solaris manpage. You should be able to test if
that's necessary by compiling with:

  make NEEDS_RESOLV=Yes NEEDS_SOCKET=Yes NEEDS_NSL=Yes

If so, that ordering switch could probably happen as a separate commit
before the configure.ac change.

> diff --git a/configure.ac b/configure.ac
> index 66aedb9288..b83a0e970d 100644
> --- a/configure.ac
> +++ b/configure.ac

The rest of it looks OK to me. Do you want to send it as a regular Git
patch with a commit message and your signoff (see SubmittingPatches)?

-Peff



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux