Pablo Virolainen wrote:
So I should write something like following instead?
if (!get_user(addrlen,&target_addrlen)) {
return -EFAULT
}
Yes.
The code seems to assume target_sockaddr == sockaddr, so why allocate
temporary buffer and then do copying?
If the assumption "target_sockaddr == sockaddr" is made, then it is a bug.
One could implement SOCKOP_[accept|getsockname|getpeername] with same
code.
> [...]
You can use common code, but I think it is clearer to have the
do_accept, do_getsockname and do_getpeername helpers.
Fabrice.
_______________________________________________
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel