Skip to content

Commit

Permalink
Merge pull request #15936 from FRRouting/mergify/bp/stable/9.1/pr-15921
Browse files Browse the repository at this point in the history
bgpd: Fix crash when deleting the SRv6 locator (backport #15921)
  • Loading branch information
ton31337 committed May 7, 2024
2 parents 6ff958a + d78ec6a commit 568c9de
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions bgpd/bgp_zebra.c
Original file line number Diff line number Diff line change
Expand Up @@ -3197,12 +3197,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;

Expand All @@ -3220,6 +3220,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;

Expand Down

0 comments on commit 568c9de

Please sign in to comment.