summaryrefslogtreecommitdiffstats
path: root/pimd/pim_sock.c
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas@opensourcerouting.org>2022-05-11 12:16:44 +0200
committerDonatas Abraitis <donatas@opensourcerouting.org>2022-05-11 13:08:47 +0200
commit6006b807b1a84d31611173b837fafcd96ba9d692 (patch)
tree08f25453328d8c408f1a8c658e4e6ef91005d4a7 /pimd/pim_sock.c
parentripd: Use correct usage of memcpy() when zeroing struct (diff)
downloadfrr-6006b807b1a84d31611173b837fafcd96ba9d692.tar.xz
frr-6006b807b1a84d31611173b837fafcd96ba9d692.zip
*: Properly use memset() when zeroing
Wrong: memset(&a, 0, sizeof(struct ...)); Good: memset(&a, 0, sizeof(a)); Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
Diffstat (limited to 'pimd/pim_sock.c')
-rw-r--r--pimd/pim_sock.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/pimd/pim_sock.c b/pimd/pim_sock.c
index d41bc3f43..321775cce 100644
--- a/pimd/pim_sock.c
+++ b/pimd/pim_sock.c
@@ -360,7 +360,7 @@ int pim_socket_recvfromto(int fd, uint8_t *buf, size_t len,
*tolen = sizeof(*to);
}
- memset(&msgh, 0, sizeof(struct msghdr));
+ memset(&msgh, 0, sizeof(msgh));
iov.iov_base = buf;
iov.iov_len = len;
msgh.msg_control = cbuf;