bgpd: Remove unnecessary check for groups

The `NULL` check for newly created groups (`updgroup` and `subgroup`)
are unnecessary,  just remove them.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
This commit is contained in:
anlan_cs 2023-04-16 13:41:40 +08:00
parent 89f0982149
commit 06af0667ad

View File

@ -1961,15 +1961,8 @@ void update_group_adjust_peer(struct peer_af *paf)
}
updgrp = update_group_find(paf);
if (!updgrp) {
if (!updgrp)
updgrp = update_group_create(paf);
if (!updgrp) {
flog_err(EC_BGP_UPDGRP_CREATE,
"couldn't create update group for peer %s",
paf->peer->host);
return;
}
}
old_subgrp = paf->subgroup;
@ -1992,11 +1985,8 @@ void update_group_adjust_peer(struct peer_af *paf)
}
subgrp = update_subgroup_find(updgrp, paf);
if (!subgrp) {
if (!subgrp)
subgrp = update_subgroup_create(updgrp);
if (!subgrp)
return;
}
update_subgroup_add_peer(subgrp, paf, 1);
if (BGP_DEBUG(update_groups, UPDATE_GROUPS))