mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-14 06:50:17 +00:00
bgpd: remove unnecessary check for evpn
Since `bgp->vnihash` is naturally non-NULL, remove check for this field. Signed-off-by: anlan_cs <vic.lan@pica8.com>
This commit is contained in:
parent
64643ba79a
commit
f33bf7c0eb
@ -2256,9 +2256,6 @@ static struct bgpevpn *evpn_create_update_vni(struct bgp *bgp, vni_t vni)
|
|||||||
struct bgpevpn *vpn;
|
struct bgpevpn *vpn;
|
||||||
struct in_addr mcast_grp = {INADDR_ANY};
|
struct in_addr mcast_grp = {INADDR_ANY};
|
||||||
|
|
||||||
if (!bgp->vnihash)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
vpn = bgp_evpn_lookup_vni(bgp, vni);
|
vpn = bgp_evpn_lookup_vni(bgp, vni);
|
||||||
if (!vpn) {
|
if (!vpn) {
|
||||||
/* Check if this L2VNI is already configured as L3VNI */
|
/* Check if this L2VNI is already configured as L3VNI */
|
||||||
@ -2290,8 +2287,6 @@ static struct bgpevpn *evpn_create_update_vni(struct bgp *bgp, vni_t vni)
|
|||||||
*/
|
*/
|
||||||
static void evpn_delete_vni(struct bgp *bgp, struct bgpevpn *vpn)
|
static void evpn_delete_vni(struct bgp *bgp, struct bgpevpn *vpn)
|
||||||
{
|
{
|
||||||
assert(bgp->vnihash);
|
|
||||||
|
|
||||||
if (!is_vni_live(vpn)) {
|
if (!is_vni_live(vpn)) {
|
||||||
bgp_evpn_free(bgp, vpn);
|
bgp_evpn_free(bgp, vpn);
|
||||||
return;
|
return;
|
||||||
@ -6291,7 +6286,7 @@ void bgp_config_write_evpn_info(struct vty *vty, struct bgp *bgp, afi_t afi,
|
|||||||
if (bgp->advertise_all_vni)
|
if (bgp->advertise_all_vni)
|
||||||
vty_out(vty, " advertise-all-vni\n");
|
vty_out(vty, " advertise-all-vni\n");
|
||||||
|
|
||||||
if (bgp->vnihash) {
|
if (hashcount(bgp->vnihash)) {
|
||||||
struct list *vnilist = hash_to_list(bgp->vnihash);
|
struct list *vnilist = hash_to_list(bgp->vnihash);
|
||||||
struct listnode *ln;
|
struct listnode *ln;
|
||||||
struct bgpevpn *data;
|
struct bgpevpn *data;
|
||||||
|
@ -1554,7 +1554,7 @@ DEFUN (no_router_bgp,
|
|||||||
BGP_L2VPN_EVPN_ADV_IPV6_UNICAST) ||
|
BGP_L2VPN_EVPN_ADV_IPV6_UNICAST) ||
|
||||||
CHECK_FLAG(tmp_bgp->af_flags[AFI_L2VPN][SAFI_EVPN],
|
CHECK_FLAG(tmp_bgp->af_flags[AFI_L2VPN][SAFI_EVPN],
|
||||||
BGP_L2VPN_EVPN_ADV_IPV6_UNICAST_GW_IP))) ||
|
BGP_L2VPN_EVPN_ADV_IPV6_UNICAST_GW_IP))) ||
|
||||||
(tmp_bgp->vnihash && hashcount(tmp_bgp->vnihash))) {
|
(hashcount(tmp_bgp->vnihash))) {
|
||||||
vty_out(vty,
|
vty_out(vty,
|
||||||
"%% Cannot delete default BGP instance. Dependent VRF instances exist\n");
|
"%% Cannot delete default BGP instance. Dependent VRF instances exist\n");
|
||||||
return CMD_WARNING_CONFIG_FAILED;
|
return CMD_WARNING_CONFIG_FAILED;
|
||||||
|
Loading…
Reference in New Issue
Block a user