tech-net archive

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

Re: struct sockaddr_storage issues



On Fri, 23 Dec 2022 19:30:33 -0500
Ken Hornstein <kenh%pobox.com@localhost> wrote:

> >I think getaddrinfo() has a lot of baggage. For my current use case I
> >prefer to keep it simple and only deal with IPv4 or IPv6 addresses.
> >I've seen reports of buggy getaddrinfo() implementations on some
> >platforms, which ignore some of the flags you mentioned. May be those
> >bugs have been fixed by now...
> 
> As far as I can tell, if you used getaddrinfo() it would result in less
> code and zero portability concerns which I think meets the definition of
> "simpler", and depending on the platform it could get you some things
> for free you might not know about but could find useful (e.g: IPv6 scope
> identifer support).  I am aware that some early implementations of
> getaddrinfo() did not support all of the specified flags in the hints
> structure but as far as I know those are all super-old at this point and
> shoudn't be an issue on any reasonably modern system.
> 
> Just my $0.02, it's your code after all.
> 
> --Ken

I agree, it's a good advice. I was looking at supporting IPv6 scope
IDs some time ago, but at least for now, decided not to bother. I
found the article which referred to getaddrinfo() issues. 

https://blog.powerdns.com/2014/05/21/a-surprising-discovery-on-converting-ipv6-addresses-we-no-longer-prefer-getaddrinfo/


Home | Main Index | Thread Index | Old Index