summaryrefslogtreecommitdiffstats
path: root/ripd/rip_snmp.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 /ripd/rip_snmp.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 'ripd/rip_snmp.c')
-rw-r--r--ripd/rip_snmp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ripd/rip_snmp.c b/ripd/rip_snmp.c
index 436dc4de0..0ce380406 100644
--- a/ripd/rip_snmp.c
+++ b/ripd/rip_snmp.c
@@ -356,7 +356,7 @@ static uint8_t *rip2IfStatEntry(struct variable *v, oid name[], size_t *length,
== MATCH_FAILED)
return NULL;
- memset(&addr, 0, sizeof(struct in_addr));
+ memset(&addr, 0, sizeof(addr));
/* Lookup interface. */
ifp = rip2IfLookup(v, name, length, &addr, exact);
@@ -457,7 +457,7 @@ static uint8_t *rip2IfConfAddress(struct variable *v, oid name[],
== MATCH_FAILED)
return NULL;
- memset(&addr, 0, sizeof(struct in_addr));
+ memset(&addr, 0, sizeof(addr));
/* Lookup interface. */
ifp = rip2IfLookup(v, name, length, &addr, exact);
@@ -529,7 +529,7 @@ static uint8_t *rip2PeerTable(struct variable *v, oid name[], size_t *length,
== MATCH_FAILED)
return NULL;
- memset(&addr, 0, sizeof(struct in_addr));
+ memset(&addr, 0, sizeof(addr));
/* Lookup interface. */
peer = rip2PeerLookup(v, name, length, &addr, exact);