]> 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:52:53 +0000 (18:52 +0000)
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 659cd66427ac8a6fe705b4a319245b7c88f80c05)

zebra/zebra_snmp.c

index 1b5c2e305a84a91a717c393268ea9e35a14d6c1d..cd06cb8eec0e725cc2b82eb157d2542bda1452e4 100644 (file)
@@ -313,14 +313,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;