qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Fix for accept


From: Fabrice Bellard
Subject: Re: [Qemu-devel] Fix for accept
Date: Fri, 14 Jul 2006 11:53:21 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040913

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.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]