]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: Let's use memset instead of walking bytes and setting to 0
authorDonald Sharp <sharpd@nvidia.com>
Wed, 25 Sep 2024 16:08:03 +0000 (12:08 -0400)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Wed, 25 Sep 2024 18:51:41 +0000 (18:51 +0000)
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 659cd66427ac8a6fe705b4a319245b7c88f80c05)

zebra/zebra_snmp.c

index c464d6bc044be50bfe45c3ee8bc15a55921bd5e4..006f7b4fab87bdcfc814fb955f9bbd6aafcbd77b 100644 (file)
@@ -298,14 +298,8 @@ static void get_fwtable_route_node(struct variable *v, oid objid[],
        int i;
 
        /* Init index variables */
-
-       pnt = (uint8_t *)&dest;
-       for (i = 0; i < 4; i++)
-               *pnt++ = 0;
-
-       pnt = (uint8_t *)&nexthop;
-       for (i = 0; i < 4; i++)
-               *pnt++ = 0;
+       memset(&dest, 0, sizeof(dest));
+       memset(&nexthop, 0, sizeof(nexthop));
 
        proto = 0;
        policy = 0;