mirror of
https://github.com/moby/moby.git
synced 2026-01-11 10:41:43 +00:00
cmd/docker-proxy: set O_NONBLOCK unconditionally
Prior to commit b5bf89c31, all socket fds passed to the docker-proxy
were getting the O_NONBLOCK flag set. However, that commit added support
for SCTP socket-passing, and had to conditionally guard this behavior to
not use it on SCTP sockets due to ishidawataru/sctp not clearing the
flag.
A fix was made in ishidawataru/sctp (see [1]), so we can remove that
condition.
[1]: https://github.com/ishidawataru/sctp/commit/4b890084db30
Signed-off-by: Albin Kerouanton <albinker@gmail.com>
This commit is contained in:
@@ -178,11 +178,7 @@ func parseFlags() ProxyConfig {
|
||||
}
|
||||
|
||||
if useListenFd {
|
||||
// Unlike the stdlib, passing a non-blocking socket to `sctp.FileListener`
|
||||
// will result in a non-blocking Accept(). So, do not set this flag for SCTP.
|
||||
if config.Proto != "sctp" {
|
||||
_ = syscall.SetNonblock(int(listenSockFd), true)
|
||||
}
|
||||
_ = syscall.SetNonblock(int(listenSockFd), true)
|
||||
config.ListenSock = os.NewFile(listenSockFd, "listen-sock")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user