<exarkun>
The inet_ntop call fails because "ValueError: invalid length of packed IP address string"
<exarkun>
Hm. I guess one wrong thing is that "sizeof struct in_addr" is not the same as the size of an AF_INET address because ... padding or whatever.
greedom has quit [Remote host closed the connection]
greedom has joined #pypy
<tumbleweed>
yeah, it's defined as a struct of an uint32_t
<tumbleweed>
presumably the issue is the "unsigned long" union member
<exarkun>
so if I fix it to just use 4 and 16 for INET and INET6 respectively, INET6 addresses seem to come out right but INET addresses are all 0
<exarkun>
I see the right bytes nearby, seems like maybe the in_addr struct layout is wrong
<exarkun>
which I guess is what I risk by using the cdef interface?
<exarkun>
addressof(sockaddr_in, "sin_addr") is sockaddr_in + 8
<tumbleweed>
yeah, you need the cdef to match the system headers
<exarkun>
but there are only 2 `unsigned short` fields in front of sin_addr...?
<tumbleweed>
and sa_family_t
<exarkun>
sin_family is one of the unsigned shorts, sin_port is the second. and then sin_addr is next ... for an offset of 4?
<tumbleweed>
ah, I misread as 2 after that
<tumbleweed>
so yeah, must be alignment
greedom has quit [Remote host closed the connection]
greedom has joined #pypy
<exarkun>
eh yea if I hard-code the "correct" offsets I get the right data. bummer
<exarkun>
I guess sockaddr_in is too complex for AI mode
<exarkun>
ABI
greedom has quit [Remote host closed the connection]
otisolsen70 has quit [Quit: Leaving]
jacob22_ has joined #pypy
jacob22 has quit [Read error: Connection reset by peer]
Techcable has quit [Remote host closed the connection]
Techcable has joined #pypy
Techcable has quit [Remote host closed the connection]