findalldevs might return additional sockaddr families than just AF_INET/AF_INET6, for example on Linux we get AF_PACKET/sockaddr_sll. The current code just dumps the raw bytes of the sockaddr which is also truncated as we don't know the correct length.
Sadly Cython doesn't support conditional compilation properly (IF is troublesome as it is done in C generation time, see https://groups.google.com/g/cython-users/c/C52mc9lm5xo), so we will need to drop such additional conversion to an auxiliary C source file or verbatim C code in a cdef extern.
Also, outputting the raw bytes like that might be useful for debugging, but might be confusing for users if it happens to them in the future, might want to consider this case.
findalldevs
might return additionalsockaddr
families than justAF_INET
/AF_INET6
, for example on Linux we getAF_PACKET
/sockaddr_sll
. The current code just dumps the raw bytes of thesockaddr
which is also truncated as we don't know the correct length.Sadly Cython doesn't support conditional compilation properly (
IF
is troublesome as it is done in C generation time, see https://groups.google.com/g/cython-users/c/C52mc9lm5xo), so we will need to drop such additional conversion to an auxiliary C source file or verbatim C code in acdef extern
.Also, outputting the raw bytes like that might be useful for debugging, but might be confusing for users if it happens to them in the future, might want to consider this case.