]> Cypherpunks repositories - gostls13.git/commit
syscall: workaround accept() bug on Darwin
authorAlexey Borzenkov <snaury@gmail.com>
Sun, 29 Jul 2012 23:02:24 +0000 (09:02 +1000)
committerAndrew Gerrand <adg@golang.org>
Sun, 29 Jul 2012 23:02:24 +0000 (09:02 +1000)
commit5197fa80405a470eef7cd2540380172aea6d60af
tree04afa3b5f6ca586686b41c2ed382c1f237fd2ffa
parentb4402a49b6c9a87f27c2140beacf46ef95738455
syscall: workaround accept() bug on Darwin

Darwin kernels have a bug in accept() where error result from
an internal call is not checked and socket is accepted instead
of ECONNABORTED error. However, such sockets have no sockaddr,
which results in EAFNOSUPPORT error from anyToSockaddr, making
Go http servers running on Mac OS X easily susceptible to
denial of service from simple port scans with nmap.
Fixes #3849.

R=golang-dev, adg, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/6456045
src/pkg/syscall/syscall_bsd.go