From: Fabrice Bellard <fabrice@bellard.org>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Fix for accept
Date: Fri, 14 Jul 2006 11:53:21 +0200 [thread overview]
Message-ID: <44B76991.6030106@bellard.org> (raw)
In-Reply-To: <44B74C5A.6000408@nomovok.com>
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.
prev parent reply other threads:[~2006-07-14 9:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-13 10:21 [Qemu-devel] Fix for accept Pablo Virolainen
2006-07-13 20:40 ` Fabrice Bellard
2006-07-14 7:48 ` Pablo Virolainen
2006-07-14 9:53 ` Fabrice Bellard [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=44B76991.6030106@bellard.org \
--to=fabrice@bellard.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).