]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Rework linux accept(2). This makes the code flow easier to follow,
authortrasz <trasz@FreeBSD.org>
Wed, 1 Jul 2020 10:37:08 +0000 (10:37 +0000)
committertrasz <trasz@FreeBSD.org>
Wed, 1 Jul 2020 10:37:08 +0000 (10:37 +0000)
commit967382a845cf780b5c0ef0535a40e4193e8b66bb
tree00d654d8ca307f2e9e971c5f620bad01fa1817f2
parente478a9ec1d778e93d2d98ecafe17c709640c65a5
Rework linux accept(2).  This makes the code flow easier to follow,
and fixes a bug where calling accept(2) could result in closing fd 0.

Note that the code still contains a number of problems: it makes
assumptions about l_sockaddr_in being the same as sockaddr_in,
the EFAULT-related code looks like it doesn't work at all, and the
socket type check is racy.  Those will be addressed later on;
I'm trying to work in small steps to avoid breaking one thing while
fixing another.

It fixes Redis, among other things.

Reviewed by: kib
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D25461
sys/compat/linux/linux_socket.c