From: Donald Sharp Date: Tue, 18 Jun 2019 13:21:49 +0000 (-0400) Subject: bgpd: BGP_ERR_MULTIPLE_INSTANCE_NOT_SET is an impossible condition X-Git-Tag: base_7.2~209^2~2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=d5568431f7d002571568b2f94c0b5150a11d29c8;p=matthieu%2Ffrr.git bgpd: BGP_ERR_MULTIPLE_INSTANCE_NOT_SET is an impossible condition This code is not returned anywhere in the system as that bgp is by default multiple-instance 'only' now. So remove the last remaining bits of it from the code base. Remove BGP_ERR_MULTIPLE_INSTANCE_USED too. Make bgp_get explicitly return BGP_SUCCESS instead of 0. Remove the multi-instance error code too. Signed-off-by: Donald Sharp --- diff --git a/bgpd/bgp_errors.c b/bgpd/bgp_errors.c index 6e181697d6..d9aba87e35 100644 --- a/bgpd/bgp_errors.c +++ b/bgpd/bgp_errors.c @@ -426,12 +426,6 @@ static struct log_ref ferr_bgp_err[] = { .description = "BGP attempted to create an EVPN ES entry and failed", .suggestion = "Most likely a bug. If the problem persists, report the problem for troubleshooting" }, - { - .code = EC_BGP_MULTI_INSTANCE, - .title = "BGP config multi-instance issue", - .description = "BGP configuration attempting multiple instances without enabling the feature", - .suggestion = "Correct the configuration so that bgp multiple-instance is enabled if desired" - }, { .code = EC_BGP_EVPN_AS_MISMATCH, .title = "BGP AS configuration issue", diff --git a/bgpd/bgp_errors.h b/bgpd/bgp_errors.h index 39d043ff13..35c5cc3998 100644 --- a/bgpd/bgp_errors.h +++ b/bgpd/bgp_errors.h @@ -67,7 +67,6 @@ enum bgp_log_refs { EC_BGP_EVPN_ROUTE_INVALID, EC_BGP_EVPN_ROUTE_CREATE, EC_BGP_ES_CREATE, - EC_BGP_MULTI_INSTANCE, EC_BGP_EVPN_AS_MISMATCH, EC_BGP_EVPN_INSTANCE_MISMATCH, EC_BGP_FLOWSPEC_PACKET, diff --git a/bgpd/bgp_evpn.c b/bgpd/bgp_evpn.c index c4b2a606c5..94022ec1be 100644 --- a/bgpd/bgp_evpn.c +++ b/bgpd/bgp_evpn.c @@ -5533,10 +5533,6 @@ int bgp_evpn_local_l3vni_add(vni_t l3vni, vrf_id_t vrf_id, struct ethaddr *rmac, vrf_id == VRF_DEFAULT ? BGP_INSTANCE_TYPE_DEFAULT : BGP_INSTANCE_TYPE_VRF); switch (ret) { - case BGP_ERR_MULTIPLE_INSTANCE_NOT_SET: - flog_err(EC_BGP_MULTI_INSTANCE, - "'bgp multiple-instance' not present\n"); - return -1; case BGP_ERR_AS_MISMATCH: flog_err(EC_BGP_EVPN_AS_MISMATCH, "BGP is already running; AS is %u\n", as); diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index a18a3bb952..6cbb9af50e 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -979,10 +979,6 @@ DEFUN_NOSH (router_bgp, ret = bgp_get(&bgp, &as, name, inst_type); switch (ret) { - case BGP_ERR_MULTIPLE_INSTANCE_NOT_SET: - vty_out(vty, - "Please specify 'bgp multiple-instance' first\n"); - return CMD_WARNING_CONFIG_FAILED; case BGP_ERR_AS_MISMATCH: vty_out(vty, "BGP is already running; AS is %u\n", as); return CMD_WARNING_CONFIG_FAILED; diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c index af90e9841a..3ca209676f 100644 --- a/bgpd/bgpd.c +++ b/bgpd/bgpd.c @@ -3183,7 +3183,7 @@ int bgp_get(struct bgp **bgp_val, as_t *as, const char *name, if (bgp->inst_type != inst_type) return BGP_ERR_INSTANCE_MISMATCH; *bgp_val = bgp; - return 0; + return BGP_SUCCESS; } bgp = bgp_create(as, name, inst_type); @@ -3217,7 +3217,7 @@ int bgp_get(struct bgp **bgp_val, as_t *as, const char *name, bgp_zebra_instance_register(bgp); } - return 0; + return BGP_SUCCESS; } /* diff --git a/bgpd/bgpd.h b/bgpd/bgpd.h index 088c6411b4..4bce73898f 100644 --- a/bgpd/bgpd.h +++ b/bgpd/bgpd.h @@ -1453,12 +1453,10 @@ enum bgp_clear_type { #define BGP_ERR_INVALID_AS -3 #define BGP_ERR_INVALID_BGP -4 #define BGP_ERR_PEER_GROUP_MEMBER -5 -#define BGP_ERR_MULTIPLE_INSTANCE_USED -6 #define BGP_ERR_PEER_GROUP_NO_REMOTE_AS -7 #define BGP_ERR_PEER_GROUP_CANT_CHANGE -8 #define BGP_ERR_PEER_GROUP_MISMATCH -9 #define BGP_ERR_PEER_GROUP_PEER_TYPE_DIFFERENT -10 -#define BGP_ERR_MULTIPLE_INSTANCE_NOT_SET -11 #define BGP_ERR_AS_MISMATCH -12 #define BGP_ERR_PEER_FLAG_CONFLICT -13 #define BGP_ERR_PEER_GROUP_SHUTDOWN -14