diff options
author | Donatas Abraitis <donatas@opensourcerouting.org> | 2022-05-11 12:16:44 +0200 |
---|---|---|
committer | Donatas Abraitis <donatas@opensourcerouting.org> | 2022-05-11 13:08:47 +0200 |
commit | 6006b807b1a84d31611173b837fafcd96ba9d692 (patch) | |
tree | 08f25453328d8c408f1a8c658e4e6ef91005d4a7 /ospfd/ospf_packet.c | |
parent | ripd: Use correct usage of memcpy() when zeroing struct (diff) | |
download | frr-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 'ospfd/ospf_packet.c')
-rw-r--r-- | ospfd/ospf_packet.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ospfd/ospf_packet.c b/ospfd/ospf_packet.c index 55a010a29..c319f8068 100644 --- a/ospfd/ospf_packet.c +++ b/ospfd/ospf_packet.c @@ -696,7 +696,7 @@ static void ospf_write(struct thread *thread) /* reset get pointer */ stream_set_getp(op->s, 0); - memset(&iph, 0, sizeof(struct ip)); + memset(&iph, 0, sizeof(iph)); memset(&sa_dst, 0, sizeof(sa_dst)); sa_dst.sin_family = AF_INET; @@ -2310,7 +2310,7 @@ static struct stream *ospf_recv_packet(struct ospf *ospf, int fd, char buff[CMSG_SPACE(SOPT_SIZE_CMSG_IFINDEX_IPV4())]; struct msghdr msgh; - memset(&msgh, 0, sizeof(struct msghdr)); + memset(&msgh, 0, sizeof(msgh)); msgh.msg_iov = &iov; msgh.msg_iovlen = 1; msgh.msg_control = (caddr_t)buff; |