[Python-Dev] Problems with socketmodule (getnameinfo & getaddrinfo)
Martin v. Loewis
martin@loewis.home.cs.tu-berlin.de
Sun, 24 Jun 2001 23:39:45 +0200
> 1: socketmodule.c now #includes getnameinfo.c and
> getaddrinfo.c. These functions both use offsetof(), which is defined
> (on my system, at least) in stddef.h.
That should be fixed now. stddef.h is included in socketmodule.c; if
it is not available or does not define offsetof, an additional
definition is provided.
> 2. [...] Changes to either of the get{name,addr}info.c files will
> not cause socketmodule to be rebuilt.
I don't know how to solve this one. If distutils builds the modules,
makefile dependencies won't help.
> 3. The socket module still does not work, however, since it refers
> to an unresolved symbol inet_pton
I took the simplest solution that I could think of, delegating
inet_{pton,ntop} to inet_{ntoa,addr} for AF_INET, failing for all
other address families (AF_INET6 in particular). I've verified that
this code does the same as the builtin functions on my Linux system;
please let me know whether it compiles for you.
Regards,
Martin