summaryrefslogtreecommitdiff
path: root/fpm
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2025-01-22 11:15:17 +0100
committerDavid Lamparter <equinox@opensourcerouting.org>2025-01-29 16:48:37 +0100
commit95cf0b227980999e2af22a2c171e5237e5ffca8e (patch)
treedb9003058c8bb2c45d08399fc240c338900016d1 /fpm
parentce7f5b21221f0b3557d1f4a40793230d8bc4cf02 (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>
Diffstat (limited to 'fpm')
-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;