mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-14 12:25:02 +00:00
Merge branch 'cmaster' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into cmaster
This commit is contained in:
commit
3607212c76
@ -143,7 +143,6 @@ peer_xfer_conn(struct peer *from_peer)
|
||||
peer->as = from_peer->as;
|
||||
peer->v_holdtime = from_peer->v_holdtime;
|
||||
peer->v_keepalive = from_peer->v_keepalive;
|
||||
peer->v_asorig = from_peer->v_asorig;
|
||||
peer->routeadv = from_peer->routeadv;
|
||||
peer->v_routeadv = from_peer->v_routeadv;
|
||||
peer->v_gr_restart = from_peer->v_gr_restart;
|
||||
@ -236,7 +235,6 @@ bgp_timer_set (struct peer *peer)
|
||||
BGP_TIMER_OFF (peer->t_connect);
|
||||
BGP_TIMER_OFF (peer->t_holdtime);
|
||||
BGP_TIMER_OFF (peer->t_keepalive);
|
||||
BGP_TIMER_OFF (peer->t_asorig);
|
||||
BGP_TIMER_OFF (peer->t_routeadv);
|
||||
break;
|
||||
|
||||
@ -248,7 +246,6 @@ bgp_timer_set (struct peer *peer)
|
||||
BGP_TIMER_ON (peer->t_connect, bgp_connect_timer, peer->v_connect);
|
||||
BGP_TIMER_OFF (peer->t_holdtime);
|
||||
BGP_TIMER_OFF (peer->t_keepalive);
|
||||
BGP_TIMER_OFF (peer->t_asorig);
|
||||
BGP_TIMER_OFF (peer->t_routeadv);
|
||||
break;
|
||||
|
||||
@ -268,7 +265,6 @@ bgp_timer_set (struct peer *peer)
|
||||
}
|
||||
BGP_TIMER_OFF (peer->t_holdtime);
|
||||
BGP_TIMER_OFF (peer->t_keepalive);
|
||||
BGP_TIMER_OFF (peer->t_asorig);
|
||||
BGP_TIMER_OFF (peer->t_routeadv);
|
||||
break;
|
||||
|
||||
@ -286,7 +282,6 @@ bgp_timer_set (struct peer *peer)
|
||||
BGP_TIMER_OFF (peer->t_holdtime);
|
||||
}
|
||||
BGP_TIMER_OFF (peer->t_keepalive);
|
||||
BGP_TIMER_OFF (peer->t_asorig);
|
||||
BGP_TIMER_OFF (peer->t_routeadv);
|
||||
break;
|
||||
|
||||
@ -309,7 +304,6 @@ bgp_timer_set (struct peer *peer)
|
||||
BGP_TIMER_ON (peer->t_keepalive, bgp_keepalive_timer,
|
||||
peer->v_keepalive);
|
||||
}
|
||||
BGP_TIMER_OFF (peer->t_asorig);
|
||||
BGP_TIMER_OFF (peer->t_routeadv);
|
||||
break;
|
||||
|
||||
@ -333,7 +327,6 @@ bgp_timer_set (struct peer *peer)
|
||||
BGP_TIMER_ON (peer->t_keepalive, bgp_keepalive_timer,
|
||||
peer->v_keepalive);
|
||||
}
|
||||
BGP_TIMER_OFF (peer->t_asorig);
|
||||
break;
|
||||
case Deleted:
|
||||
BGP_TIMER_OFF (peer->t_gr_restart);
|
||||
@ -344,7 +337,6 @@ bgp_timer_set (struct peer *peer)
|
||||
BGP_TIMER_OFF (peer->t_connect);
|
||||
BGP_TIMER_OFF (peer->t_holdtime);
|
||||
BGP_TIMER_OFF (peer->t_keepalive);
|
||||
BGP_TIMER_OFF (peer->t_asorig);
|
||||
BGP_TIMER_OFF (peer->t_routeadv);
|
||||
break;
|
||||
}
|
||||
@ -1072,7 +1064,6 @@ bgp_stop (struct peer *peer)
|
||||
BGP_TIMER_OFF (peer->t_connect);
|
||||
BGP_TIMER_OFF (peer->t_holdtime);
|
||||
BGP_TIMER_OFF (peer->t_keepalive);
|
||||
BGP_TIMER_OFF (peer->t_asorig);
|
||||
BGP_TIMER_OFF (peer->t_routeadv);
|
||||
|
||||
/* Stream reset. */
|
||||
|
@ -175,14 +175,14 @@ bgp_find_or_add_nexthop (struct bgp *bgp, afi_t afi, struct bgp_info *ri,
|
||||
SET_FLAG(bnc->flags, BGP_STATIC_ROUTE);
|
||||
|
||||
/* If we're toggling the type, re-register */
|
||||
if ((bgp_flag_check(bgp, BGP_FLAG_IMPORT_CHECK_EXACT_MATCH)) &&
|
||||
if ((bgp_flag_check(bgp, BGP_FLAG_IMPORT_CHECK)) &&
|
||||
!CHECK_FLAG(bnc->flags, BGP_STATIC_ROUTE_EXACT_MATCH))
|
||||
{
|
||||
SET_FLAG(bnc->flags, BGP_STATIC_ROUTE_EXACT_MATCH);
|
||||
UNSET_FLAG(bnc->flags, BGP_NEXTHOP_REGISTERED);
|
||||
UNSET_FLAG(bnc->flags, BGP_NEXTHOP_VALID);
|
||||
}
|
||||
else if ((!bgp_flag_check(bgp, BGP_FLAG_IMPORT_CHECK_EXACT_MATCH)) &&
|
||||
else if ((!bgp_flag_check(bgp, BGP_FLAG_IMPORT_CHECK)) &&
|
||||
CHECK_FLAG(bnc->flags, BGP_STATIC_ROUTE_EXACT_MATCH))
|
||||
{
|
||||
UNSET_FLAG(bnc->flags, BGP_STATIC_ROUTE_EXACT_MATCH);
|
||||
|
@ -2199,9 +2199,12 @@ bgp_process_queue_init (void)
|
||||
/* Use a higher yield value of 50ms for main queue processing */
|
||||
bm->process_main_queue->spec.yield = 50 * 1000L;
|
||||
|
||||
memcpy (bm->process_rsclient_queue, bm->process_main_queue,
|
||||
sizeof (struct work_queue));
|
||||
bm->process_rsclient_queue->spec.workfunc = &bgp_process_rsclient;
|
||||
bm->process_rsclient_queue->spec.del_item_data = &bgp_processq_del;
|
||||
bm->process_rsclient_queue->spec.max_retries = 0;
|
||||
bm->process_rsclient_queue->spec.hold = 50;
|
||||
/* Use a higher yield value of 50ms for main queue processing */
|
||||
bm->process_rsclient_queue->spec.yield = 50 * 1000L;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -74,9 +74,8 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
#define BGPPEERKEEPALIVE 19
|
||||
#define BGPPEERHOLDTIMECONFIGURED 20
|
||||
#define BGPPEERKEEPALIVECONFIGURED 21
|
||||
#define BGPPEERMINASORIGINATIONINTERVAL 22
|
||||
#define BGPPEERMINROUTEADVERTISEMENTINTERVAL 23
|
||||
#define BGPPEERINUPDATEELAPSEDTIME 24
|
||||
#define BGPPEERMINROUTEADVERTISEMENTINTERVAL 22
|
||||
#define BGPPEERINUPDATEELAPSEDTIME 23
|
||||
|
||||
/* BGP MIB bgpIdentifier. */
|
||||
#define BGPIDENTIFIER 0
|
||||
@ -189,8 +188,6 @@ struct variable bgp_variables[] =
|
||||
3, {3, 1, 20}},
|
||||
{BGPPEERKEEPALIVECONFIGURED, INTEGER, RWRITE, bgpPeerTable,
|
||||
3, {3, 1, 21}},
|
||||
{BGPPEERMINASORIGINATIONINTERVAL, INTEGER, RWRITE, bgpPeerTable,
|
||||
3, {3, 1, 22}},
|
||||
{BGPPEERMINROUTEADVERTISEMENTINTERVAL, INTEGER, RWRITE, bgpPeerTable,
|
||||
3, {3, 1, 23}},
|
||||
{BGPPEERINUPDATEELAPSEDTIME, GAUGE32, RONLY, bgpPeerTable,
|
||||
@ -438,9 +435,6 @@ write_bgpPeerTable (int action, u_char *var_val,
|
||||
peer->keepalive = intval;
|
||||
peer->v_keepalive = intval;
|
||||
break;
|
||||
case BGPPEERMINASORIGINATIONINTERVAL:
|
||||
peer->v_asorig = intval;
|
||||
break;
|
||||
case BGPPEERMINROUTEADVERTISEMENTINTERVAL:
|
||||
peer->v_routeadv = intval;
|
||||
break;
|
||||
@ -569,10 +563,6 @@ bgpPeerTable (struct variable *v, oid name[], size_t *length,
|
||||
else
|
||||
return SNMP_INTEGER (peer->v_keepalive);
|
||||
break;
|
||||
case BGPPEERMINASORIGINATIONINTERVAL:
|
||||
*write_method = write_bgpPeerTable;
|
||||
return SNMP_INTEGER (peer->v_asorig);
|
||||
break;
|
||||
case BGPPEERMINROUTEADVERTISEMENTINTERVAL:
|
||||
*write_method = write_bgpPeerTable;
|
||||
return SNMP_INTEGER (peer->v_routeadv);
|
||||
|
@ -2153,45 +2153,26 @@ DEFUN (no_bgp_default_show_hostname,
|
||||
/* "bgp import-check" configuration. */
|
||||
DEFUN (bgp_network_import_check,
|
||||
bgp_network_import_check_cmd,
|
||||
"bgp network import-check {exact}",
|
||||
"bgp network import-check",
|
||||
"BGP specific commands\n"
|
||||
"BGP network command\n"
|
||||
"Check BGP network route exists in IGP\n"
|
||||
"Match route precisely")
|
||||
"Check BGP network route exists in IGP\n")
|
||||
{
|
||||
struct bgp *bgp;
|
||||
int trigger = 0;
|
||||
|
||||
bgp = vty->index;
|
||||
if (!bgp_flag_check(bgp, BGP_FLAG_IMPORT_CHECK))
|
||||
{
|
||||
bgp_flag_set (bgp, BGP_FLAG_IMPORT_CHECK);
|
||||
trigger = 1;
|
||||
}
|
||||
|
||||
if (argv[0] != NULL)
|
||||
{
|
||||
if (!bgp_flag_check(bgp, BGP_FLAG_IMPORT_CHECK_EXACT_MATCH))
|
||||
{
|
||||
bgp_flag_set (bgp, BGP_FLAG_IMPORT_CHECK_EXACT_MATCH);
|
||||
trigger = 1;
|
||||
}
|
||||
}
|
||||
else if (bgp_flag_check(bgp, BGP_FLAG_IMPORT_CHECK_EXACT_MATCH))
|
||||
{
|
||||
bgp_flag_unset (bgp, BGP_FLAG_IMPORT_CHECK_EXACT_MATCH);
|
||||
trigger = 1;
|
||||
}
|
||||
|
||||
if (trigger)
|
||||
bgp_static_redo_import_check(bgp);
|
||||
}
|
||||
|
||||
return CMD_SUCCESS;
|
||||
}
|
||||
|
||||
DEFUN (no_bgp_network_import_check,
|
||||
no_bgp_network_import_check_cmd,
|
||||
"no bgp network import-check {exact}",
|
||||
"no bgp network import-check",
|
||||
NO_STR
|
||||
"BGP specific commands\n"
|
||||
"BGP network command\n"
|
||||
@ -2203,9 +2184,9 @@ DEFUN (no_bgp_network_import_check,
|
||||
if (bgp_flag_check(bgp, BGP_FLAG_IMPORT_CHECK))
|
||||
{
|
||||
bgp_flag_unset (bgp, BGP_FLAG_IMPORT_CHECK);
|
||||
bgp_flag_unset (bgp, BGP_FLAG_IMPORT_CHECK_EXACT_MATCH);
|
||||
bgp_static_redo_import_check(bgp);
|
||||
}
|
||||
|
||||
return CMD_SUCCESS;
|
||||
}
|
||||
|
||||
@ -4836,7 +4817,7 @@ peer_timers_connect_unset_vty (struct vty *vty, const char *ip_str)
|
||||
|
||||
DEFUN (neighbor_timers_connect,
|
||||
neighbor_timers_connect_cmd,
|
||||
NEIGHBOR_CMD2 "timers connect <0-65535>",
|
||||
NEIGHBOR_CMD2 "timers connect <1-65535>",
|
||||
NEIGHBOR_STR
|
||||
NEIGHBOR_ADDR_STR2
|
||||
"BGP per neighbor timers\n"
|
||||
@ -4860,7 +4841,7 @@ DEFUN (no_neighbor_timers_connect,
|
||||
|
||||
ALIAS (no_neighbor_timers_connect,
|
||||
no_neighbor_timers_connect_val_cmd,
|
||||
NO_NEIGHBOR_CMD2 "timers connect <0-65535>",
|
||||
NO_NEIGHBOR_CMD2 "timers connect <1-65535>",
|
||||
NO_STR
|
||||
NEIGHBOR_STR
|
||||
NEIGHBOR_ADDR_STR2
|
||||
|
227
bgpd/bgpd.c
227
bgpd/bgpd.c
@ -822,7 +822,6 @@ peer_global_config_reset (struct peer *peer)
|
||||
|
||||
/* Reset some other configs back to defaults. */
|
||||
peer->v_start = BGP_INIT_START_TIMER;
|
||||
peer->v_asorig = BGP_DEFAULT_ASORIGINATE;
|
||||
peer->password = NULL;
|
||||
peer->local_id = peer->bgp->router_id;
|
||||
peer->v_holdtime = peer->bgp->default_holdtime;
|
||||
@ -1029,7 +1028,6 @@ peer_new (struct bgp *bgp)
|
||||
peer->fd = -1;
|
||||
peer->v_start = BGP_INIT_START_TIMER;
|
||||
peer->v_connect = BGP_DEFAULT_CONNECT_RETRY;
|
||||
peer->v_asorig = BGP_DEFAULT_ASORIGINATE;
|
||||
peer->status = Idle;
|
||||
peer->ostatus = Idle;
|
||||
peer->cur_event = peer->last_event = peer->last_major_event = 0;
|
||||
@ -1119,7 +1117,6 @@ peer_xfer_config (struct peer *peer_dst, struct peer *peer_src)
|
||||
peer_dst->connect = peer_src->connect;
|
||||
peer_dst->v_holdtime = peer_src->v_holdtime;
|
||||
peer_dst->v_keepalive = peer_src->v_keepalive;
|
||||
peer_dst->v_asorig = peer_src->v_asorig;
|
||||
peer_dst->routeadv = peer_src->routeadv;
|
||||
peer_dst->v_routeadv = peer_src->v_routeadv;
|
||||
|
||||
@ -2701,6 +2698,9 @@ bgp_create (as_t *as, const char *name)
|
||||
bgp->stalepath_time = BGP_DEFAULT_STALEPATH_TIME;
|
||||
bgp->dynamic_neighbors_limit = BGP_DYNAMIC_NEIGHBORS_LIMIT_DEFAULT;
|
||||
bgp->dynamic_neighbors_count = 0;
|
||||
bgp_flag_set (bgp, BGP_FLAG_IMPORT_CHECK);
|
||||
bgp_flag_set (bgp, BGP_FLAG_SHOW_HOSTNAME);
|
||||
bgp_flag_set (bgp, BGP_FLAG_LOG_NEIGHBOR_CHANGES);
|
||||
|
||||
bgp->as = *as;
|
||||
|
||||
@ -6115,8 +6115,8 @@ bgp_config_write_filter (struct vty *vty, struct peer *peer,
|
||||
|
||||
/* BGP peer configuration display function. */
|
||||
static void
|
||||
bgp_config_write_peer (struct vty *vty, struct bgp *bgp,
|
||||
struct peer *peer, afi_t afi, safi_t safi)
|
||||
bgp_config_write_peer_global (struct vty *vty, struct bgp *bgp,
|
||||
struct peer *peer)
|
||||
{
|
||||
struct peer *g_peer = NULL;
|
||||
char buf[SU_ADDRSTRLEN];
|
||||
@ -6137,8 +6137,6 @@ bgp_config_write_peer (struct vty *vty, struct bgp *bgp,
|
||||
/************************************
|
||||
****** Global to the neighbor ******
|
||||
************************************/
|
||||
if (afi == AFI_IP && safi == SAFI_UNICAST)
|
||||
{
|
||||
if (peer->conf_if)
|
||||
{
|
||||
if (CHECK_FLAG(peer->flags, PEER_FLAG_IFPEER_V6ONLY))
|
||||
@ -6147,12 +6145,15 @@ bgp_config_write_peer (struct vty *vty, struct bgp *bgp,
|
||||
vty_out (vty, " neighbor %s interface%s", addr, VTY_NEWLINE);
|
||||
}
|
||||
|
||||
/* remote-as. */
|
||||
/* remote-as */
|
||||
if (! peer_group_active (peer))
|
||||
{
|
||||
if (CHECK_FLAG (peer->sflags, PEER_STATUS_GROUP))
|
||||
{
|
||||
vty_out (vty, " neighbor %s peer-group%s", addr,
|
||||
VTY_NEWLINE);
|
||||
}
|
||||
|
||||
if (peer->as_type == AS_SPECIFIED)
|
||||
{
|
||||
vty_out (vty, " neighbor %s remote-as %u%s", addr, peer->as,
|
||||
@ -6186,188 +6187,268 @@ bgp_config_write_peer (struct vty *vty, struct bgp *bgp,
|
||||
}
|
||||
}
|
||||
if (peer->af_group[AFI_IP][SAFI_UNICAST])
|
||||
{
|
||||
vty_out (vty, " neighbor %s peer-group %s%s", addr,
|
||||
peer->group->name, VTY_NEWLINE);
|
||||
}
|
||||
}
|
||||
|
||||
/* local-as. */
|
||||
/* local-as */
|
||||
if (peer->change_local_as)
|
||||
{
|
||||
if (! peer_group_active (peer))
|
||||
{
|
||||
vty_out (vty, " neighbor %s local-as %u%s%s%s", addr,
|
||||
peer->change_local_as,
|
||||
CHECK_FLAG (peer->flags, PEER_FLAG_LOCAL_AS_NO_PREPEND) ?
|
||||
" no-prepend" : "",
|
||||
CHECK_FLAG (peer->flags, PEER_FLAG_LOCAL_AS_REPLACE_AS) ?
|
||||
" replace-as" : "", VTY_NEWLINE);
|
||||
}
|
||||
}
|
||||
|
||||
/* Description. */
|
||||
/* description */
|
||||
if (peer->desc)
|
||||
{
|
||||
vty_out (vty, " neighbor %s description %s%s", addr, peer->desc,
|
||||
VTY_NEWLINE);
|
||||
}
|
||||
|
||||
/* Shutdown. */
|
||||
/* shutdown */
|
||||
if (CHECK_FLAG (peer->flags, PEER_FLAG_SHUTDOWN))
|
||||
{
|
||||
if (! peer_group_active (peer) ||
|
||||
! CHECK_FLAG (g_peer->flags, PEER_FLAG_SHUTDOWN))
|
||||
{
|
||||
vty_out (vty, " neighbor %s shutdown%s", addr, VTY_NEWLINE);
|
||||
}
|
||||
}
|
||||
|
||||
/* bfd. */
|
||||
/* bfd */
|
||||
if (peer->bfd_info)
|
||||
{
|
||||
if (! peer_group_active (peer) || ! g_peer->bfd_info)
|
||||
{
|
||||
bgp_bfd_peer_config_write(vty, peer, addr);
|
||||
}
|
||||
}
|
||||
|
||||
/* Password. */
|
||||
/* password */
|
||||
if (peer->password)
|
||||
{
|
||||
if (!peer_group_active (peer)
|
||||
|| ! g_peer->password
|
||||
|| strcmp (peer->password, g_peer->password) != 0)
|
||||
{
|
||||
vty_out (vty, " neighbor %s password %s%s", addr, peer->password,
|
||||
VTY_NEWLINE);
|
||||
}
|
||||
}
|
||||
|
||||
/* neighbor solo */
|
||||
if (CHECK_FLAG(peer->flags, PEER_FLAG_LONESOUL))
|
||||
{
|
||||
if (!peer_group_active (peer))
|
||||
{
|
||||
vty_out (vty, " neighbor %s solo%s", addr, VTY_NEWLINE);
|
||||
}
|
||||
}
|
||||
|
||||
/* BGP port. */
|
||||
/* BGP port */
|
||||
if (peer->port != BGP_PORT_DEFAULT)
|
||||
{
|
||||
vty_out (vty, " neighbor %s port %d%s", addr, peer->port,
|
||||
VTY_NEWLINE);
|
||||
}
|
||||
|
||||
/* Local interface name. */
|
||||
/* Local interface name */
|
||||
if (peer->ifname)
|
||||
{
|
||||
vty_out (vty, " neighbor %s interface %s%s", addr, peer->ifname,
|
||||
VTY_NEWLINE);
|
||||
}
|
||||
|
||||
/* Passive. */
|
||||
/* passive */
|
||||
if (CHECK_FLAG (peer->flags, PEER_FLAG_PASSIVE))
|
||||
{
|
||||
if (! peer_group_active (peer) ||
|
||||
! CHECK_FLAG (g_peer->flags, PEER_FLAG_PASSIVE))
|
||||
{
|
||||
vty_out (vty, " neighbor %s passive%s", addr, VTY_NEWLINE);
|
||||
}
|
||||
}
|
||||
|
||||
/* EBGP multihop. */
|
||||
/* ebgp-multihop */
|
||||
if (peer->sort != BGP_PEER_IBGP && peer->ttl != 1 &&
|
||||
!(peer->gtsm_hops != 0 && peer->ttl == MAXTTL))
|
||||
if (! peer_group_active (peer) ||
|
||||
g_peer->ttl != peer->ttl)
|
||||
{
|
||||
if (! peer_group_active (peer) || g_peer->ttl != peer->ttl)
|
||||
{
|
||||
vty_out (vty, " neighbor %s ebgp-multihop %d%s", addr, peer->ttl,
|
||||
VTY_NEWLINE);
|
||||
}
|
||||
}
|
||||
|
||||
/* ttl-security hops */
|
||||
if (peer->gtsm_hops != 0)
|
||||
{
|
||||
if (! peer_group_active (peer) || g_peer->gtsm_hops != peer->gtsm_hops)
|
||||
{
|
||||
vty_out (vty, " neighbor %s ttl-security hops %d%s", addr,
|
||||
peer->gtsm_hops, VTY_NEWLINE);
|
||||
}
|
||||
}
|
||||
|
||||
/* disable-connected-check. */
|
||||
/* disable-connected-check */
|
||||
if (CHECK_FLAG (peer->flags, PEER_FLAG_DISABLE_CONNECTED_CHECK))
|
||||
{
|
||||
if (! peer_group_active (peer) ||
|
||||
! CHECK_FLAG (g_peer->flags, PEER_FLAG_DISABLE_CONNECTED_CHECK))
|
||||
{
|
||||
vty_out (vty, " neighbor %s disable-connected-check%s", addr, VTY_NEWLINE);
|
||||
}
|
||||
}
|
||||
|
||||
/* Update-source. */
|
||||
/* update-source */
|
||||
if (peer->update_if)
|
||||
{
|
||||
if (! peer_group_active (peer) || ! g_peer->update_if
|
||||
|| strcmp (g_peer->update_if, peer->update_if) != 0)
|
||||
{
|
||||
vty_out (vty, " neighbor %s update-source %s%s", addr,
|
||||
peer->update_if, VTY_NEWLINE);
|
||||
}
|
||||
}
|
||||
if (peer->update_source)
|
||||
{
|
||||
if (! peer_group_active (peer) || ! g_peer->update_source
|
||||
|| sockunion_cmp (g_peer->update_source,
|
||||
peer->update_source) != 0)
|
||||
{
|
||||
vty_out (vty, " neighbor %s update-source %s%s", addr,
|
||||
sockunion2str (peer->update_source, buf, SU_ADDRSTRLEN),
|
||||
VTY_NEWLINE);
|
||||
}
|
||||
}
|
||||
|
||||
/* advertisement-interval */
|
||||
if (CHECK_FLAG (peer->config, PEER_CONFIG_ROUTEADV) &&
|
||||
! peer_group_active (peer))
|
||||
{
|
||||
vty_out (vty, " neighbor %s advertisement-interval %d%s",
|
||||
addr, peer->v_routeadv, VTY_NEWLINE);
|
||||
}
|
||||
|
||||
/* timers. */
|
||||
/* timers */
|
||||
if (CHECK_FLAG (peer->config, PEER_CONFIG_TIMER)
|
||||
&& ! peer_group_active (peer))
|
||||
{
|
||||
vty_out (vty, " neighbor %s timers %d %d%s", addr,
|
||||
peer->keepalive, peer->holdtime, VTY_NEWLINE);
|
||||
}
|
||||
|
||||
if (CHECK_FLAG (peer->config, PEER_CONFIG_CONNECT) &&
|
||||
! peer_group_active (peer))
|
||||
{
|
||||
vty_out (vty, " neighbor %s timers connect %d%s", addr,
|
||||
peer->connect, VTY_NEWLINE);
|
||||
}
|
||||
|
||||
/* Default weight. */
|
||||
/* weight */
|
||||
if (CHECK_FLAG (peer->config, PEER_CONFIG_WEIGHT))
|
||||
if (! peer_group_active (peer) ||
|
||||
g_peer->weight != peer->weight)
|
||||
{
|
||||
if (! peer_group_active (peer) || g_peer->weight != peer->weight)
|
||||
{
|
||||
vty_out (vty, " neighbor %s weight %d%s", addr, peer->weight,
|
||||
VTY_NEWLINE);
|
||||
}
|
||||
}
|
||||
|
||||
/* Dynamic capability. */
|
||||
/* capability dynamic */
|
||||
if (CHECK_FLAG (peer->flags, PEER_FLAG_DYNAMIC_CAPABILITY))
|
||||
{
|
||||
if (! peer_group_active (peer) ||
|
||||
! CHECK_FLAG (g_peer->flags, PEER_FLAG_DYNAMIC_CAPABILITY))
|
||||
{
|
||||
vty_out (vty, " neighbor %s capability dynamic%s", addr,
|
||||
VTY_NEWLINE);
|
||||
}
|
||||
}
|
||||
|
||||
/* Extended next-hop capability. */
|
||||
/* capability extended-nexthop */
|
||||
if (CHECK_FLAG (peer->flags, PEER_FLAG_CAPABILITY_ENHE))
|
||||
{
|
||||
if (! peer_group_active (peer) ||
|
||||
! CHECK_FLAG (g_peer->flags, PEER_FLAG_CAPABILITY_ENHE))
|
||||
{
|
||||
vty_out (vty, " neighbor %s capability extended-nexthop%s", addr,
|
||||
VTY_NEWLINE);
|
||||
}
|
||||
}
|
||||
|
||||
/* dont capability negotiation. */
|
||||
/* dont-capability-negotiation */
|
||||
if (CHECK_FLAG (peer->flags, PEER_FLAG_DONT_CAPABILITY))
|
||||
{
|
||||
if (! peer_group_active (peer) ||
|
||||
! CHECK_FLAG (g_peer->flags, PEER_FLAG_DONT_CAPABILITY))
|
||||
{
|
||||
vty_out (vty, " neighbor %s dont-capability-negotiate%s", addr,
|
||||
VTY_NEWLINE);
|
||||
}
|
||||
}
|
||||
|
||||
/* override capability negotiation. */
|
||||
/* override-capability */
|
||||
if (CHECK_FLAG (peer->flags, PEER_FLAG_OVERRIDE_CAPABILITY))
|
||||
{
|
||||
if (! peer_group_active (peer) ||
|
||||
! CHECK_FLAG (g_peer->flags, PEER_FLAG_OVERRIDE_CAPABILITY))
|
||||
{
|
||||
vty_out (vty, " neighbor %s override-capability%s", addr,
|
||||
VTY_NEWLINE);
|
||||
}
|
||||
}
|
||||
|
||||
/* strict capability negotiation. */
|
||||
/* strict-capability-match */
|
||||
if (CHECK_FLAG (peer->flags, PEER_FLAG_STRICT_CAP_MATCH))
|
||||
{
|
||||
if (! peer_group_active (peer) ||
|
||||
! CHECK_FLAG (g_peer->flags, PEER_FLAG_STRICT_CAP_MATCH))
|
||||
{
|
||||
vty_out (vty, " neighbor %s strict-capability-match%s", addr,
|
||||
VTY_NEWLINE);
|
||||
|
||||
if (! peer->af_group[AFI_IP][SAFI_UNICAST])
|
||||
{
|
||||
if (bgp_flag_check (bgp, BGP_FLAG_NO_DEFAULT_IPV4))
|
||||
{
|
||||
if (peer->afc[AFI_IP][SAFI_UNICAST])
|
||||
vty_out (vty, " neighbor %s activate%s", addr, VTY_NEWLINE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* BGP peer configuration display function. */
|
||||
static void
|
||||
bgp_config_write_peer_af (struct vty *vty, struct bgp *bgp,
|
||||
struct peer *peer, afi_t afi, safi_t safi)
|
||||
{
|
||||
struct peer *g_peer = NULL;
|
||||
char *addr;
|
||||
|
||||
/* Skip dynamic neighbors. */
|
||||
if (peer_dynamic_neighbor (peer))
|
||||
return;
|
||||
|
||||
if (peer->conf_if)
|
||||
addr = peer->conf_if;
|
||||
else
|
||||
{
|
||||
if (! peer->afc[AFI_IP][SAFI_UNICAST])
|
||||
vty_out (vty, " no neighbor %s activate%s", addr, VTY_NEWLINE);
|
||||
}
|
||||
}
|
||||
}
|
||||
addr = peer->host;
|
||||
|
||||
if (peer_group_active (peer))
|
||||
g_peer = peer->group->conf;
|
||||
|
||||
/************************************
|
||||
****** Per AF to the neighbor ******
|
||||
************************************/
|
||||
|
||||
if (! (afi == AFI_IP && safi == SAFI_UNICAST))
|
||||
{
|
||||
if (peer->af_group[afi][safi])
|
||||
vty_out (vty, " neighbor %s peer-group %s%s", addr,
|
||||
peer->group->name, VTY_NEWLINE);
|
||||
else
|
||||
vty_out (vty, " neighbor %s activate%s", addr, VTY_NEWLINE);
|
||||
}
|
||||
|
||||
/* ORF capability. */
|
||||
if (CHECK_FLAG (peer->af_flags[afi][safi], PEER_FLAG_ORF_PREFIX_SM)
|
||||
@ -6542,24 +6623,23 @@ bgp_config_write_family_header (struct vty *vty, afi_t afi, safi_t safi,
|
||||
if (*write)
|
||||
return;
|
||||
|
||||
if (afi == AFI_IP && safi == SAFI_UNICAST)
|
||||
return;
|
||||
|
||||
vty_out (vty, "!%s address-family ", VTY_NEWLINE);
|
||||
vty_out (vty, " address-family ");
|
||||
|
||||
if (afi == AFI_IP)
|
||||
{
|
||||
if (safi == SAFI_MULTICAST)
|
||||
if (safi == SAFI_UNICAST)
|
||||
vty_out (vty, "ipv4 unicast");
|
||||
else if (safi == SAFI_MULTICAST)
|
||||
vty_out (vty, "ipv4 multicast");
|
||||
else if (safi == SAFI_MPLS_VPN)
|
||||
vty_out (vty, "vpnv4 unicast");
|
||||
}
|
||||
else if (afi == AFI_IP6)
|
||||
{
|
||||
vty_out (vty, "ipv6");
|
||||
|
||||
if (safi == SAFI_MULTICAST)
|
||||
vty_out (vty, " multicast");
|
||||
if (safi == SAFI_UNICAST)
|
||||
vty_out (vty, "ipv6 unicast");
|
||||
else if (safi == SAFI_MULTICAST)
|
||||
vty_out (vty, "ipv6 multicast");
|
||||
}
|
||||
|
||||
vty_out (vty, "%s", VTY_NEWLINE);
|
||||
@ -6586,7 +6666,7 @@ bgp_config_write_family (struct vty *vty, struct bgp *bgp, afi_t afi,
|
||||
if (group->conf->afc[afi][safi])
|
||||
{
|
||||
bgp_config_write_family_header (vty, afi, safi, &write);
|
||||
bgp_config_write_peer (vty, bgp, group->conf, afi, safi);
|
||||
bgp_config_write_peer_af (vty, bgp, group->conf, afi, safi);
|
||||
}
|
||||
}
|
||||
for (ALL_LIST_ELEMENTS (bgp->peer, node, nnode, peer))
|
||||
@ -6600,7 +6680,7 @@ bgp_config_write_family (struct vty *vty, struct bgp *bgp, afi_t afi,
|
||||
if (CHECK_FLAG (peer->flags, PEER_FLAG_CONFIG_NODE))
|
||||
{
|
||||
bgp_config_write_family_header (vty, afi, safi, &write);
|
||||
bgp_config_write_peer (vty, bgp, peer, afi, safi);
|
||||
bgp_config_write_peer_af (vty, bgp, peer, afi, safi);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -6668,8 +6748,8 @@ bgp_config_write (struct vty *vty)
|
||||
VTY_NEWLINE);
|
||||
|
||||
/* BGP log-neighbor-changes. */
|
||||
if (bgp_flag_check (bgp, BGP_FLAG_LOG_NEIGHBOR_CHANGES))
|
||||
vty_out (vty, " bgp log-neighbor-changes%s", VTY_NEWLINE);
|
||||
if (!bgp_flag_check (bgp, BGP_FLAG_LOG_NEIGHBOR_CHANGES))
|
||||
vty_out (vty, " no bgp log-neighbor-changes%s", VTY_NEWLINE);
|
||||
|
||||
/* BGP configuration. */
|
||||
if (bgp_flag_check (bgp, BGP_FLAG_ALWAYS_COMPARE_MED))
|
||||
@ -6685,8 +6765,8 @@ bgp_config_write (struct vty *vty)
|
||||
bgp->default_local_pref, VTY_NEWLINE);
|
||||
|
||||
/* BGP default show-hostname */
|
||||
if (bgp_flag_check(bgp, BGP_FLAG_SHOW_HOSTNAME))
|
||||
vty_out (vty, " bgp default show-hostname%s", VTY_NEWLINE);
|
||||
if (!bgp_flag_check(bgp, BGP_FLAG_SHOW_HOSTNAME))
|
||||
vty_out (vty, " no bgp default show-hostname%s", VTY_NEWLINE);
|
||||
|
||||
/* BGP default subgroup-pkt-queue-max. */
|
||||
if (bgp->default_subgroup_pkt_queue_max != BGP_DEFAULT_SUBGROUP_PKT_QUEUE_MAX)
|
||||
@ -6795,22 +6875,14 @@ bgp_config_write (struct vty *vty)
|
||||
}
|
||||
|
||||
/* BGP network import check. */
|
||||
if (bgp_flag_check (bgp, BGP_FLAG_IMPORT_CHECK_EXACT_MATCH))
|
||||
vty_out (vty, " bgp network import-check exact%s", VTY_NEWLINE);
|
||||
else if (bgp_flag_check (bgp, BGP_FLAG_IMPORT_CHECK))
|
||||
vty_out (vty, " bgp network import-check%s", VTY_NEWLINE);
|
||||
if (!bgp_flag_check (bgp, BGP_FLAG_IMPORT_CHECK))
|
||||
vty_out (vty, " no bgp network import-check%s", VTY_NEWLINE);
|
||||
|
||||
/* BGP flag dampening. */
|
||||
if (CHECK_FLAG (bgp->af_flags[AFI_IP][SAFI_UNICAST],
|
||||
BGP_CONFIG_DAMPENING))
|
||||
bgp_config_write_damp (vty);
|
||||
|
||||
/* BGP static route configuration. */
|
||||
bgp_config_write_network (vty, bgp, AFI_IP, SAFI_UNICAST, &write);
|
||||
|
||||
/* BGP redistribute configuration. */
|
||||
bgp_config_write_redistribute (vty, bgp, AFI_IP, SAFI_UNICAST, &write);
|
||||
|
||||
/* BGP timers configuration. */
|
||||
if (bgp->default_keepalive != BGP_DEFAULT_KEEPALIVE
|
||||
&& bgp->default_holdtime != BGP_DEFAULT_HOLDTIME)
|
||||
@ -6824,20 +6896,16 @@ bgp_config_write (struct vty *vty)
|
||||
/* peer-group */
|
||||
for (ALL_LIST_ELEMENTS (bgp->group, node, nnode, group))
|
||||
{
|
||||
bgp_config_write_peer (vty, bgp, group->conf, AFI_IP, SAFI_UNICAST);
|
||||
bgp_config_write_peer_global (vty, bgp, group->conf);
|
||||
}
|
||||
|
||||
/* Normal neighbor configuration. */
|
||||
for (ALL_LIST_ELEMENTS (bgp->peer, node, nnode, peer))
|
||||
{
|
||||
if (CHECK_FLAG (peer->flags, PEER_FLAG_CONFIG_NODE))
|
||||
bgp_config_write_peer (vty, bgp, peer, AFI_IP, SAFI_UNICAST);
|
||||
bgp_config_write_peer_global (vty, bgp, peer);
|
||||
}
|
||||
|
||||
/* maximum-paths */
|
||||
bgp_config_write_maxpaths (vty, bgp, AFI_IP, SAFI_UNICAST, &write);
|
||||
bgp_config_write_table_map (vty, bgp, AFI_IP, SAFI_UNICAST, &write);
|
||||
|
||||
/* Distance configuration. */
|
||||
bgp_config_write_distance (vty, bgp);
|
||||
|
||||
@ -6848,6 +6916,9 @@ bgp_config_write (struct vty *vty)
|
||||
if (bgp_option_check (BGP_OPT_CONFIG_CISCO))
|
||||
vty_out (vty, " no auto-summary%s", VTY_NEWLINE);
|
||||
|
||||
/* IPv4 unicast configuration. */
|
||||
write += bgp_config_write_family (vty, bgp, AFI_IP, SAFI_UNICAST);
|
||||
|
||||
/* IPv4 multicast configuration. */
|
||||
write += bgp_config_write_family (vty, bgp, AFI_IP, SAFI_MULTICAST);
|
||||
|
||||
|
17
bgpd/bgpd.h
17
bgpd/bgpd.h
@ -255,8 +255,7 @@ struct bgp
|
||||
#define BGP_FLAG_DISABLE_NH_CONNECTED_CHK (1 << 16)
|
||||
#define BGP_FLAG_MULTIPATH_RELAX_NO_AS_SET (1 << 17)
|
||||
#define BGP_FLAG_FORCE_STATIC_PROCESS (1 << 18)
|
||||
#define BGP_FLAG_IMPORT_CHECK_EXACT_MATCH (1 << 19)
|
||||
#define BGP_FLAG_SHOW_HOSTNAME (1 << 20)
|
||||
#define BGP_FLAG_SHOW_HOSTNAME (1 << 19)
|
||||
|
||||
/* BGP Per AF flags */
|
||||
u_int16_t af_flags[AFI_MAX][SAFI_MAX];
|
||||
@ -695,7 +694,6 @@ struct peer
|
||||
u_int32_t v_connect;
|
||||
u_int32_t v_holdtime;
|
||||
u_int32_t v_keepalive;
|
||||
u_int32_t v_asorig;
|
||||
u_int32_t v_routeadv;
|
||||
u_int32_t v_pmax_restart;
|
||||
u_int32_t v_gr_restart;
|
||||
@ -707,7 +705,6 @@ struct peer
|
||||
struct thread *t_connect;
|
||||
struct thread *t_holdtime;
|
||||
struct thread *t_keepalive;
|
||||
struct thread *t_asorig;
|
||||
struct thread *t_routeadv;
|
||||
struct thread *t_pmax_restart;
|
||||
struct thread *t_gr_restart;
|
||||
@ -996,13 +993,11 @@ struct bgp_nlri
|
||||
|
||||
/* BGP timers default value. */
|
||||
#define BGP_INIT_START_TIMER 1
|
||||
#define BGP_ERROR_START_TIMER 30
|
||||
#define BGP_DEFAULT_HOLDTIME 180
|
||||
#define BGP_DEFAULT_KEEPALIVE 60
|
||||
#define BGP_DEFAULT_ASORIGINATE 15
|
||||
#define BGP_DEFAULT_EBGP_ROUTEADV 30
|
||||
#define BGP_DEFAULT_IBGP_ROUTEADV 5
|
||||
#define BGP_DEFAULT_CONNECT_RETRY 120
|
||||
#define BGP_DEFAULT_HOLDTIME 9
|
||||
#define BGP_DEFAULT_KEEPALIVE 3
|
||||
#define BGP_DEFAULT_EBGP_ROUTEADV 0
|
||||
#define BGP_DEFAULT_IBGP_ROUTEADV 0
|
||||
#define BGP_DEFAULT_CONNECT_RETRY 10
|
||||
|
||||
/* BGP default local preference. */
|
||||
#define BGP_DEFAULT_LOCAL_PREF 100
|
||||
|
@ -88,9 +88,9 @@
|
||||
#define OSPF_AREA_TYPE_MAX 3
|
||||
|
||||
/* SPF Throttling timer values. */
|
||||
#define OSPF_SPF_DELAY_DEFAULT 200
|
||||
#define OSPF_SPF_HOLDTIME_DEFAULT 1000
|
||||
#define OSPF_SPF_MAX_HOLDTIME_DEFAULT 10000
|
||||
#define OSPF_SPF_DELAY_DEFAULT 0
|
||||
#define OSPF_SPF_HOLDTIME_DEFAULT 50
|
||||
#define OSPF_SPF_MAX_HOLDTIME_DEFAULT 5000
|
||||
|
||||
#define OSPF_LSA_MAXAGE_CHECK_INTERVAL 30
|
||||
#define OSPF_LSA_MAXAGE_REMOVE_DELAY_DEFAULT 60
|
||||
|
@ -292,7 +292,6 @@ end
|
||||
elif "address-family " in line:
|
||||
main_ctx_key = []
|
||||
|
||||
if line != "address-family ipv4 unicast":
|
||||
# Save old context first
|
||||
self.save_contexts(ctx_keys, current_context_lines)
|
||||
current_context_lines = []
|
||||
@ -301,6 +300,8 @@ end
|
||||
|
||||
if line == "address-family ipv6":
|
||||
ctx_keys.append("address-family ipv6 unicast")
|
||||
elif line == "address-family ipv4":
|
||||
ctx_keys.append("address-family ipv4 unicast")
|
||||
else:
|
||||
ctx_keys.append(line)
|
||||
|
||||
|
@ -175,6 +175,8 @@ vtysh_config_parse_line (const char *line)
|
||||
|
||||
switch (c)
|
||||
{
|
||||
/* Suppress exclamation points ! and commented lines. The !s are generated
|
||||
* dynamically in vtysh_config_dump() */
|
||||
case '!':
|
||||
case '#':
|
||||
break;
|
||||
@ -188,8 +190,11 @@ vtysh_config_parse_line (const char *line)
|
||||
else if (strncmp (line, " address-family ipv4 multicast",
|
||||
strlen (" address-family ipv4 multicast")) == 0)
|
||||
config = config_get (BGP_IPV4M_NODE, line);
|
||||
else if (strncmp (line, " address-family ipv6",
|
||||
strlen (" address-family ipv6")) == 0)
|
||||
else if (strncmp (line, " address-family ipv4", strlen (" address-family ipv4")) == 0 ||
|
||||
strncmp (line, " address-family ipv4 unicast", strlen (" address-family ipv4 unicast")) == 0)
|
||||
config = config_get (BGP_IPV4_NODE, line);
|
||||
else if (strncmp (line, " address-family ipv6", strlen (" address-family ipv6")) == 0 ||
|
||||
strncmp (line, " address-family ipv6 unicast", strlen (" address-family ipv6 unicast")) == 0)
|
||||
config = config_get (BGP_IPV6_NODE, line);
|
||||
else if (config->index == RMAP_NODE ||
|
||||
config->index == INTERFACE_NODE ||
|
||||
|
@ -1500,6 +1500,13 @@ _netlink_route_build_singlepath(
|
||||
addattr_l (nlmsg, req_size, RTA_GATEWAY, &ipv4_ll, 4);
|
||||
addattr32 (nlmsg, req_size, RTA_OIF, nexthop->ifindex);
|
||||
|
||||
if (nexthop->rmap_src.ipv4.s_addr && (cmd == RTM_NEWROUTE))
|
||||
addattr_l (nlmsg, req_size, RTA_PREFSRC,
|
||||
&nexthop->rmap_src.ipv4, bytelen);
|
||||
else if (nexthop->src.ipv4.s_addr && (cmd == RTM_NEWROUTE))
|
||||
addattr_l (nlmsg, req_size, RTA_PREFSRC,
|
||||
&nexthop->src.ipv4, bytelen);
|
||||
|
||||
if (IS_ZEBRA_DEBUG_KERNEL)
|
||||
zlog_debug(" 5549: _netlink_route_build_singlepath() (%s): "
|
||||
"nexthop via %s if %u",
|
||||
@ -1648,6 +1655,11 @@ _netlink_route_build_multipath(
|
||||
rtnh->rtnh_len += sizeof (struct rtattr) + bytelen;
|
||||
rtnh->rtnh_ifindex = nexthop->ifindex;
|
||||
|
||||
if (nexthop->rmap_src.ipv4.s_addr)
|
||||
*src = &nexthop->rmap_src;
|
||||
else if (nexthop->src.ipv4.s_addr)
|
||||
*src = &nexthop->src;
|
||||
|
||||
if (IS_ZEBRA_DEBUG_KERNEL)
|
||||
zlog_debug(" 5549: netlink_route_build_multipath() (%s): "
|
||||
"nexthop via %s if %u",
|
||||
|
@ -1268,6 +1268,8 @@ nexthop_active_check (struct route_node *rn, struct rib *rib,
|
||||
UNSET_FLAG (nexthop->flags, NEXTHOP_FLAG_ACTIVE);
|
||||
break;
|
||||
case NEXTHOP_TYPE_IPV6_IFINDEX:
|
||||
/* RFC 5549, v4 prefix with v6 NH */
|
||||
if (rn->p.family != AF_INET)
|
||||
family = AFI_IP6;
|
||||
if (IN6_IS_ADDR_LINKLOCAL (&nexthop->gate.ipv6))
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user