mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-07 13:33:15 +00:00
bgpd: bgp_update and bgp_withdraw never return failures
These two functions always return 0. As such any and all tests against this make no sense. Remove the return 0 to a void and follow the chain, logically, to remove all the dead code. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
This commit is contained in:
parent
65a78243d8
commit
367b458cb4
@ -4429,7 +4429,7 @@ static int process_type2_route(struct peer *peer, afi_t afi, safi_t safi,
|
|||||||
mpls_label_t label[BGP_MAX_LABELS] = {};
|
mpls_label_t label[BGP_MAX_LABELS] = {};
|
||||||
uint32_t num_labels = 0;
|
uint32_t num_labels = 0;
|
||||||
uint32_t eth_tag;
|
uint32_t eth_tag;
|
||||||
int ret;
|
int ret = 0;
|
||||||
|
|
||||||
/* Type-2 route should be either 33, 37 or 49 bytes or an
|
/* Type-2 route should be either 33, 37 or 49 bytes or an
|
||||||
* additional 3 bytes if there is a second label (VNI):
|
* additional 3 bytes if there is a second label (VNI):
|
||||||
@ -4522,13 +4522,13 @@ static int process_type2_route(struct peer *peer, afi_t afi, safi_t safi,
|
|||||||
|
|
||||||
/* Process the route. */
|
/* Process the route. */
|
||||||
if (attr)
|
if (attr)
|
||||||
ret = bgp_update(peer, (struct prefix *)&p, addpath_id, attr,
|
bgp_update(peer, (struct prefix *)&p, addpath_id, attr, afi,
|
||||||
afi, safi, ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL,
|
safi, ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL, &prd,
|
||||||
&prd, &label[0], num_labels, 0, &evpn);
|
&label[0], num_labels, 0, &evpn);
|
||||||
else
|
else
|
||||||
ret = bgp_withdraw(peer, (struct prefix *)&p, addpath_id, attr,
|
bgp_withdraw(peer, (struct prefix *)&p, addpath_id, attr, afi,
|
||||||
afi, safi, ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL,
|
safi, ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL, &prd,
|
||||||
&prd, &label[0], num_labels, &evpn);
|
&label[0], num_labels, &evpn);
|
||||||
goto done;
|
goto done;
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
@ -4553,7 +4553,6 @@ static int process_type3_route(struct peer *peer, afi_t afi, safi_t safi,
|
|||||||
struct prefix_evpn p;
|
struct prefix_evpn p;
|
||||||
uint8_t ipaddr_len;
|
uint8_t ipaddr_len;
|
||||||
uint32_t eth_tag;
|
uint32_t eth_tag;
|
||||||
int ret;
|
|
||||||
|
|
||||||
/* Type-3 route should be either 17 or 29 bytes: RD (8), Eth Tag (4),
|
/* Type-3 route should be either 17 or 29 bytes: RD (8), Eth Tag (4),
|
||||||
* IP len (1) and IP (4 or 16).
|
* IP len (1) and IP (4 or 16).
|
||||||
@ -4614,14 +4613,14 @@ static int process_type3_route(struct peer *peer, afi_t afi, safi_t safi,
|
|||||||
|
|
||||||
/* Process the route. */
|
/* Process the route. */
|
||||||
if (attr)
|
if (attr)
|
||||||
ret = bgp_update(peer, (struct prefix *)&p, addpath_id, attr,
|
bgp_update(peer, (struct prefix *)&p, addpath_id, attr, afi,
|
||||||
afi, safi, ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL,
|
safi, ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL, &prd, NULL,
|
||||||
&prd, NULL, 0, 0, NULL);
|
0, 0, NULL);
|
||||||
else
|
else
|
||||||
ret = bgp_withdraw(peer, (struct prefix *)&p, addpath_id, attr,
|
bgp_withdraw(peer, (struct prefix *)&p, addpath_id, attr, afi,
|
||||||
afi, safi, ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL,
|
safi, ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL, &prd,
|
||||||
&prd, NULL, 0, NULL);
|
NULL, 0, NULL);
|
||||||
return ret;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -4637,7 +4636,6 @@ static int process_type5_route(struct peer *peer, afi_t afi, safi_t safi,
|
|||||||
uint8_t ippfx_len;
|
uint8_t ippfx_len;
|
||||||
uint32_t eth_tag;
|
uint32_t eth_tag;
|
||||||
mpls_label_t label; /* holds the VNI as in the packet */
|
mpls_label_t label; /* holds the VNI as in the packet */
|
||||||
int ret;
|
|
||||||
bool is_valid_update = true;
|
bool is_valid_update = true;
|
||||||
|
|
||||||
/* Type-5 route should be 34 or 58 bytes:
|
/* Type-5 route should be 34 or 58 bytes:
|
||||||
@ -4749,9 +4747,9 @@ static int process_type5_route(struct peer *peer, afi_t afi, safi_t safi,
|
|||||||
|
|
||||||
/* Process the route. */
|
/* Process the route. */
|
||||||
if (attr && is_valid_update)
|
if (attr && is_valid_update)
|
||||||
ret = bgp_update(peer, (struct prefix *)&p, addpath_id, attr,
|
bgp_update(peer, (struct prefix *)&p, addpath_id, attr, afi,
|
||||||
afi, safi, ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL,
|
safi, ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL, &prd,
|
||||||
&prd, &label, 1, 0, &evpn);
|
&label, 1, 0, &evpn);
|
||||||
else {
|
else {
|
||||||
if (!is_valid_update) {
|
if (!is_valid_update) {
|
||||||
char attr_str[BUFSIZ] = {0};
|
char attr_str[BUFSIZ] = {0};
|
||||||
@ -4762,12 +4760,12 @@ static int process_type5_route(struct peer *peer, afi_t afi, safi_t safi,
|
|||||||
peer->hostname, peer->bgp->vrf_id, &p,
|
peer->hostname, peer->bgp->vrf_id, &p,
|
||||||
attr_str);
|
attr_str);
|
||||||
}
|
}
|
||||||
ret = bgp_withdraw(peer, (struct prefix *)&p, addpath_id, attr,
|
bgp_withdraw(peer, (struct prefix *)&p, addpath_id, attr, afi,
|
||||||
afi, safi, ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL,
|
safi, ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL, &prd,
|
||||||
&prd, &label, 1, &evpn);
|
&label, 1, &evpn);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void evpn_mpattr_encode_type5(struct stream *s, const struct prefix *p,
|
static void evpn_mpattr_encode_type5(struct stream *s, const struct prefix *p,
|
||||||
|
@ -706,7 +706,6 @@ int bgp_evpn_type4_route_process(struct peer *peer, afi_t afi, safi_t safi,
|
|||||||
struct attr *attr, uint8_t *pfx, int psize,
|
struct attr *attr, uint8_t *pfx, int psize,
|
||||||
uint32_t addpath_id)
|
uint32_t addpath_id)
|
||||||
{
|
{
|
||||||
int ret;
|
|
||||||
esi_t esi;
|
esi_t esi;
|
||||||
uint8_t ipaddr_len;
|
uint8_t ipaddr_len;
|
||||||
struct in_addr vtep_ip;
|
struct in_addr vtep_ip;
|
||||||
@ -750,15 +749,15 @@ int bgp_evpn_type4_route_process(struct peer *peer, afi_t afi, safi_t safi,
|
|||||||
build_evpn_type4_prefix(&p, &esi, vtep_ip);
|
build_evpn_type4_prefix(&p, &esi, vtep_ip);
|
||||||
/* Process the route. */
|
/* Process the route. */
|
||||||
if (attr) {
|
if (attr) {
|
||||||
ret = bgp_update(peer, (struct prefix *)&p, addpath_id, attr,
|
bgp_update(peer, (struct prefix *)&p, addpath_id, attr, afi,
|
||||||
afi, safi, ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL,
|
safi, ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL, &prd, NULL,
|
||||||
&prd, NULL, 0, 0, NULL);
|
0, 0, NULL);
|
||||||
} else {
|
} else {
|
||||||
ret = bgp_withdraw(peer, (struct prefix *)&p, addpath_id, attr,
|
bgp_withdraw(peer, (struct prefix *)&p, addpath_id, attr, afi,
|
||||||
afi, safi, ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL,
|
safi, ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL, &prd,
|
||||||
&prd, NULL, 0, NULL);
|
NULL, 0, NULL);
|
||||||
}
|
}
|
||||||
return ret;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check if a prefix belongs to the local ES */
|
/* Check if a prefix belongs to the local ES */
|
||||||
@ -1180,7 +1179,6 @@ int bgp_evpn_type1_route_process(struct peer *peer, afi_t afi, safi_t safi,
|
|||||||
struct attr *attr, uint8_t *pfx, int psize,
|
struct attr *attr, uint8_t *pfx, int psize,
|
||||||
uint32_t addpath_id)
|
uint32_t addpath_id)
|
||||||
{
|
{
|
||||||
int ret;
|
|
||||||
struct prefix_rd prd;
|
struct prefix_rd prd;
|
||||||
esi_t esi;
|
esi_t esi;
|
||||||
uint32_t eth_tag;
|
uint32_t eth_tag;
|
||||||
@ -1219,15 +1217,15 @@ int bgp_evpn_type1_route_process(struct peer *peer, afi_t afi, safi_t safi,
|
|||||||
build_evpn_type1_prefix(&p, eth_tag, &esi, vtep_ip);
|
build_evpn_type1_prefix(&p, eth_tag, &esi, vtep_ip);
|
||||||
/* Process the route. */
|
/* Process the route. */
|
||||||
if (attr) {
|
if (attr) {
|
||||||
ret = bgp_update(peer, (struct prefix *)&p, addpath_id, attr,
|
bgp_update(peer, (struct prefix *)&p, addpath_id, attr, afi,
|
||||||
afi, safi, ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL,
|
safi, ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL, &prd, NULL,
|
||||||
&prd, NULL, 0, 0, NULL);
|
0, 0, NULL);
|
||||||
} else {
|
} else {
|
||||||
ret = bgp_withdraw(peer, (struct prefix *)&p, addpath_id, attr,
|
bgp_withdraw(peer, (struct prefix *)&p, addpath_id, attr, afi,
|
||||||
afi, safi, ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL,
|
safi, ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL, &prd,
|
||||||
&prd, NULL, 0, NULL);
|
NULL, 0, NULL);
|
||||||
}
|
}
|
||||||
return ret;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void bgp_evpn_mh_config_ead_export_rt(struct bgp *bgp,
|
void bgp_evpn_mh_config_ead_export_rt(struct bgp *bgp,
|
||||||
|
@ -103,7 +103,6 @@ int bgp_nlri_parse_flowspec(struct peer *peer, struct attr *attr,
|
|||||||
safi_t safi;
|
safi_t safi;
|
||||||
int psize = 0;
|
int psize = 0;
|
||||||
struct prefix p;
|
struct prefix p;
|
||||||
int ret;
|
|
||||||
void *temp;
|
void *temp;
|
||||||
|
|
||||||
/* Start processing the NLRI - there may be multiple in the MP_REACH */
|
/* Start processing the NLRI - there may be multiple in the MP_REACH */
|
||||||
@ -190,21 +189,13 @@ int bgp_nlri_parse_flowspec(struct peer *peer, struct attr *attr,
|
|||||||
}
|
}
|
||||||
/* Process the route. */
|
/* Process the route. */
|
||||||
if (!withdraw)
|
if (!withdraw)
|
||||||
ret = bgp_update(peer, &p, 0, attr,
|
bgp_update(peer, &p, 0, attr, afi, safi,
|
||||||
afi, safi,
|
ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL, NULL,
|
||||||
ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL,
|
NULL, 0, 0, NULL);
|
||||||
NULL, NULL, 0, 0, NULL);
|
|
||||||
else
|
else
|
||||||
ret = bgp_withdraw(peer, &p, 0, attr,
|
bgp_withdraw(peer, &p, 0, attr, afi, safi,
|
||||||
afi, safi,
|
ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL, NULL,
|
||||||
ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL,
|
NULL, 0, NULL);
|
||||||
NULL, NULL, 0, NULL);
|
|
||||||
if (ret) {
|
|
||||||
flog_err(EC_BGP_FLOWSPEC_INSTALLATION,
|
|
||||||
"Flowspec NLRI failed to be %s.",
|
|
||||||
attr ? "added" : "withdrawn");
|
|
||||||
return BGP_NLRI_PARSE_ERROR;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return BGP_NLRI_PARSE_OK;
|
return BGP_NLRI_PARSE_OK;
|
||||||
}
|
}
|
||||||
|
@ -211,16 +211,10 @@ static void bgp_process_mac_rescan_table(struct bgp *bgp, struct peer *peer,
|
|||||||
|
|
||||||
memcpy(&evpn, bgp_attr_get_evpn_overlay(pi->attr),
|
memcpy(&evpn, bgp_attr_get_evpn_overlay(pi->attr),
|
||||||
sizeof(evpn));
|
sizeof(evpn));
|
||||||
int32_t ret = bgp_update(peer, p,
|
bgp_update(peer, p, pi->addpath_rx_id, pi->attr,
|
||||||
pi->addpath_rx_id,
|
AFI_L2VPN, SAFI_EVPN, ZEBRA_ROUTE_BGP,
|
||||||
pi->attr, AFI_L2VPN, SAFI_EVPN,
|
BGP_ROUTE_NORMAL, &prd, label_pnt,
|
||||||
ZEBRA_ROUTE_BGP,
|
num_labels, 1, evpn);
|
||||||
BGP_ROUTE_NORMAL, &prd,
|
|
||||||
label_pnt, num_labels,
|
|
||||||
1, evpn);
|
|
||||||
|
|
||||||
if (ret < 0)
|
|
||||||
bgp_dest_unlock_node(dest);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3957,11 +3957,11 @@ static bool bgp_accept_own(struct peer *peer, afi_t afi, safi_t safi,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
int bgp_update(struct peer *peer, const struct prefix *p, uint32_t addpath_id,
|
void bgp_update(struct peer *peer, const struct prefix *p, uint32_t addpath_id,
|
||||||
struct attr *attr, afi_t afi, safi_t safi, int type,
|
struct attr *attr, afi_t afi, safi_t safi, int type,
|
||||||
int sub_type, struct prefix_rd *prd, mpls_label_t *label,
|
int sub_type, struct prefix_rd *prd, mpls_label_t *label,
|
||||||
uint32_t num_labels, int soft_reconfig,
|
uint32_t num_labels, int soft_reconfig,
|
||||||
struct bgp_route_evpn *evpn)
|
struct bgp_route_evpn *evpn)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
int aspath_loop_count = 0;
|
int aspath_loop_count = 0;
|
||||||
@ -4337,7 +4337,7 @@ int bgp_update(struct peer *peer, const struct prefix *p, uint32_t addpath_id,
|
|||||||
bgp_dest_unlock_node(dest);
|
bgp_dest_unlock_node(dest);
|
||||||
bgp_attr_unintern(&attr_new);
|
bgp_attr_unintern(&attr_new);
|
||||||
|
|
||||||
return 0;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Withdraw/Announce before we fully processed the withdraw */
|
/* Withdraw/Announce before we fully processed the withdraw */
|
||||||
@ -4551,7 +4551,7 @@ int bgp_update(struct peer *peer, const struct prefix *p, uint32_t addpath_id,
|
|||||||
ret = bgp_damp_update(pi, dest, afi, safi);
|
ret = bgp_damp_update(pi, dest, afi, safi);
|
||||||
if (ret == BGP_DAMP_SUPPRESSED) {
|
if (ret == BGP_DAMP_SUPPRESSED) {
|
||||||
bgp_dest_unlock_node(dest);
|
bgp_dest_unlock_node(dest);
|
||||||
return 0;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4671,7 +4671,7 @@ int bgp_update(struct peer *peer, const struct prefix *p, uint32_t addpath_id,
|
|||||||
bgp_unlink_nexthop(pi);
|
bgp_unlink_nexthop(pi);
|
||||||
bgp_path_info_delete(dest, pi);
|
bgp_path_info_delete(dest, pi);
|
||||||
}
|
}
|
||||||
return 0;
|
return;
|
||||||
} // End of implicit withdraw
|
} // End of implicit withdraw
|
||||||
|
|
||||||
/* Received Logging. */
|
/* Received Logging. */
|
||||||
@ -4834,7 +4834,7 @@ int bgp_update(struct peer *peer, const struct prefix *p, uint32_t addpath_id,
|
|||||||
bgp_path_info_delete(dest, new);
|
bgp_path_info_delete(dest, new);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return;
|
||||||
|
|
||||||
/* This BGP update is filtered. Log the reason then update BGP
|
/* This BGP update is filtered. Log the reason then update BGP
|
||||||
entry. */
|
entry. */
|
||||||
@ -4897,13 +4897,14 @@ filtered:
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return 0;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int bgp_withdraw(struct peer *peer, const struct prefix *p, uint32_t addpath_id,
|
void bgp_withdraw(struct peer *peer, const struct prefix *p,
|
||||||
struct attr *attr, afi_t afi, safi_t safi, int type,
|
uint32_t addpath_id, struct attr *attr, afi_t afi,
|
||||||
int sub_type, struct prefix_rd *prd, mpls_label_t *label,
|
safi_t safi, int type, int sub_type, struct prefix_rd *prd,
|
||||||
uint32_t num_labels, struct bgp_route_evpn *evpn)
|
mpls_label_t *label, uint32_t num_labels,
|
||||||
|
struct bgp_route_evpn *evpn)
|
||||||
{
|
{
|
||||||
struct bgp *bgp;
|
struct bgp *bgp;
|
||||||
char pfx_buf[BGP_PRD_PATH_STRLEN];
|
char pfx_buf[BGP_PRD_PATH_STRLEN];
|
||||||
@ -4948,7 +4949,7 @@ int bgp_withdraw(struct peer *peer, const struct prefix *p, uint32_t addpath_id,
|
|||||||
peer->host, pfx_buf);
|
peer->host, pfx_buf);
|
||||||
}
|
}
|
||||||
bgp_dest_unlock_node(dest);
|
bgp_dest_unlock_node(dest);
|
||||||
return 0;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Lookup withdrawn route. */
|
/* Lookup withdrawn route. */
|
||||||
@ -4990,7 +4991,7 @@ int bgp_withdraw(struct peer *peer, const struct prefix *p, uint32_t addpath_id,
|
|||||||
/* Unlock bgp_node_get() lock. */
|
/* Unlock bgp_node_get() lock. */
|
||||||
bgp_dest_unlock_node(dest);
|
bgp_dest_unlock_node(dest);
|
||||||
|
|
||||||
return 0;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
void bgp_default_originate(struct peer *peer, afi_t afi, safi_t safi,
|
void bgp_default_originate(struct peer *peer, afi_t afi, safi_t safi,
|
||||||
@ -5122,10 +5123,10 @@ static void bgp_soft_reconfig_table_flag(struct bgp_table *table, bool flag)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int bgp_soft_reconfig_table_update(struct peer *peer,
|
static void bgp_soft_reconfig_table_update(struct peer *peer,
|
||||||
struct bgp_dest *dest,
|
struct bgp_dest *dest,
|
||||||
struct bgp_adj_in *ain, afi_t afi,
|
struct bgp_adj_in *ain, afi_t afi,
|
||||||
safi_t safi, struct prefix_rd *prd)
|
safi_t safi, struct prefix_rd *prd)
|
||||||
{
|
{
|
||||||
struct bgp_path_info *pi;
|
struct bgp_path_info *pi;
|
||||||
uint32_t num_labels = 0;
|
uint32_t num_labels = 0;
|
||||||
@ -5146,17 +5147,15 @@ static int bgp_soft_reconfig_table_update(struct peer *peer,
|
|||||||
else
|
else
|
||||||
memset(&evpn, 0, sizeof(evpn));
|
memset(&evpn, 0, sizeof(evpn));
|
||||||
|
|
||||||
return bgp_update(peer, bgp_dest_get_prefix(dest), ain->addpath_rx_id,
|
bgp_update(peer, bgp_dest_get_prefix(dest), ain->addpath_rx_id,
|
||||||
ain->attr, afi, safi, ZEBRA_ROUTE_BGP,
|
ain->attr, afi, safi, ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL, prd,
|
||||||
BGP_ROUTE_NORMAL, prd, label_pnt, num_labels, 1,
|
label_pnt, num_labels, 1, &evpn);
|
||||||
&evpn);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void bgp_soft_reconfig_table(struct peer *peer, afi_t afi, safi_t safi,
|
static void bgp_soft_reconfig_table(struct peer *peer, afi_t afi, safi_t safi,
|
||||||
struct bgp_table *table,
|
struct bgp_table *table,
|
||||||
struct prefix_rd *prd)
|
struct prefix_rd *prd)
|
||||||
{
|
{
|
||||||
int ret;
|
|
||||||
struct bgp_dest *dest;
|
struct bgp_dest *dest;
|
||||||
struct bgp_adj_in *ain;
|
struct bgp_adj_in *ain;
|
||||||
|
|
||||||
@ -5168,13 +5167,8 @@ static void bgp_soft_reconfig_table(struct peer *peer, afi_t afi, safi_t safi,
|
|||||||
if (ain->peer != peer)
|
if (ain->peer != peer)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
ret = bgp_soft_reconfig_table_update(peer, dest, ain,
|
bgp_soft_reconfig_table_update(peer, dest, ain, afi,
|
||||||
afi, safi, prd);
|
safi, prd);
|
||||||
|
|
||||||
if (ret < 0) {
|
|
||||||
bgp_dest_unlock_node(dest);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5189,7 +5183,6 @@ static void bgp_soft_reconfig_table(struct peer *peer, afi_t afi, safi_t safi,
|
|||||||
static void bgp_soft_reconfig_table_task(struct thread *thread)
|
static void bgp_soft_reconfig_table_task(struct thread *thread)
|
||||||
{
|
{
|
||||||
uint32_t iter, max_iter;
|
uint32_t iter, max_iter;
|
||||||
int ret;
|
|
||||||
struct bgp_dest *dest;
|
struct bgp_dest *dest;
|
||||||
struct bgp_adj_in *ain;
|
struct bgp_adj_in *ain;
|
||||||
struct peer *peer;
|
struct peer *peer;
|
||||||
@ -5222,27 +5215,10 @@ static void bgp_soft_reconfig_table_task(struct thread *thread)
|
|||||||
if (ain->peer != peer)
|
if (ain->peer != peer)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
ret = bgp_soft_reconfig_table_update(
|
bgp_soft_reconfig_table_update(
|
||||||
peer, dest, ain, table->afi,
|
peer, dest, ain, table->afi,
|
||||||
table->safi, prd);
|
table->safi, prd);
|
||||||
iter++;
|
iter++;
|
||||||
|
|
||||||
if (ret < 0) {
|
|
||||||
bgp_dest_unlock_node(dest);
|
|
||||||
listnode_delete(
|
|
||||||
table->soft_reconfig_peers,
|
|
||||||
peer);
|
|
||||||
bgp_announce_route(peer, table->afi,
|
|
||||||
table->safi, false);
|
|
||||||
if (list_isempty(
|
|
||||||
table->soft_reconfig_peers)) {
|
|
||||||
list_delete(
|
|
||||||
&table->soft_reconfig_peers);
|
|
||||||
bgp_soft_reconfig_table_flag(
|
|
||||||
table, false);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -5959,7 +5935,6 @@ int bgp_nlri_parse_ip(struct peer *peer, struct attr *attr,
|
|||||||
uint8_t *lim;
|
uint8_t *lim;
|
||||||
struct prefix p;
|
struct prefix p;
|
||||||
int psize;
|
int psize;
|
||||||
int ret;
|
|
||||||
afi_t afi;
|
afi_t afi;
|
||||||
safi_t safi;
|
safi_t safi;
|
||||||
bool addpath_capable;
|
bool addpath_capable;
|
||||||
@ -6072,23 +6047,18 @@ int bgp_nlri_parse_ip(struct peer *peer, struct attr *attr,
|
|||||||
|
|
||||||
/* Normal process. */
|
/* Normal process. */
|
||||||
if (attr)
|
if (attr)
|
||||||
ret = bgp_update(peer, &p, addpath_id, attr, afi, safi,
|
bgp_update(peer, &p, addpath_id, attr, afi, safi,
|
||||||
ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL,
|
ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL, NULL,
|
||||||
NULL, NULL, 0, 0, NULL);
|
NULL, 0, 0, NULL);
|
||||||
else
|
else
|
||||||
ret = bgp_withdraw(peer, &p, addpath_id, attr, afi,
|
bgp_withdraw(peer, &p, addpath_id, attr, afi, safi,
|
||||||
safi, ZEBRA_ROUTE_BGP,
|
ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL, NULL,
|
||||||
BGP_ROUTE_NORMAL, NULL, NULL, 0,
|
NULL, 0, NULL);
|
||||||
NULL);
|
|
||||||
|
|
||||||
/* Do not send BGP notification twice when maximum-prefix count
|
/* Do not send BGP notification twice when maximum-prefix count
|
||||||
* overflow. */
|
* overflow. */
|
||||||
if (CHECK_FLAG(peer->sflags, PEER_STATUS_PREFIX_OVERFLOW))
|
if (CHECK_FLAG(peer->sflags, PEER_STATUS_PREFIX_OVERFLOW))
|
||||||
return BGP_NLRI_PARSE_ERROR_PREFIX_OVERFLOW;
|
return BGP_NLRI_PARSE_ERROR_PREFIX_OVERFLOW;
|
||||||
|
|
||||||
/* Address family configuration mismatch. */
|
|
||||||
if (ret < 0)
|
|
||||||
return BGP_NLRI_PARSE_ERROR_ADDRESS_FAMILY;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Packet length consistency check. */
|
/* Packet length consistency check. */
|
||||||
|
@ -750,17 +750,17 @@ extern int bgp_static_unset_safi(afi_t afi, safi_t safi, struct vty *,
|
|||||||
const char *, const char *, const char *);
|
const char *, const char *, const char *);
|
||||||
|
|
||||||
/* this is primarily for MPLS-VPN */
|
/* this is primarily for MPLS-VPN */
|
||||||
extern int bgp_update(struct peer *peer, const struct prefix *p,
|
extern void bgp_update(struct peer *peer, const struct prefix *p,
|
||||||
uint32_t addpath_id, struct attr *attr,
|
uint32_t addpath_id, struct attr *attr, afi_t afi,
|
||||||
afi_t afi, safi_t safi, int type, int sub_type,
|
safi_t safi, int type, int sub_type,
|
||||||
struct prefix_rd *prd, mpls_label_t *label,
|
struct prefix_rd *prd, mpls_label_t *label,
|
||||||
uint32_t num_labels, int soft_reconfig,
|
uint32_t num_labels, int soft_reconfig,
|
||||||
struct bgp_route_evpn *evpn);
|
struct bgp_route_evpn *evpn);
|
||||||
extern int bgp_withdraw(struct peer *peer, const struct prefix *p,
|
extern void bgp_withdraw(struct peer *peer, const struct prefix *p,
|
||||||
uint32_t addpath_id, struct attr *attr, afi_t afi,
|
uint32_t addpath_id, struct attr *attr, afi_t afi,
|
||||||
safi_t safi, int type, int sub_type,
|
safi_t safi, int type, int sub_type,
|
||||||
struct prefix_rd *prd, mpls_label_t *label,
|
struct prefix_rd *prd, mpls_label_t *label,
|
||||||
uint32_t num_labels, struct bgp_route_evpn *evpn);
|
uint32_t num_labels, struct bgp_route_evpn *evpn);
|
||||||
|
|
||||||
/* for bgp_nexthop and bgp_damp */
|
/* for bgp_nexthop and bgp_damp */
|
||||||
extern void bgp_process(struct bgp *, struct bgp_dest *, afi_t, safi_t);
|
extern void bgp_process(struct bgp *, struct bgp_dest *, afi_t, safi_t);
|
||||||
|
Loading…
Reference in New Issue
Block a user