summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas.abraitis@gmail.com>2020-04-20 12:59:52 +0300
committerDonatas Abraitis <donatas.abraitis@gmail.com>2020-04-20 12:59:52 +0300
commit7f972cd8dc7e11bc3b75c6f013566ffa5ec3eda0 (patch)
tree7f02deec3ba0f2711ec242947b8fc968df55a50d
parentb34b48cb3afd0a567eca94c642cd07f79b0ace8d (diff)
bgpd: Use true/false for reject_as_sets
Just remove MACROS and use true/false. Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
-rw-r--r--bgpd/bgp_route.c6
-rw-r--r--bgpd/bgp_vty.c6
-rw-r--r--bgpd/bgpd.c2
-rw-r--r--bgpd/bgpd.h2
4 files changed, 7 insertions, 9 deletions
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
index 64a6225465..4b9550d79a 100644
--- a/bgpd/bgp_route.c
+++ b/bgpd/bgp_route.c
@@ -1935,7 +1935,7 @@ bool subgroup_announce_check(struct bgp_node *rn, struct bgp_path_info *pi,
* and RFC 5065 by eliminating AS_SET and AS_CONFED_SET types,
* and obsoletes RFC 6472.
*/
- if (peer->bgp->reject_as_sets == BGP_REJECT_AS_SETS_ENABLED)
+ if (peer->bgp->reject_as_sets)
if (aspath_check_as_sets(attr->aspath))
return false;
@@ -3425,7 +3425,7 @@ int bgp_update(struct peer *peer, const struct prefix *p, uint32_t addpath_id,
* and RFC 5065 by eliminating AS_SET and AS_CONFED_SET types,
* and obsoletes RFC 6472.
*/
- if (peer->bgp->reject_as_sets == BGP_REJECT_AS_SETS_ENABLED)
+ if (peer->bgp->reject_as_sets)
if (aspath_check_as_sets(attr->aspath)) {
reason =
"as-path contains AS_SET or AS_CONFED_SET type;";
@@ -6890,7 +6890,7 @@ static int bgp_aggregate_set(struct vty *vty, const char *prefix_str, afi_t afi,
* subsumed by the previously aggregated route) without AS_SET
* or AS_CONFED_SET in the updates.
*/
- if (bgp->reject_as_sets == BGP_REJECT_AS_SETS_ENABLED) {
+ if (bgp->reject_as_sets) {
if (as_set == AGGREGATE_AS_SET) {
as_set_new = AGGREGATE_AS_UNSET;
zlog_warn(
diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c
index 157d73b5ff..a356564813 100644
--- a/bgpd/bgp_vty.c
+++ b/bgpd/bgp_vty.c
@@ -2067,7 +2067,7 @@ DEFUN(bgp_reject_as_sets, bgp_reject_as_sets_cmd,
struct listnode *node, *nnode;
struct peer *peer;
- bgp->reject_as_sets = BGP_REJECT_AS_SETS_ENABLED;
+ bgp->reject_as_sets = true;
/* Reset existing BGP sessions to reject routes
* with aspath containing AS_SET or AS_CONFED_SET.
@@ -2093,7 +2093,7 @@ DEFUN(no_bgp_reject_as_sets, no_bgp_reject_as_sets_cmd,
struct listnode *node, *nnode;
struct peer *peer;
- bgp->reject_as_sets = BGP_REJECT_AS_SETS_DISABLED;
+ bgp->reject_as_sets = false;
/* Reset existing BGP sessions to reject routes
* with aspath containing AS_SET or AS_CONFED_SET.
@@ -15082,7 +15082,7 @@ int bgp_config_write(struct vty *vty)
: "no ");
/* draft-ietf-idr-deprecate-as-set-confed-set */
- if (bgp->reject_as_sets == BGP_REJECT_AS_SETS_ENABLED)
+ if (bgp->reject_as_sets)
vty_out(vty, " bgp reject-as-sets\n");
/* BGP default ipv4-unicast. */
diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c
index c1b0d74aba..5d28b138d6 100644
--- a/bgpd/bgpd.c
+++ b/bgpd/bgpd.c
@@ -2972,7 +2972,7 @@ static struct bgp *bgp_create(as_t *as, const char *name,
bgp->dynamic_neighbors_count = 0;
bgp->lb_ref_bw = BGP_LINK_BW_REF_BW;
bgp->lb_handling = BGP_LINK_BW_ECMP;
- bgp->reject_as_sets = BGP_REJECT_AS_SETS_DISABLED;
+ bgp->reject_as_sets = false;
bgp_addpath_init_bgp_data(&bgp->tx_addpath);
bgp->as = *as;
diff --git a/bgpd/bgpd.h b/bgpd/bgpd.h
index afd4a85d20..4a5772a53b 100644
--- a/bgpd/bgpd.h
+++ b/bgpd/bgpd.h
@@ -598,8 +598,6 @@ struct bgp {
* Reject aspaths with AS_SET and/or AS_CONFED_SET.
*/
bool reject_as_sets;
-#define BGP_REJECT_AS_SETS_DISABLED 0
-#define BGP_REJECT_AS_SETS_ENABLED 1
struct bgp_evpn_info *evpn_info;