Merge pull request #18235 from donaldsharp/static_registering_unknown_vrf

staticd: Fix crash because registering unknown vrf
This commit is contained in:
Donatas Abraitis 2025-02-26 09:00:59 +01:00 committed by GitHub
commit 1016090a8a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -323,6 +323,10 @@ void static_zebra_nht_register(struct static_nexthop *nh, bool reg)
if (!static_zebra_nht_get_prefix(nh, &lookup.nh))
return;
if (nh->nh_vrf_id == VRF_UNKNOWN)
return;
lookup.nh_vrf_id = nh->nh_vrf_id;
lookup.safi = si->safi;