Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core: add flexible member to ares_addrinfo to fix c-ares 1.18 #172

Merged
merged 1 commit into from
Jun 22, 2022

Conversation

mgorny
Copy link
Contributor

@mgorny mgorny commented Jun 22, 2022

Add a flexible member to account for c-ares 1.18 adding an additional
name member to struct ares_addrinfo. This fixes the following
exception from cffi, and the resulting test_getaddrinfo* failures:

Exception ignored from cffi callback <function _addrinfo_cb at 0x7f5fa890d040>:
Traceback (most recent call last):
  File "/tmp/pycares/.tox/py39/lib/python3.9/site-packages/pycares/__init__.py", line 162, in _addrinfo_cb
    result = ares_addrinfo_result(res)
  File "/tmp/pycares/.tox/py39/lib/python3.9/site-packages/pycares/__init__.py", line 841, in __init__
    cname_ptr = ares_addrinfo.cnames
ffi.error: struct ares_addrinfo: wrong total size (cdef says 16, but C compiler says 24). fix it or use "...;" as the last field in the cdef for struct ares_addrinfo to make it flexible

Add a flexible member to account for c-ares 1.18 adding an additional
`name` member to `struct ares_addrinfo`.  This fixes the following
exception from cffi, and the resulting test_getaddrinfo* failures:

```
Exception ignored from cffi callback <function _addrinfo_cb at 0x7f5fa890d040>:
Traceback (most recent call last):
  File "/tmp/pycares/.tox/py39/lib/python3.9/site-packages/pycares/__init__.py", line 162, in _addrinfo_cb
    result = ares_addrinfo_result(res)
  File "/tmp/pycares/.tox/py39/lib/python3.9/site-packages/pycares/__init__.py", line 841, in __init__
    cname_ptr = ares_addrinfo.cnames
ffi.error: struct ares_addrinfo: wrong total size (cdef says 16, but C compiler says 24). fix it or use "...;" as the last field in the cdef for struct ares_addrinfo to make it flexible
```
@saghul saghul merged commit ad6ad95 into saghul:master Jun 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants