summaryrefslogtreecommitdiffstats
path: root/eigrpd
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 /eigrpd
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 'eigrpd')
-rw-r--r--eigrpd/eigrp_packet.c4
-rw-r--r--eigrpd/eigrp_snmp.c2
-rw-r--r--eigrpd/eigrpd.c2
3 files changed, 4 insertions, 4 deletions
diff --git a/eigrpd/eigrp_packet.c b/eigrpd/eigrp_packet.c
index 491b2994b..dd5ba8a16 100644
--- a/eigrpd/eigrp_packet.c
+++ b/eigrpd/eigrp_packet.c
@@ -370,7 +370,7 @@ void eigrp_write(struct thread *thread)
if (ep->dst.s_addr == htonl(EIGRP_MULTICAST_ADDRESS))
eigrp_if_ipmulticast(eigrp, &ei->address, ei->ifp->ifindex);
- memset(&iph, 0, sizeof(struct ip));
+ memset(&iph, 0, sizeof(iph));
memset(&sa_dst, 0, sizeof(sa_dst));
/*
@@ -713,7 +713,7 @@ static struct stream *eigrp_recv_packet(struct eigrp *eigrp,
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;
diff --git a/eigrpd/eigrp_snmp.c b/eigrpd/eigrp_snmp.c
index 9ada292fe..5a930424c 100644
--- a/eigrpd/eigrp_snmp.c
+++ b/eigrpd/eigrp_snmp.c
@@ -1034,7 +1034,7 @@ static uint8_t *eigrpPeerEntry(struct variable *v, oid *name, size_t *length,
== MATCH_FAILED)
return NULL;
- memset(&nbr_addr, 0, sizeof(struct in_addr));
+ memset(&nbr_addr, 0, sizeof(nbr_addr));
ifindex = 0;
nbr = eigrpNbrLookup(v, name, length, &nbr_addr, &ifindex, exact);
diff --git a/eigrpd/eigrpd.c b/eigrpd/eigrpd.c
index 84d4f6aee..7bc7be970 100644
--- a/eigrpd/eigrpd.c
+++ b/eigrpd/eigrpd.c
@@ -123,7 +123,7 @@ void eigrp_master_init(void)
{
struct timeval tv;
- memset(&eigrp_master, 0, sizeof(struct eigrp_master));
+ memset(&eigrp_master, 0, sizeof(eigrp_master));
eigrp_om = &eigrp_master;
eigrp_om->eigrp = list_new();