On Sat, Jan 15, 2011 at 06:08:54PM +0100, Oliver Hartkopp wrote: > On 14.01.2011 18:23, Kurt Van Dijck wrote: > > I think this patch makes the CAN socket code comform to the > > manpages of sendmsg & recvmsg. > > Hello Kurt, > > if you check similar code sniplets in the kernel you would see, that in > recvmsg()-cases the given namelen is not used from userspace. I went into udp code, but my mind got troubled there. > > If msg->msg_name is not NULL the msg_namelen is just set by the kernel. E.g. > see af_packet.c, af_econet.c, etc. I should have looked further ... Given this, I went up to net/socket.c:__sys_recvmsg. Within kernel space, a struct sockaddr_storage is used in fact .... This solves indeed the problem I was trying to address. > > So the code in candump.c setting the msg_namelen before recvmsg() is obviously > obsolete ... I think no, since after the socket's recvmsg() has been called, since move_addr_to_user() will do checks similar as I tried to reimplement. > > Btw. your two patches below for bcm_sendmsg() and raw_sendmesg() look good. > > If you would like to resubmit these two patches, you may add my Acked-by Thanks, I will do so.
Kurt _______________________________________________ Socketcan-core mailing list [email protected] https://lists.berlios.de/mailman/listinfo/socketcan-core
