-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 04/23/2014 04:55 PM, Iñaki Baz Castillo wrote: > Hi, I create a non-blocking AF_UNIX SOCK_DGRAM socket and pass it > to uv_udp_open(fd), so then I use the UDP API of libuv. > > It just works perfectly. But when I inspect the struct sockaddr* > addr given in the uv_udp_recv_cb(): > > - In OSX (Mavericks): I inspect the family of addr and, indeed, it > is AF_UNIX (OK). > > - Linux (Debian 7): I inspect the family of addr and it is > unknown. This is, the given addr is not a struct sockaddr at all, > but garbage. > > Is this a bug? >
I don't think it's a bug, you are abusing the API :-) Now, I did spot something in the code which might explain it. The sockaddr struct is created on the stack, and my guess is that Linux is not populating it so you get whatever was there. Please add a printf here: https://github.com/joyent/libuv/blob/master/src/unix/udp.c#L228 and print the content of h.msg_namelen. If my guess is correct you'll get 0 on Linux. - -- Saúl Ibarra Corretgé bettercallsaghul.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Using GnuPG with Icedove - http://www.enigmail.net/ iQIcBAEBAgAGBQJTV9qoAAoJEEEOVVOum8BZ9VYQAMUrHC8Up6V+9pF3zoCyBRKV iI0LIpSoa3owJJbUdQQKG1r0JYYPuX/5zze2or4viPmRvxO3NNNdi/5nl3JTK/eM OuHFbrV9LwebhIaKbVQbh7EX3Ou3pSIVAbLniJf211Hc5bxeWpHAC1udplh2hN6n E+tJs4w1/TXb+DkI+n7kUYecFAYyd4OkNLhbxNSSOrYFzG5RMianAtZzaJfzGQLD XeTMmiMclQH9Z0wDmkbe03Rpa5T7CovsLnXV0z22j03sZIXP3QWpRc65qEkogBSN KJsWzVXEqtxkQTyTVSk4/e8r0ok1pbvhMuT9eoSLqPMfjeHCguDQD1/2r1FlDeiX 9IYkz+2nBg95CnnNZiLwJfsdm574t65D40nDC2RPA2FRbv9oTmZGxCAxLMLQRaQj f6FuI39DDSHRmBN3MAdPED0ndwRzTVMcMJeW3A9ASrV54oVyskOHnJfBUyqpVTTy 0cRNwng5kZ1ADD0o4GDE7PYcP/te/lXK4VivsXiw6j695T1nTgGOmTyRqhQBVns2 gJoqiUVUDUlkmIosrmm7WYlqQ6sFrStqSZqyKqr0emxBzurvJBHC/EeVbA0XaDvF HjQ4L837oPzEHwFk6IkTC5YySiikyi5eCNaqE6JXKUt7JAz6dDHGLHmoXMMMKFEH J5KJJBmlg/oTVjpkWTMD =GY7U -----END PGP SIGNATURE----- -- You received this message because you are subscribed to the Google Groups "libuv" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/libuv. For more options, visit https://groups.google.com/d/optout.
