summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSylvain Munaut <tnt@246tNt.com>2019-07-10 15:39:53 +0200
committerSylvain Munaut <tnt@246tNt.com>2019-07-10 15:39:53 +0200
commit2b9c51d633c0592a33c976b0fb93cc48fc3d4f5b (patch)
tree7b0186ce2fabe43553dc36ccf7503d179d0b6b34
parent2d7cc61101e7b6a3b5d942a7e79961a79303c812 (diff)
proto: Fix aliasing error when setting the FD in the CMSG data
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
-rw-r--r--src/proto.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/proto.c b/src/proto.c
index 04e533a..ee59ad1 100644
--- a/src/proto.c
+++ b/src/proto.c
@@ -131,7 +131,7 @@ osmo_e1dp_send(struct osmo_fd *ofd, struct msgb *msgb, int fd)
cmsg->cmsg_type = SCM_RIGHTS;
cmsg->cmsg_len = CMSG_LEN(sizeof(int));
- *(int*) CMSG_DATA(cmsg) = fd;
+ memmove(CMSG_DATA(cmsg), &fd, sizeof(int));
}
rc = sendmsg(ofd->fd, &msg, 0);