This is an issue with the call to inet_ntoa. The cffi defun declares the type of the argument as an int64. This is incorrect. The actual call to inet_ntoa takes in a struct, not a pointer to a struct. The value inside of that struct is a single uint32. You can, thus, declare the type as a uint32, but an int64 is wrong. Also, one should be using inet_ntop and inet_pton instead of inet_ntoa and inet_aton.
This is an issue with the call to inet_ntoa. The cffi defun declares the type of the argument as an int64. This is incorrect. The actual call to inet_ntoa takes in a struct, not a pointer to a struct. The value inside of that struct is a single uint32. You can, thus, declare the type as a uint32, but an int64 is wrong. Also, one should be using inet_ntop and inet_pton instead of inet_ntoa and inet_aton.
For references to the solution to this issue see: http://www.retran.com/beej/inet_ntoaman.html http://man7.org/linux/man-pages/man7/ip.7.html