Browse code

- openbsd 64 tcp fix - switched to f_malloc by default (faster)

Andrei Pelinescu-Onciul authored on 31/08/2005 13:18:29
Showing 2 changed files
... ...
@@ -58,7 +58,7 @@ MAIN_NAME=ser
58 58
 VERSION = 0
59 59
 PATCHLEVEL = 9
60 60
 SUBLEVEL = 4
61
-EXTRAVERSION = -rc3
61
+EXTRAVERSION = -rc4
62 62
 
63 63
 RELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
64 64
 OS = $(shell uname -s | sed -e s/SunOS/solaris/ | tr "[A-Z]" "[a-z]")
... ...
@@ -326,8 +326,8 @@ DEFS+= $(extra_defs) \
326 326
 	 -DUSE_MCAST \
327 327
 	 -DUSE_TCP \
328 328
 	 -DDISABLE_NAGLE \
329
+	 -DF_MALLOC \
329 330
 	 #-DDBG_QM_MALLOC \
330
-	 #-DF_MALLOC \
331 331
 	 #-DDBG_F_MALLOC \
332 332
 	 #-DNO_DEBUG \
333 333
 	 #-DNO_LOG \
... ...
@@ -96,13 +96,16 @@ int send_fd(int unix_socket, void* data, int data_len, int fd)
96 96
 	int ret;
97 97
 #ifdef HAVE_MSGHDR_MSG_CONTROL
98 98
 	struct cmsghdr* cmsg;
99
+	/* make sure msg_control will point to properly aligned data */
99 100
 	union {
100 101
 		struct cmsghdr cm;
101 102
 		char control[CMSG_SPACE(sizeof(fd))];
102 103
 	}control_un;
103 104
 	
104 105
 	msg.msg_control=control_un.control;
105
-	msg.msg_controllen=sizeof(control_un.control);
106
+	/* openbsd doesn't like "more space", msg_controllen must not
107
+	 * include the end padding */
108
+	msg.msg_controllen=CMSG_LEN(sizeof(fd));
106 109
 	
107 110
 	cmsg=CMSG_FIRSTHDR(&msg);
108 111
 	cmsg->cmsg_level = SOL_SOCKET;