Merge pull request #15921 from cscarpitta/bgp-fix-srv6-locator-delete-crash

bgpd: Fix crash when deleting the SRv6 locator
This commit is contained in:
Donatas Abraitis 2024-05-06 08:51:24 +03:00 committed by GitHub
commit d81740eccd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3385,12 +3385,12 @@ static int bgp_zebra_process_srv6_locator_add(ZAPI_CALLBACK_ARGS)
struct bgp *bgp = bgp_get_default();
const char *loc_name = bgp->srv6_locator_name;
if (zapi_srv6_locator_decode(zclient->ibuf, &loc) < 0)
return -1;
if (!bgp || !bgp->srv6_enabled)
return 0;
if (zapi_srv6_locator_decode(zclient->ibuf, &loc) < 0)
return -1;
if (bgp_zebra_srv6_manager_get_locator_chunk(loc_name) < 0)
return -1;
@ -3408,6 +3408,9 @@ static int bgp_zebra_process_srv6_locator_delete(ZAPI_CALLBACK_ARGS)
struct in6_addr *tovpn_sid;
struct prefix_ipv6 tmp_prefi;
if (!bgp)
return 0;
if (zapi_srv6_locator_decode(zclient->ibuf, &loc) < 0)
return -1;