Enable ECMP and Link detection by default

ECMP is not enabled on BSD, where it is not supported by BIRD.
This commit is contained in:
Ondrej Zajicek (work) 2017-12-08 15:59:44 +01:00
parent eb95b5ec1a
commit 517d05dff1
6 changed files with 11 additions and 2 deletions

View file

@ -309,6 +309,8 @@ int rt_feed_channel(struct channel *c);
void rt_feed_channel_abort(struct channel *c); void rt_feed_channel_abort(struct channel *c);
struct rtable_config *rt_new_table(struct symbol *s, uint addr_type); struct rtable_config *rt_new_table(struct symbol *s, uint addr_type);
/* Default limit for ECMP next hops, defined in sysdep code */
extern const int rt_default_ecmp;
struct rt_show_data_rtable { struct rt_show_data_rtable {
node n; node n;

View file

@ -58,6 +58,7 @@ bgp_proto_start: proto_start BGP {
BGP_CFG->gr_mode = BGP_GR_AWARE; BGP_CFG->gr_mode = BGP_GR_AWARE;
BGP_CFG->gr_time = 120; BGP_CFG->gr_time = 120;
BGP_CFG->setkey = 1; BGP_CFG->setkey = 1;
BGP_CFG->check_link = 1;
} }
; ;

View file

@ -219,6 +219,7 @@ ospf_proto_start: proto_start ospf_variant
init_list(&OSPF_CFG->area_list); init_list(&OSPF_CFG->area_list);
init_list(&OSPF_CFG->vlink_list); init_list(&OSPF_CFG->vlink_list);
OSPF_CFG->ecmp = rt_default_ecmp;
OSPF_CFG->tick = OSPF_DEFAULT_TICK; OSPF_CFG->tick = OSPF_DEFAULT_TICK;
OSPF_CFG->ospf2 = $2; OSPF_CFG->ospf2 = $2;
OSPF_CFG->af_ext = !$2; OSPF_CFG->af_ext = !$2;
@ -461,6 +462,7 @@ ospf_iface_start:
OSPF_PATT->deadc = DEADC_D; OSPF_PATT->deadc = DEADC_D;
OSPF_PATT->type = OSPF_IT_UNDEF; OSPF_PATT->type = OSPF_IT_UNDEF;
init_list(&OSPF_PATT->nbma_list); init_list(&OSPF_PATT->nbma_list);
OSPF_PATT->check_link = 1;
OSPF_PATT->ptp_netmask = 2; /* not specified */ OSPF_PATT->ptp_netmask = 2; /* not specified */
OSPF_PATT->tx_tos = IP_PREC_INTERNET_CONTROL; OSPF_PATT->tx_tos = IP_PREC_INTERNET_CONTROL;
OSPF_PATT->tx_priority = sk_priority_control; OSPF_PATT->tx_priority = sk_priority_control;

View file

@ -56,6 +56,7 @@ rip_proto_start: proto_start rip_variant
init_list(&RIP_CFG->patt_list); init_list(&RIP_CFG->patt_list);
RIP_CFG->rip2 = $2; RIP_CFG->rip2 = $2;
RIP_CFG->ecmp = rt_default_ecmp;
RIP_CFG->infinity = RIP_DEFAULT_INFINITY; RIP_CFG->infinity = RIP_DEFAULT_INFINITY;
RIP_CFG->min_timeout_time = 60 S_; RIP_CFG->min_timeout_time = 60 S_;
RIP_CFG->max_garbage_time = 60 S_; RIP_CFG->max_garbage_time = 60 S_;
@ -92,6 +93,7 @@ rip_iface_start:
RIP_IFACE->split_horizon = 1; RIP_IFACE->split_horizon = 1;
RIP_IFACE->poison_reverse = 1; RIP_IFACE->poison_reverse = 1;
RIP_IFACE->check_zero = 1; RIP_IFACE->check_zero = 1;
RIP_IFACE->check_link = 1;
RIP_IFACE->ttl_security = rip_cfg_is_v2() ? 0 : 1; RIP_IFACE->ttl_security = rip_cfg_is_v2() ? 0 : 1;
RIP_IFACE->rx_buffer = rip_cfg_is_v2() ? RIP_MAX_PKT_LENGTH : 0; RIP_IFACE->rx_buffer = rip_cfg_is_v2() ? RIP_MAX_PKT_LENGTH : 0;
RIP_IFACE->tx_length = rip_cfg_is_v2() ? RIP_MAX_PKT_LENGTH : 0; RIP_IFACE->tx_length = rip_cfg_is_v2() ? RIP_MAX_PKT_LENGTH : 0;

View file

@ -33,6 +33,7 @@
#include "lib/string.h" #include "lib/string.h"
#include "lib/socket.h" #include "lib/socket.h"
const int rt_default_ecmp = 0;
/* /*
* There are significant differences in multiple tables support between BSD variants. * There are significant differences in multiple tables support between BSD variants.
@ -145,9 +146,8 @@ krt_capable(rte *e)
{ {
rta *a = e->attrs; rta *a = e->attrs;
/* XXXX device routes are broken */
return return
((a->dest == RTD_UNICAST && ipa_nonzero(a->nh.gw) && !a->nh.next) /* No multipath support */ ((a->dest == RTD_UNICAST && !a->nh.next) /* No multipath support */
#ifdef RTF_REJECT #ifdef RTF_REJECT
|| a->dest == RTD_UNREACHABLE || a->dest == RTD_UNREACHABLE
#endif #endif

View file

@ -80,6 +80,8 @@ struct rtvia {
#define krt_ecmp6(p) ((p)->af == AF_INET6) #define krt_ecmp6(p) ((p)->af == AF_INET6)
const int rt_default_ecmp = 16;
/* /*
* Structure nl_parse_state keeps state of received route processing. Ideally, * Structure nl_parse_state keeps state of received route processing. Ideally,
* we could just independently parse received Netlink messages and immediately * we could just independently parse received Netlink messages and immediately