summaryrefslogtreecommitdiff
path: root/fpm/fpm_pb.h
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2025-01-22 11:15:17 +0100
committerMergify <37929162+mergify[bot]@users.noreply.github.com>2025-02-11 08:43:50 +0000
commitf1b098b030e4b0a5a6c1f1f107d8951c0c8399cf (patch)
tree3980790c186c669b78b99b7010239e978242b374 /fpm/fpm_pb.h
parentb350439609305e75619dc5104b5a809b1a31ee7f (diff)
fpm: guard against garbage in unused address bytes
Zero out the 12 unused bytes (for the IPv6 address) when reading in an IPv4 address. Signed-off-by: David Lamparter <equinox@opensourcerouting.org> (cherry picked from commit 95cf0b227980999e2af22a2c171e5237e5ffca8e)
Diffstat (limited to 'fpm/fpm_pb.h')
-rw-r--r--fpm/fpm_pb.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/fpm/fpm_pb.h b/fpm/fpm_pb.h
index 23d7e43993..8847365a37 100644
--- a/fpm/fpm_pb.h
+++ b/fpm/fpm_pb.h
@@ -111,6 +111,7 @@ static inline int fpm__nexthop__get(const Fpm__Nexthop *nh,
nexthop->vrf_id = VRF_DEFAULT;
nexthop->type = NEXTHOP_TYPE_IPV4;
+ memset(&nexthop->gate, 0, sizeof(nexthop->gate));
nexthop->gate.ipv4 = ipv4;
if (ifindex) {
nexthop->type = NEXTHOP_TYPE_IPV4_IFINDEX;