inet_net_pton() alternative for IPv6

tomas@tuxteam.de tomas@tuxteam.de
Wed Jul 6 05:04:21 GMT 2022


On Tue, Jul 05, 2022 at 06:58:00PM -0500, Ian Pilcher wrote:
> On 7/4/22 13:23, tomas@tuxteam.de wrote:
> > I never tried it, but this is what my version [1] of the libc docs say:
> > 
> >   -- Function: int inet_pton (int AF, const char *CP, void *BUF)
> > 
> >       Preliminary: | MT-Safe locale | AS-Safe | AC-Safe | *Note POSIX
> >       Safety Concepts::.
> > 
> >       This function converts an Internet address (either IPv4 or IPv6)
> >       from presentation (textual) to network (binary) format.  AF should
> >       be either ‘AF_INET’ or ‘AF_INET6’, as appropriate for the type of
> >       address being converted.  CP is a pointer to the input string, and
> >       BUF is a pointer to a buffer for the result.  It is the caller’s
> >       responsibility to make sure the buffer is large enough.
> 
> 
> You're looking at the wrong function.  inet_pton() does support IPv6;
> inet_net_pton() does not (even though its interface is designed in a
> way that it could accomodate it).

I see, thanks

> -- 
> ========================================================================
> Google                                      Where SkyNet meets Idiocracy
> ========================================================================

The irony is that you are posting from... gmail :)

Cheers
-- 
t
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/libc-help/attachments/20220706/defebc7c/attachment.sig>


More information about the Libc-help mailing list