Closed socketpair closed 4 years ago
I've done all the changes I wanted.
Left one more question.
.
No, I'm strongly confident that for IPv6 it always must be a 4-item tuple.
Can you elaborate? Even getnameinfo(3) doesn't say they are mandatory, one can memset the struct to 0, just fill in the address and port and it doesn't fail. And Python works this way, too, so there is precedent.
C API wants a complete structure. This means all fields are mandatory, and the last two might be zero. Yes. But C API does not allow to pass half of the structure. Same with Python.
People who construct such a tuple from scratch (by filling fields got from somewhere) are definitely doing it wrong. Such tuples should only be constructed from getaddrinfo()
or so. Unfortunately, Python API uses just plain tuples instead of dataclasses or named tuples.
This is exactly the reason for losing link-local functionality in myriads of program. The bad design of Python API.
As you can see these tuples have 4 items. With zeroes filled in.
Gotcha, makes sense!
Disgusting library. I will never use it anymore. Sorry, but it has code from 2005 with obvious kindergardten bugs. I guess plenty security bugs.