Commit 3176362d authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

SO_REUSEADDR is wrong here

parent 0a9daac5
...@@ -51,9 +51,6 @@ Broadcast::Broadcast(int i_ttl, const char *psz_iface) : fd4 (-1), fd6 (-1), ...@@ -51,9 +51,6 @@ Broadcast::Broadcast(int i_ttl, const char *psz_iface) : fd4 (-1), fd6 (-1),
fd6 = socket (AF_INET6, SOCK_DGRAM, IPPROTO_UDP); fd6 = socket (AF_INET6, SOCK_DGRAM, IPPROTO_UDP);
if (fd6 != -1) if (fd6 != -1)
{ {
int dummy = 1;
setsockopt (fd6, SOL_SOCKET, SO_REUSEADDR, &dummy, sizeof (dummy));
struct sockaddr_in6 addr; struct sockaddr_in6 addr;
memset (&addr, 0, sizeof (addr)); memset (&addr, 0, sizeof (addr));
addr.sin6_family = AF_INET6; addr.sin6_family = AF_INET6;
...@@ -100,9 +97,6 @@ Broadcast::Broadcast(int i_ttl, const char *psz_iface) : fd4 (-1), fd6 (-1), ...@@ -100,9 +97,6 @@ Broadcast::Broadcast(int i_ttl, const char *psz_iface) : fd4 (-1), fd6 (-1),
fd4 = socket (AF_INET, SOCK_DGRAM, IPPROTO_UDP); fd4 = socket (AF_INET, SOCK_DGRAM, IPPROTO_UDP);
if (fd4 != -1) if (fd4 != -1)
{ {
int dummy = 1;
setsockopt (fd4, SOL_SOCKET, SO_REUSEADDR, &dummy, sizeof (dummy));
struct sockaddr_in addr; struct sockaddr_in addr;
memset (&addr, 0, sizeof (addr)); memset (&addr, 0, sizeof (addr));
addr.sin_family = AF_INET; addr.sin_family = AF_INET;
...@@ -164,7 +158,7 @@ Broadcast::~Broadcast() ...@@ -164,7 +158,7 @@ Broadcast::~Broadcast()
int Broadcast::Send(Message* m, const struct sockaddr *dst, socklen_t len) int Broadcast::Send(Message* m, const struct sockaddr *dst, socklen_t len)
{ {
/* Get the message and the length */ /* Get the message and the length */
uint8_t* message = m->GetFinalMessage(); const uint8_t* message = m->GetFinalMessage();
size_t length = m->GetFinalMessageLen(); size_t length = m->GetFinalMessageLen();
if(message==NULL) if(message==NULL)
......
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