Sync SCM_RIGHTS passing code with the version used in racoon (i.e.

set message header and controll message size to the same value again)
This commit is contained in:
martin 2008-04-19 22:15:30 +00:00
parent 72582f8379
commit 41de77d985

View File

@ -1,4 +1,4 @@
/* $NetBSD: monitor_fdpass.c,v 1.7 2008/04/13 21:44:14 christos Exp $ */
/* $NetBSD: monitor_fdpass.c,v 1.8 2008/04/19 22:15:30 martin Exp $ */
/* $OpenBSD: monitor_fdpass.c,v 1.17 2008/03/24 16:11:07 deraadt Exp $ */
/*
* Copyright 2001 Niels Provos <provos@citi.umich.edu>
@ -26,7 +26,7 @@
*/
#include "includes.h"
__RCSID("$NetBSD: monitor_fdpass.c,v 1.7 2008/04/13 21:44:14 christos Exp $");
__RCSID("$NetBSD: monitor_fdpass.c,v 1.8 2008/04/19 22:15:30 martin Exp $");
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/uio.h>
@ -65,6 +65,7 @@ mm_send_fd(int sock, int fd)
cmsg->cmsg_level = SOL_SOCKET;
cmsg->cmsg_type = SCM_RIGHTS;
*(int *)CMSG_DATA(cmsg) = fd;
msg.msg_controllen = cmsg->cmsg_len;
vec.iov_base = &ch;
vec.iov_len = 1;