Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove the risk of file descriptor reuse from arping
using sock.deinitialize() outside of the goroutine that is using the socket leaves the potential for erroneous and unexpected behavior. When calling Ping() very quickly the socket fd can be reused while a goroutine is still trying to read from it and cause the goroutine to deadlock. Additionally removing the timeout from the select case because that will/cannot work as intended. In linux close() does not cause system calls using the socket to return. This contributes to the file descriptor reuse issue mentioned above and with the defered sock.deinitialize() can lead to double closing the socket. Signed-off-by: Jacob Tanenbaum <[email protected]>
- Loading branch information