bgpd: Treat withdraw variable as a bool

Used as a bool, treated as a bool.  Make it a bool

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
This commit is contained in:
Donald Sharp 2023-04-05 15:25:57 -04:00
parent cfd04dcb3e
commit aa056a2a64
7 changed files with 9 additions and 9 deletions

View File

@ -5679,7 +5679,7 @@ void bgp_evpn_encode_prefix(struct stream *s, const struct prefix *p,
}
int bgp_nlri_parse_evpn(struct peer *peer, struct attr *attr,
struct bgp_nlri *packet, int withdraw)
struct bgp_nlri *packet, bool withdraw)
{
uint8_t *pnt;
uint8_t *lim;

View File

@ -150,7 +150,7 @@ extern void bgp_evpn_encode_prefix(struct stream *s, const struct prefix *p,
struct attr *attr, bool addpath_capable,
uint32_t addpath_tx_id);
extern int bgp_nlri_parse_evpn(struct peer *peer, struct attr *attr,
struct bgp_nlri *packet, int withdraw);
struct bgp_nlri *packet, bool withdraw);
extern int bgp_evpn_import_route(struct bgp *bgp, afi_t afi, safi_t safi,
const struct prefix *p,
struct bgp_path_info *ri);

View File

@ -82,7 +82,7 @@ static int bgp_fs_nlri_validate(uint8_t *nlri_content, uint32_t len,
}
int bgp_nlri_parse_flowspec(struct peer *peer, struct attr *attr,
struct bgp_nlri *packet, int withdraw)
struct bgp_nlri *packet, bool withdraw)
{
uint8_t *pnt;
uint8_t *lim;
@ -103,7 +103,7 @@ int bgp_nlri_parse_flowspec(struct peer *peer, struct attr *attr,
* withdraw. Flowspec should as well.
*/
if (!attr)
withdraw = 1;
withdraw = true;
if (packet->length >= FLOWSPEC_NLRI_SIZELIMIT_EXTENDED) {
flog_err(EC_BGP_FLOWSPEC_PACKET,

View File

@ -15,7 +15,7 @@
#define BGP_FLOWSPEC_NLRI_STRING_MAX 512
extern int bgp_nlri_parse_flowspec(struct peer *peer, struct attr *attr,
struct bgp_nlri *packet, int withdraw);
struct bgp_nlri *packet, bool withdraw);
extern void bgp_flowspec_vty_init(void);

View File

@ -331,7 +331,7 @@ static void bgp_update_explicit_eors(struct peer *peer)
* calling safi function and for evpn, passed as parameter
*/
int bgp_nlri_parse(struct peer *peer, struct attr *attr,
struct bgp_nlri *packet, int mp_withdraw)
struct bgp_nlri *packet, bool mp_withdraw)
{
switch (packet->safi) {
case SAFI_UNICAST:

View File

@ -59,7 +59,7 @@ extern void bgp_capability_send(struct peer *peer, afi_t afi, safi_t safi,
extern int bgp_capability_receive(struct peer *peer, bgp_size_t length);
extern int bgp_nlri_parse(struct peer *peer, struct attr *attr,
struct bgp_nlri *nlri, int mp_withdraw);
struct bgp_nlri *nlri, bool mp_withdraw);
extern void bgp_update_restarted_peers(struct peer *peer);
extern void bgp_update_implicit_eors(struct peer *peer);

View File

@ -1042,9 +1042,9 @@ static void parse_test(struct peer *peer, struct test_segment *t, int type)
if (!parse_ret) {
if (type == BGP_ATTR_MP_REACH_NLRI)
nlri_ret = bgp_nlri_parse(peer, &attr, &nlri, 0);
nlri_ret = bgp_nlri_parse(peer, &attr, &nlri, false);
else if (type == BGP_ATTR_MP_UNREACH_NLRI)
nlri_ret = bgp_nlri_parse(peer, &attr, &nlri, 1);
nlri_ret = bgp_nlri_parse(peer, &attr, &nlri, true);
}
handle_result(peer, t, parse_ret, nlri_ret);
}