]> git.puffer.fish Git - mirror/frr.git/commitdiff
build: fix new gcc 11.2 warnings 11100/head
authorDavid Lamparter <equinox@opensourcerouting.org>
Mon, 25 Apr 2022 12:07:41 +0000 (14:07 +0200)
committermergify-bot <noreply@mergify.com>
Tue, 26 Apr 2022 13:55:58 +0000 (13:55 +0000)
Some recent improvement in GCC triggers 2 new warnings, and they're
actual bugs (reading beyond end of prefix_ipv6 by accessing it as
prefix, which is larger.)  Luckily it's only in sharpd.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit 5c7a6fb36c0cf8113c19af7354782838988b263b)

sharpd/sharp_vty.c

index 5bf5f8af93ce8d98c48f1ee4999422bb5a02b5f7..e6b6981ee5a99644c766d3a3bfdeb6409e22e179 100644 (file)
@@ -102,7 +102,7 @@ DEFPY(watch_nexthop_v6, watch_nexthop_v6_cmd,
                p.family = AF_INET6;
        } else {
                type_import = true;
-               p = *(const struct prefix *)inhop;
+               prefix_copy(&p, inhop);
        }
 
        sharp_nh_tracker_get(&p);
@@ -147,7 +147,7 @@ DEFPY(watch_nexthop_v4, watch_nexthop_v4_cmd,
        }
        else {
                type_import = true;
-               p = *(const struct prefix *)inhop;
+               prefix_copy(&p, inhop);
        }
 
        sharp_nh_tracker_get(&p);