mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-07-27 10:04:18 +00:00
Merge pull request #12765 from FRRouting/mergify/bp/dev/8.5/pr-12761
bgpd: fix use-after-free crash for evpn (backport #12761)
This commit is contained in:
commit
fb2c52d15d
@ -6896,15 +6896,17 @@ DEFUN (bgp_evpn_vni_rt,
|
||||
return CMD_WARNING;
|
||||
}
|
||||
|
||||
ecomadd = ecommunity_str2com(argv[2]->arg, ECOMMUNITY_ROUTE_TARGET, 0);
|
||||
if (!ecomadd) {
|
||||
vty_out(vty, "%% Malformed Route Target list\n");
|
||||
return CMD_WARNING;
|
||||
}
|
||||
ecommunity_str(ecomadd);
|
||||
|
||||
/* Add/update the import route-target */
|
||||
if (rt_type == RT_TYPE_BOTH || rt_type == RT_TYPE_IMPORT) {
|
||||
/* Note that first of the two RTs is created for "both" type */
|
||||
ecomadd = ecommunity_str2com(argv[2]->arg,
|
||||
ECOMMUNITY_ROUTE_TARGET, 0);
|
||||
if (!ecomadd) {
|
||||
vty_out(vty, "%% Malformed Route Target list\n");
|
||||
return CMD_WARNING;
|
||||
}
|
||||
ecommunity_str(ecomadd);
|
||||
|
||||
/* Do nothing if we already have this import route-target */
|
||||
if (!bgp_evpn_rt_matches_existing(vpn->import_rtl, ecomadd))
|
||||
evpn_configure_import_rt(bgp, vpn, ecomadd);
|
||||
@ -6912,6 +6914,15 @@ DEFUN (bgp_evpn_vni_rt,
|
||||
|
||||
/* Add/update the export route-target */
|
||||
if (rt_type == RT_TYPE_BOTH || rt_type == RT_TYPE_EXPORT) {
|
||||
/* Note that second of the two RTs is created for "both" type */
|
||||
ecomadd = ecommunity_str2com(argv[2]->arg,
|
||||
ECOMMUNITY_ROUTE_TARGET, 0);
|
||||
if (!ecomadd) {
|
||||
vty_out(vty, "%% Malformed Route Target list\n");
|
||||
return CMD_WARNING;
|
||||
}
|
||||
ecommunity_str(ecomadd);
|
||||
|
||||
/* Do nothing if we already have this export route-target */
|
||||
if (!bgp_evpn_rt_matches_existing(vpn->export_rtl, ecomadd))
|
||||
evpn_configure_export_rt(bgp, vpn, ecomadd);
|
||||
|
Loading…
Reference in New Issue
Block a user