diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-09-01 11:34:46 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-09-01 11:35:10 +0100 |
commit | b0b4d725c9635b3e434212a312493cc7bd970271 (patch) | |
tree | 761bc0f9aece22af3f8c9f8a95d9859277201fd0 /src | |
parent | eb7db9325e5460cd9980fcf24805aaa0c0659668 (diff) | |
download | rspamd-b0b4d725c9635b3e434212a312493cc7bd970271.tar.gz rspamd-b0b4d725c9635b3e434212a312493cc7bd970271.zip |
[Fix] Use the correct macro to get the size of control
Diffstat (limited to 'src')
-rw-r--r-- | src/libserver/rspamd_control.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libserver/rspamd_control.c b/src/libserver/rspamd_control.c index da573fa94..d680c35b1 100644 --- a/src/libserver/rspamd_control.c +++ b/src/libserver/rspamd_control.c @@ -342,7 +342,7 @@ rspamd_control_wrk_io (gint fd, short what, gpointer ud) strerror (errno)); } else if (r >= (gssize)sizeof (elt->reply)) { - if (msg.msg_controllen >= CMSG_SPACE(sizeof (int))) { + if (msg.msg_controllen >= CMSG_LEN (sizeof (int))) { elt->attached_fd = *(int *) CMSG_DATA(CMSG_FIRSTHDR (&msg)); } } @@ -635,7 +635,7 @@ rspamd_control_default_worker_handler (gint fd, short what, gpointer ud) } else if ((gint)cmd.type >= 0 && cmd.type < RSPAMD_CONTROL_MAX) { - if (msg.msg_controllen >= CMSG_SPACE(sizeof (int))) { + if (msg.msg_controllen >= CMSG_LEN (sizeof (int))) { rfd = *(int *) CMSG_DATA(CMSG_FIRSTHDR (&msg)); } @@ -774,7 +774,7 @@ rspamd_srv_handler (gint fd, short what, gpointer ud) rdata->rep.id = cmd.id; rdata->rep.type = cmd.type; rdata->fd = -1; - if (msg.msg_controllen >= CMSG_SPACE(sizeof (int))) { + if (msg.msg_controllen >= CMSG_LEN (sizeof (int))) { rfd = *(int *) CMSG_DATA(CMSG_FIRSTHDR (&msg)); } @@ -972,7 +972,7 @@ rspamd_srv_request_handler (gint fd, short what, gpointer ud) goto cleanup; } - if (msg.msg_controllen >= CMSG_SPACE(sizeof (int))) { + if (msg.msg_controllen >= CMSG_LEN (sizeof (int))) { rfd = *(int *) CMSG_DATA(CMSG_FIRSTHDR (&msg)); } |