Hi,<br><br>I don't understand why my loop crashes,<br><br>Here is my grovel definition for ifaddrs struct:<br><br>(cstruct ifaddrs "struct ifaddrs"<br> (next "ifa_next" :type :pointer)<br> (name "ifa_name" :type :string)<br>
(flags "ifa_flags" :type :unsigned-int)<br> (address "ifa_addr" :type :pointer)<br> (netmask "ifa_netmask" :type :pointer)<br> (broadcast "ifa_broadaddr" :type :pointer)<br>
(point-to-point-destination "ifa_dstaddr" :type :pointer)<br> (data "ifa_data" :type :pointer))<br><br>Here is my loop, i was expecting next to be a null pointer after the first vmnet8<br>
<br>CL-USER> (cffi:with-foreign-object (p :pointer) <br> (getifaddrs p) <br>
(do () <br> ((cffi:null-pointer-p p)) <br>
(format t "Interface: ~a~%" (cffi:foreign-slot-value (cffi:mem-ref p :pointer) 'ifaddrs 'name)) <br> (setf p (cffi:foreign-slot-value p 'ifaddrs 'next))))<br>
Interface: lo <br>Interface: sit0 <br>
Interface: eth0 <br>Interface: wlan0 <br>
Interface: vmnet1 <br>Interface: vmnet8 <br>
Interface: lo <br>Interface: wlan0 <br>
Interface: vmnet1 <br>Interface: vmnet8 <br>
Interface: lo <br>Interface: wlan0 <br>
Interface: vmnet1 <br>Interface: vmnet8 <br>
; Evaluation aborted on #<SB-SYS:MEMORY-FAULT-ERROR {BF604E1}>.<br> <br>Regards,<br>Jose<br>