Issue reading a structure from libc (calling function getifaddrs) with python ctypes
Using Docker containers for Alpine, with versions 3.1, 3.2 or edge, I have the following issue.
I install python
apk —update add python
I copy over the following python script:
And execute it:
I get the following results in Alpine:
Traceback (most recent call last): File "test_libc.py", line 259, in <module> pp(get_ifaddrs()) File "test_libc.py", line 200, in get_ifaddrs si = sockaddr_in.from_address(ifa.ifa_ifu.ifu_broadaddr) TypeError: integer expected
On any other “big” Linux systems I tried this work fine.
Could it be that musl is not correctly typing the structures returned by getifaddrs?
(from redmine: issue id 4949, created on 2015-12-10, closed on 2016-03-18)
- Revision 56101f21 by Timo Teräs on 2016-01-23T16:13:17Z:
main/musl: cherry-pick upstream fixes and improvements fixes #4621 fixes #4949 (cherry picked from commit 8a4ccf53a605414546a73d39dda24fe95c1bc1b2)