Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/crypto/dist/ipsec-tools/src/racoon Quiet a gcc warning when ...
details: https://anonhg.NetBSD.org/src/rev/19e515903204
branches: trunk
changeset: 762940:19e515903204
user: tteras <tteras%NetBSD.org@localhost>
date: Sun Mar 06 08:28:10 2011 +0000
description:
Quiet a gcc warning when strict-aliasing checks are enabled. Reported by
Stephen Clark.
diffstat:
crypto/dist/ipsec-tools/src/racoon/privsep.c | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diffs (45 lines):
diff -r 8e91efafad10 -r 19e515903204 crypto/dist/ipsec-tools/src/racoon/privsep.c
--- a/crypto/dist/ipsec-tools/src/racoon/privsep.c Sun Mar 06 05:08:03 2011 +0000
+++ b/crypto/dist/ipsec-tools/src/racoon/privsep.c Sun Mar 06 08:28:10 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: privsep.c,v 1.20 2010/03/05 06:47:58 tteras Exp $ */
+/* $NetBSD: privsep.c,v 1.21 2011/03/06 08:28:10 tteras Exp $ */
/* Id: privsep.c,v 1.15 2005/08/08 11:23:44 vanhu Exp */
@@ -1544,6 +1544,7 @@
{
struct msghdr msg;
struct cmsghdr *cmsg;
+ int *fdptr;
int fd;
char cmsbuf[1024];
struct iovec iov;
@@ -1569,7 +1570,8 @@
return -1;
cmsg = CMSG_FIRSTHDR(&msg);
- return *(int *)CMSG_DATA(cmsg);
+ fdptr = (int *) CMSG_DATA(cmsg);
+ return fdptr[0];
}
/* Send the file descriptor fd through the argument socket s */
@@ -1582,6 +1584,7 @@
struct cmsghdr *cmsg;
char cmsbuf[1024];
struct iovec iov;
+ int *fdptr;
iov.iov_base = " ";
iov.iov_len = 1;
@@ -1604,7 +1607,8 @@
cmsg->cmsg_level = SOL_SOCKET;
cmsg->cmsg_type = SCM_RIGHTS;
cmsg->cmsg_len = CMSG_LEN(sizeof(fd));
- *(int *)CMSG_DATA(cmsg) = fd;
+ fdptr = (int *)CMSG_DATA(cmsg);
+ fdptr[0] = fd;
msg.msg_controllen = cmsg->cmsg_len;
if (sendmsg(s, &msg, 0) == -1)
Home |
Main Index |
Thread Index |
Old Index