Commit 21be7c3d authored by Subodh Iyengar's avatar Subodh Iyengar Committed by Facebook Github Bot

change default for REUSEADDR to false

Summary:
A default value of true for SO_REUSEADDR is dangerous.
SO_REUSEADDR has several issues. For example if SO_REUSEADDR
is used to bind to a socket which is already bound but not connected,
the kernel will allow this operation to complete. This can cause overlapping
data. https://www.spinics.net/lists/netdev/msg206437.html

Looking at use cases of AsyncUDPSocket it does not look like people depend
on this behavior of AsyncUDPSocket and this was first introduced in thrift for
no reason.

This changes the behavior back to false.

Reviewed By: yfeldblum, djwatson

Differential Revision: D13274704

fbshipit-source-id: 391cf1bdd3f633bee38c230fcd9f1403ea950c3b
parent 44e30c29
...@@ -315,7 +315,7 @@ class AsyncUDPSocket : public EventHandler { ...@@ -315,7 +315,7 @@ class AsyncUDPSocket : public EventHandler {
// Temp space to receive client address // Temp space to receive client address
folly::SocketAddress clientAddress_; folly::SocketAddress clientAddress_;
bool reuseAddr_{true}; bool reuseAddr_{false};
bool reusePort_{false}; bool reusePort_{false};
int rcvBuf_{0}; int rcvBuf_{0};
int sndBuf_{0}; int sndBuf_{0};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment