SO_REUSEADDR is now set on the olsr sockets
authorAndreas Tonnesen <andreto@olsr.org>
Mon, 13 Sep 2004 16:47:23 +0000 (16:47 +0000)
committerAndreas Tonnesen <andreto@olsr.org>
Mon, 13 Sep 2004 16:47:23 +0000 (16:47 +0000)
src/linux/net.c

index 28eacf3..cdaf942 100644 (file)
@@ -344,6 +344,11 @@ getsocket(struct sockaddr *sa, int bufspace, char *int_name)
     }
 #endif
 
+  if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)) < 0) 
+    {
+      perror("SO_REUSEADDR failed");
+      return (-1);
+    }
 
 
 
@@ -451,6 +456,13 @@ getsocket6(struct sockaddr_in6 *sin, int bufspace, char *int_name)
 
 #endif
 
+  if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)) < 0) 
+    {
+      perror("SO_REUSEADDR failed");
+      return (-1);
+    }
+
+
   /*
    * WHEN USING KERNEL 2.6 THIS MUST HAPPEN PRIOR TO THE PORT BINDING!!!!
    */