Garbled IPv6 printout

Hal Murray hmurray at megapathdsl.net
Sun Mar 31 03:05:41 UTC 2019


> A sockaddr is not meant to store the address, ...

But the API wants a sockaddr.
       int accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen);
There is no hint in the man page that an IPv6 address won't fit.

sockaddr ends with
  sa_data[14];

That's not big enough for an IPv6 address.  I assume somebody suggested making it bigger and/or changing the parameters to accept when IPv6 was added.  It would be interesting to review that discussion.

Does anybody collect bugs of this nature?   It would be interesting to review a list, partly to see what can be learned about API design and partly as a warning for when I might use a dangerous/trickey function.


-- 
These are my opinions.  I hate spam.





More information about the devel mailing list