diff options
| author | David Lamparter <equinox@opensourcerouting.org> | 2025-01-22 11:15:17 +0100 |
|---|---|---|
| committer | Mergify <37929162+mergify[bot]@users.noreply.github.com> | 2025-02-11 08:43:28 +0000 |
| commit | a8775530a062b2c9056b605c13914f3e1ed20d3a (patch) | |
| tree | 795c5c13e8d5b87e0797e895a1c0911070d1716b /fpm | |
| parent | 36534e15c0b83d434e00fba2d999655723e46f9e (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')
| -rw-r--r-- | fpm/fpm_pb.h | 1 |
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; |
