Added SO_REUSEADDR socket option on IPC socketAdded SO_REUSEADDR socket option on...
authorAndreas Tonnesen <andreto@olsr.org>
Wed, 8 Sep 2004 16:39:52 +0000 (16:39 +0000)
committerAndreas Tonnesen <andreto@olsr.org>
Wed, 8 Sep 2004 16:39:52 +0000 (16:39 +0000)
lib/dot_draw/src/olsrd_dot_draw.c

index bd5e410..9a68403 100644 (file)
@@ -63,6 +63,7 @@ int
 plugin_ipc_init()
 {
   struct sockaddr_in sin;
+  olsr_u32_t yes = 1;
 
   /* Init ipc socket */
   if ((ipc_socket = socket(AF_INET, SOCK_STREAM, 0)) == -1) 
@@ -72,6 +73,12 @@ plugin_ipc_init()
     }
   else
     {
+    if (setsockopt(ipc_socket, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(yes)) < 0) 
+      {
+       perror("SO_REUSEADDR failed");
+       return 0;
+      }
+
       /* Bind the socket */
       
       /* complete the socket structure */