forked from Mirror/frr
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>
This commit is contained in:
parent
ce7f5b2122
commit
95cf0b2279
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue