mirror of
https://github.com/linux-can/can-utils.git
synced 2026-08-05 06:20:00 +02:00
candump: reserve enough space for ctrlmsg
The ctrlmsg must be large enough to contains 3 elements of various sizes, not a single element of the sum of the size. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
This commit is contained in:
@@ -303,7 +303,9 @@ int main(int argc, char **argv)
|
|||||||
int join_filter;
|
int join_filter;
|
||||||
char *ptr, *nptr;
|
char *ptr, *nptr;
|
||||||
struct sockaddr_can addr;
|
struct sockaddr_can addr;
|
||||||
char ctrlmsg[CMSG_SPACE(sizeof(struct timeval) + 3 * sizeof(struct timespec) + sizeof(__u32))];
|
char ctrlmsg[CMSG_SPACE(sizeof(struct timeval)) +
|
||||||
|
CMSG_SPACE(3 * sizeof(struct timespec)) +
|
||||||
|
CMSG_SPACE(sizeof(__u32))];
|
||||||
struct iovec iov;
|
struct iovec iov;
|
||||||
struct msghdr msg;
|
struct msghdr msg;
|
||||||
struct cmsghdr *cmsg;
|
struct cmsghdr *cmsg;
|
||||||
|
|||||||
Reference in New Issue
Block a user