]> git.sur5r.net Git - openldap/commitdiff
Add copyright notice.
authorKurt Zeilenga <kurt@openldap.org>
Wed, 4 Aug 1999 23:59:53 +0000 (23:59 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Wed, 4 Aug 1999 23:59:53 +0000 (23:59 +0000)
include/setup.mak
servers/ldapd/main.c

index 3d346a4eb8d505eaa65b5b99ee227162bbe68388..ad8ddaa022226c787ddf1fccfffdc1a11f43bdbe 100644 (file)
@@ -1,3 +1,7 @@
+#
+# Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
+# COPYING RESTRICTIONS APPLY, see COPYRIGHT file
+#
 
 all: setup.txt
 
index a4250faa968f8b2e284b867074b3e9c6e5bff5d3..7f819084bb6673f65d5a899acde729c61534f7d4 100644 (file)
@@ -603,18 +603,31 @@ set_socket(
                 exit( 1 );
         }
 
+#ifdef SO_REUSEADDR
         /* set option so clients can't keep us from coming back up */
-       i = 1;
+               i = 1;
         if ( setsockopt( s, SOL_SOCKET, SO_REUSEADDR, (void *) &i, sizeof(i) )
-           < 0 ) {
+                   < 0 )
+               {
                 perror( "setsockopt" );
                 exit( 1 );
         }
+#endif
+#ifdef SO_KEEPALIVE
+        /* enable keep alives */
+               i = 1;
+        if ( setsockopt( s, SOL_SOCKET, SO_KEEPALIVE, (void *) &i, sizeof(i) )
+                   < 0 )
+               {
+                perror( "setsockopt" );
+                exit( 1 );
+        }
+#endif
 
         /* bind to a name */
        (void)memset( (void *)&addr, '\0', sizeof( addr ));
         addr.sin_family = AF_INET;
-        addr.sin_addr.s_addr = INADDR_ANY;
+        addr.sin_addr.s_addr = htonl(INADDR_ANY);
         addr.sin_port = htons( port );
         if ( bind( s, (struct sockaddr *) &addr, sizeof(addr) ) ) {
                 perror( "bind" );