.description = "As part of normal collision detection for opening a connection to a peer, BGP has detected that the remote peer's router-id is the same as ours",
.suggestion = "Change one of the two router-id's",
},
+ {
+ .code = EC_BGP_INVALID_BGP_INSTANCE,
+ .title = "BGP instance for the specifc vrf is invalid",
+ .description = "Indicates that specified bgp instance is NULL",
+ .suggestion = "Get log files from router and open an issue",
+ },
+ {
+ .code = EC_BGP_INVALID_ROUTE,
+ .title = "BGP route node is invalid",
+ .description = "BGP route for the specified AFI/SAFI is NULL",
+ .suggestion = "Get log files from router and open an issue",
+ },
{
.code = END_FERR,
}
EC_BGP_INVALID_NEXTHOP_LENGTH,
EC_BGP_DOPPELGANGER_CONFIG,
EC_BGP_ROUTER_ID_SAME,
+ EC_BGP_INVALID_BGP_INSTANCE,
+ EC_BGP_INVALID_ROUTE,
};
extern void bgp_error_init(void);
vty_out(vty, " bgp router-id %s\n", yang_dnode_get_string(dnode, NULL));
}
+DEFPY (bgp_suppress_fib_pending,
+ bgp_suppress_fib_pending_cmd,
+ "[no] bgp suppress-fib-pending",
+ NO_STR
+ BGP_STR
+ "Advertise only routes that are programmed in kernel to peers\n")
+{
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
+
+ bgp_suppress_fib_pending_set(bgp, !no);
+ return CMD_SUCCESS;
+}
+
+
/* BGP Cluster ID. */
DEFUN_YANG(bgp_cluster_id,
bgp_cluster_id_cmd,
vty_out(vty, " bgp router-id %pI4\n",
&bgp->router_id_static);
+ /* Suppress fib pending */
+ if (CHECK_FLAG(bgp->flags, BGP_FLAG_SUPPRESS_FIB_PENDING))
+ vty_out(vty, " bgp suppress-fib-pending\n");
+
/* BGP log-neighbor-changes. */
if (!!CHECK_FLAG(bgp->flags, BGP_FLAG_LOG_NEIGHBOR_CHANGES)
!= SAVE_BGP_LOG_NEIGHBOR_CHANGES)
install_element(BGP_NODE, &bgp_router_id_cmd);
install_element(BGP_NODE, &no_bgp_router_id_cmd);
+ /* "bgp suppress-fib-pending" command */
+ install_element(BGP_NODE, &bgp_suppress_fib_pending_cmd);
+
/* "bgp cluster-id" commands. */
install_element(BGP_NODE, &bgp_cluster_id_cmd);
install_element(BGP_NODE, &no_bgp_cluster_id_cmd);
unsigned int multipath_num = MULTIPATH_NUM;
+/* Number of bgp instances configured for suppress fib config */
+unsigned int bgp_suppress_fib_count;
+
static void bgp_if_finish(struct bgp *bgp);
static void peer_drop_dynamic_neighbor(struct peer *peer);
true /* is config */);
}
+/* Set the suppress fib pending for the bgp configuration */
+void bgp_suppress_fib_pending_set(struct bgp *bgp, bool set)
+{
+ bool send_msg = false;
+
+ if (bgp->inst_type == BGP_INSTANCE_TYPE_VIEW)
+ return;
+
+ if (set) {
+ SET_FLAG(bgp->flags, BGP_FLAG_SUPPRESS_FIB_PENDING);
+ /* Send msg to zebra for the first instance of bgp enabled
+ * with suppress fib
+ */
+ if (bgp_suppress_fib_count == 0)
+ send_msg = true;
+ bgp_suppress_fib_count++;
+ } else {
+ UNSET_FLAG(bgp->flags, BGP_FLAG_SUPPRESS_FIB_PENDING);
+ bgp_suppress_fib_count--;
+
+ /* Send msg to zebra if there are no instances enabled
+ * with suppress fib
+ */
+ if (bgp_suppress_fib_count == 0)
+ send_msg = true;
+ }
+ /* Send route notify request to RIB */
+ if (send_msg) {
+ if (BGP_DEBUG(zebra, ZEBRA))
+ zlog_debug("Sending ZEBRA_ROUTE_NOTIFY_REQUEST");
+
+ if (zclient)
+ zebra_route_notify_send(ZEBRA_ROUTE_NOTIFY_REQUEST,
+ zclient, set);
+ }
+}
+
/* BGP's cluster-id control. */
int bgp_cluster_id_set(struct bgp *bgp, struct in_addr *cluster_id)
{
#define BGP_FLAG_DELETE_IN_PROGRESS (1 << 22)
#define BGP_FLAG_SELECT_DEFER_DISABLE (1 << 23)
#define BGP_FLAG_GR_DISABLE_EOR (1 << 24)
-#define BGP_FLAG_EBGP_REQUIRES_POLICY (1 << 25)
-#define BGP_FLAG_SHOW_NEXTHOP_HOSTNAME (1 << 26)
+#define BGP_FLAG_EBGP_REQUIRES_POLICY (1 << 25)
+#define BGP_FLAG_SHOW_NEXTHOP_HOSTNAME (1 << 26)
/* This flag is set if the instance is in administrative shutdown */
-#define BGP_FLAG_SHUTDOWN (1 << 27)
+#define BGP_FLAG_SHUTDOWN (1 << 27)
+#define BGP_FLAG_SUPPRESS_FIB_PENDING (1 << 28)
enum global_mode GLOBAL_GR_FSM[BGP_GLOBAL_GR_MODE]
[BGP_GLOBAL_GR_EVENT_CMD];
#define BGP_SELECT_DEFER_DISABLE(bgp) \
(CHECK_FLAG(bgp->flags, BGP_FLAG_SELECT_DEFER_DISABLE))
+#define BGP_SUPPRESS_FIB_ENABLED(bgp) \
+ (CHECK_FLAG(bgp->flags, BGP_FLAG_SUPPRESS_FIB_PENDING))
+
/* BGP peer-group support. */
struct peer_group {
/* Name of the peer-group. */
|| CHECK_FLAG((P)->sflags, PEER_STATUS_PREFIX_OVERFLOW) \
|| CHECK_FLAG((P)->bgp->flags, BGP_FLAG_SHUTDOWN))
+#define PEER_ROUTE_ADV_DELAY(peer) \
+ CHECK_FLAG(peer->thread_flags, PEER_THREAD_SUBGRP_ADV_DELAY)
+
#define PEER_PASSWORD_MINLEN (1)
#define PEER_PASSWORD_MAXLEN (80)
#define BGP_DEFAULT_STALEPATH_TIME 360
#define BGP_DEFAULT_SELECT_DEFERRAL_TIME 360
#define BGP_DEFAULT_RIB_STALE_TIME 500
+#define BGP_DEFAULT_UPDATE_ADVERTISEMENT_TIME 1
/* BGP uptime string length. */
#define BGP_UPTIME_LEN 25
extern void bgp_router_id_zebra_bump(vrf_id_t, const struct prefix *);
extern void bgp_router_id_static_set(struct bgp *, struct in_addr);
+extern void bgp_suppress_fib_pending_set(struct bgp *bgp, bool set);
extern int bgp_cluster_id_set(struct bgp *, struct in_addr *);
extern int bgp_cluster_id_unset(struct bgp *);