Skip to content

Commit

Permalink
bgp: apply frrbot patch
Browse files Browse the repository at this point in the history
Signed-off-by: Maxence Younsi <[email protected]>
  • Loading branch information
mxyns committed Mar 26, 2024
1 parent b5ba0cd commit 2cc99f2
Show file tree
Hide file tree
Showing 10 changed files with 258 additions and 258 deletions.
448 changes: 223 additions & 225 deletions bgpd/bgp_bmp.c

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions bgpd/bgp_bmp.h
Original file line number Diff line number Diff line change
Expand Up @@ -312,11 +312,11 @@ struct bmp_bpi_lock {
.dest = (target_dest), \
.bgp = (target_bgp), \
}; \
\
\
struct bmp_bpi_lock *(head) = NULL, *(prev) = NULL, *(lookup) = NULL; \
\
\
(head) = bmp_lbpi_h_find(&bmp_lbpi, &_dummy_lbpi); \
\
\
for ((lookup) = (head); (lookup); \
(lookup) = ((prev) = (lookup))->next) { \
if ((condition)) \
Expand Down
5 changes: 3 additions & 2 deletions bgpd/bgp_conditional_adv.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,9 @@ static void bgp_conditional_adv_routes(struct peer *peer, afi_t afi,
for (pi = bgp_dest_get_bgp_path_info(dest); pi; pi = pi->next) {
advmap_attr = *pi->attr;

bool selected = bgp_check_selected(
pi, peer, addpath_capable, afi, safi);
bool selected = bgp_check_selected(pi, peer,
addpath_capable, afi,
safi);

if (selected) {
bgp_adj_out_updated(
Expand Down
5 changes: 3 additions & 2 deletions bgpd/bgp_mpath.c
Original file line number Diff line number Diff line change
Expand Up @@ -519,8 +519,9 @@ void bgp_mpath_diff_insert(struct bgp_mpath_diff_head *diff,
return;
}

struct bgp_path_info_mpath_diff *item = XCALLOC(
MTYPE_BGP_MPATH_DIFF, sizeof(struct bgp_path_info_mpath_diff));
struct bgp_path_info_mpath_diff *item =
XCALLOC(MTYPE_BGP_MPATH_DIFF,
sizeof(struct bgp_path_info_mpath_diff));
item->path = bpi;
item->update = update;

Expand Down
32 changes: 16 additions & 16 deletions bgpd/bgp_route.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ DEFINE_HOOK(bgp_route_update,
(bgp, afi, safi, bn, old_route, new_route));

DEFINE_HOOK(bgp_process_main_one_end,
(struct bgp *bgp, struct bgp_path_info *path), (bgp, path));
(struct bgp * bgp, struct bgp_path_info *path), (bgp, path));

/* Extern from bgp_dump.c */
extern const char *bgp_origin_str[];
Expand All @@ -118,12 +118,12 @@ static const struct message bgp_pmsi_tnltype_str[] = {
#define SOFT_RECONFIG_TASK_MAX_PREFIX 25000

DEFINE_HOOK(bgp_process,
(struct bgp *bgp, afi_t afi, safi_t safi, struct bgp_dest *bn,
(struct bgp * bgp, afi_t afi, safi_t safi, struct bgp_dest *bn,
uint32_t addpath_id, struct peer *peer, bool post),
(bgp, afi, safi, bn, addpath_id, peer, post));

DEFINE_HOOK(bgp_process_main_one,
(struct bgp *bgp, afi_t afi, safi_t safi, struct bgp_dest *dest),
(struct bgp * bgp, afi_t afi, safi_t safi, struct bgp_dest *dest),
(bgp, afi, safi, dest));

/** Test if path is suppressed. */
Expand Down Expand Up @@ -2085,8 +2085,8 @@ bool subgroup_announce_check(struct bgp_dest *dest, struct bgp_path_info *pi,
: pi->attr;

/* special conditions for bmp rib-out pre-policy check */
bool ignore_policy =
CHECK_FLAG(special_cond, BGP_ANNCHK_SPECIAL_IGNORE_OUT_POLICY);
bool ignore_policy = CHECK_FLAG(special_cond,
BGP_ANNCHK_SPECIAL_IGNORE_OUT_POLICY);
bool ignore_path_status =
CHECK_FLAG(special_cond, BGP_ANNCHK_SPECIAL_IGNORE_PATH_STATUS);

Expand Down Expand Up @@ -2755,8 +2755,7 @@ static void bgp_route_select_timer_expire(struct event *thread)
void bgp_best_selection(struct bgp *bgp, struct bgp_dest *dest,
struct bgp_maxpaths_cfg *mpath_cfg,
struct bgp_path_info_pair *result, afi_t afi,
safi_t safi,
struct bgp_mpath_diff_head *mpath_diff_list)
safi_t safi, struct bgp_mpath_diff_head *mpath_diff_list)
{
struct bgp_path_info *new_select;
struct bgp_path_info *old_select;
Expand Down Expand Up @@ -2873,7 +2872,8 @@ void bgp_best_selection(struct bgp *bgp, struct bgp_dest *dest,

if (CHECK_FLAG(pi->flags, BGP_PATH_REMOVED) &&
(pi != old_select)) {
bgp_mpath_diff_insert(mpath_diff_list, pi, false);
bgp_mpath_diff_insert(mpath_diff_list, pi,
false);
dest = bgp_path_info_reap(dest, pi);
assert(dest);
}
Expand Down Expand Up @@ -3434,11 +3434,10 @@ static void bgp_process_main_one(struct bgp *bgp, struct bgp_dest *dest,
frr_each (bgp_mpath_diff, &mpath_diff, diff) {
if (diff->path) {
if (debug)
zlog_debug(
"[%s] bpi: %p, dest=%pBD peer=%pBP, rx_id=%" PRIu32,
diff->update ? "+" : "-", diff->path,
diff->path->net, diff->path->peer,
diff->path->addpath_rx_id);
zlog_debug("[%s] bpi: %p, dest=%pBD peer=%pBP, rx_id=%" PRIu32,
diff->update ? "+" : "-", diff->path,
diff->path->net, diff->path->peer,
diff->path->addpath_rx_id);

hook_call(bgp_route_update, bgp, afi, safi, dest,
diff->path, diff->update ? diff->path : NULL);
Expand Down Expand Up @@ -3629,7 +3628,8 @@ static void bgp_process_main_one(struct bgp *bgp, struct bgp_dest *dest,
continue;

if (mpath->peer)
mpath->peer->stat_loc_rib_count[afi][safi] += diff->update ? 1 : -1;
mpath->peer->stat_loc_rib_count[afi][safi] +=
diff->update ? 1 : -1;

hook_call(bgp_process_main_one_end, bgp, mpath);
}
Expand Down Expand Up @@ -5220,8 +5220,8 @@ void bgp_withdraw(struct peer *peer, const struct prefix *p,
* and
* if there was no entry, we don't need to do anything more.
*/
if (CHECK_FLAG(peer->af_flags[afi][safi], PEER_FLAG_SOFT_RECONFIG)
&& peer != bgp->peer_self) {
if (CHECK_FLAG(peer->af_flags[afi][safi], PEER_FLAG_SOFT_RECONFIG) &&
peer != bgp->peer_self) {
if (!bgp_adj_in_unset(&dest, afi, safi, peer, addpath_id)) {
assert(dest);
peer->stat_pfx_dup_withdraw++;
Expand Down
12 changes: 6 additions & 6 deletions bgpd/bgp_route.h
Original file line number Diff line number Diff line change
Expand Up @@ -328,8 +328,8 @@ struct bgp_path_info {
#define BGP_PATH_ACCEPT_OWN (1 << 16)
#define BGP_PATH_MPLSVPN_LABEL_NH (1 << 17)
#define BGP_PATH_MPLSVPN_NH_LABEL_BIND (1 << 18)
#define BGP_PATH_BMP_LOCKED (1 << 19)
#define BGP_PATH_BMP_ADJIN_CHG (1 << 20)
#define BGP_PATH_BMP_LOCKED (1 << 19)
#define BGP_PATH_BMP_ADJIN_CHG (1 << 20)

/* BGP route type. This can be static, RIP, OSPF, BGP etc. */
uint8_t type;
Expand Down Expand Up @@ -683,13 +683,13 @@ static inline bool bgp_check_withdrawal(struct bgp *bgp, struct bgp_dest *dest,

/* called before bgp_process() */
DECLARE_HOOK(bgp_process,
(struct bgp *bgp, afi_t afi, safi_t safi, struct bgp_dest *bn,
(struct bgp * bgp, afi_t afi, safi_t safi, struct bgp_dest *bn,
uint32_t addpath_id, struct peer *peer, bool post),
(bgp, afi, safi, bn, addpath_id, peer, post));

/* called before bgp_process() */
DECLARE_HOOK(bgp_process_main_one,
(struct bgp *bgp, afi_t afi, safi_t safi, struct bgp_dest *dest),
(struct bgp * bgp, afi_t afi, safi_t safi, struct bgp_dest *dest),
(bgp, afi, safi, dest));

/* called when a route is updated in the rib */
Expand All @@ -700,7 +700,7 @@ DECLARE_HOOK(bgp_route_update,


DECLARE_HOOK(bgp_process_main_one_end,
(struct bgp *bgp, struct bgp_path_info *path), (bgp, path));
(struct bgp * bgp, struct bgp_path_info *path), (bgp, path));

/* BGP show options */
#define BGP_SHOW_OPT_JSON (1 << 0)
Expand Down Expand Up @@ -874,7 +874,7 @@ extern void subgroup_process_announce_selected(struct update_subgroup *subgrp,
uint32_t addpath_tx_id);

/* used by bmp to ignore certain conditions in rib-out pre-policy check */
#define BGP_ANNCHK_SPECIAL_IGNORE_OUT_POLICY (1 << 0)
#define BGP_ANNCHK_SPECIAL_IGNORE_OUT_POLICY (1 << 0)
#define BGP_ANNCHK_SPECIAL_IGNORE_PATH_STATUS (1 << 1)
#define BGP_ANNCHK_SPECIAL_PREPOLICY \
(BGP_ANNCHK_SPECIAL_IGNORE_OUT_POLICY | \
Expand Down
2 changes: 1 addition & 1 deletion bgpd/bgp_updgrp.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
PEER_CAP_ADDPATH_AF_RX_RCV | PEER_CAP_ENHE_AF_NEGO)

DECLARE_HOOK(bgp_adj_out_updated,
(struct update_subgroup *subgrp, struct bgp_dest *dest,
(struct update_subgroup * subgrp, struct bgp_dest *dest,
struct bgp_path_info *path, uint32_t addpath_id,
struct attr *attr, bool post_policy, bool withdraw),
(subgrp, dest, path, addpath_id, attr, post_policy, withdraw));
Expand Down
2 changes: 1 addition & 1 deletion bgpd/bgp_updgrp_adv.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#include "bgpd/bgp_addpath.h"

DEFINE_HOOK(bgp_adj_out_updated,
(struct update_subgroup *subgrp, struct bgp_dest *dest,
(struct update_subgroup * subgrp, struct bgp_dest *dest,
struct bgp_path_info *path, uint32_t addpath_id, struct attr *attr,
bool post_policy, bool withdraw),
(subgrp, dest, path, addpath_id, attr, post_policy, withdraw));
Expand Down
2 changes: 1 addition & 1 deletion bgpd/bgpd.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ DEFINE_QOBJ_TYPE(bgp_master);
DEFINE_QOBJ_TYPE(bgp);
DEFINE_QOBJ_TYPE(peer);
DEFINE_HOOK(bgp_inst_delete, (struct bgp *bgp), (bgp));
DEFINE_HOOK(bgp_instance_state, (struct bgp *bgp), (bgp));
DEFINE_HOOK(bgp_instance_state, (struct bgp * bgp), (bgp));

/* BGP process wide configuration. */
static struct bgp_master bgp_master;
Expand Down
2 changes: 1 addition & 1 deletion bgpd/bgpd.h
Original file line number Diff line number Diff line change
Expand Up @@ -842,7 +842,7 @@ DECLARE_HOOK(bgp_inst_config_write,
(bgp, vty));
DECLARE_HOOK(bgp_snmp_traps_config_write, (struct vty *vty), (vty));
DECLARE_HOOK(bgp_config_end, (struct bgp *bgp), (bgp));
DECLARE_HOOK(bgp_instance_state, (struct bgp *bgp), (bgp));
DECLARE_HOOK(bgp_instance_state, (struct bgp * bgp), (bgp));
DECLARE_HOOK(bgp_hook_vrf_update, (struct vrf *vrf, bool enabled),
(vrf, enabled));

Expand Down

0 comments on commit 2cc99f2

Please sign in to comment.