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

ffi.error: struct tr_tcp_config: wrong total size (cdef says 24, but C compiler says 48). #17

Open
ychlgdr opened this issue May 20, 2024 · 4 comments

Comments

@ychlgdr
Copy link

ychlgdr commented May 20, 2024

When I was using the python-binding, I tried using RTRManager. However, the following error occurred. Could it be due to an update in the rtrlib code that this repository has not yet updated?

Traceback (most recent call last):
  File "rtr_receiver.py", line 41, in <module>
    main()
  File "rtr_receiver.py", line 37, in main
    start_rtr_receiver(rtr_host, rtr_port)
  File "rtr_receiver.py", line 11, in start_rtr_receiver
    manager = RTRManager(rtr_host, rtr_port,pfx_update_callback=callback)
  File "/usr/local/lib/python3.8/dist-packages/rtrlib-0.1-py3.8-linux-x86_64.egg/rtrlib/rtr_manager.py", line 138, in __init__
    self.tcp_config = ffi.new('struct tr_tcp_config *')
ffi.error: struct tr_tcp_config: wrong total size (cdef says 24, but C compiler says 48). fix it or use "...;" as the last field in the cdef for struct tr_tcp_config to make it flexible
@jayeshkumarbhoi
Copy link

Yes I do have same issue.

File "/usr/local/lib/python3.12/site-packages/rtrlib-0.1-py3.12-linux-x86_64.egg/rtrlib/rtr_manager.py", line 138, in __init__
    self.tcp_config = ffi.new('struct tr_tcp_config *')
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ffi.error: struct tr_tcp_config: wrong total size (cdef says 24, but C compiler says 48). fix it or use "...;" as the last field in the cdef for struct tr_tcp_config to make it flexible

I have found it was works with cffi==1.15.1 but now it pulling latest cffi which is cffi==1.16.0 and with this version above error started to appear.

@jayeshkumarbhoi
Copy link

Anyone have idea how to resolve this issue?

@mroethke
Copy link
Member

mroethke commented Jun 4, 2024 via email

@jayeshkumarbhoi
Copy link

@mroethke Thanks, It is working now. Thanks for quick fix.

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

No branches or pull requests

3 participants