diff options
author | Maria Matejka <mq@ucw.cz> | 2023-09-27 12:51:55 +0200 |
---|---|---|
committer | Maria Matejka <mq@ucw.cz> | 2023-09-27 20:18:46 +0200 |
commit | 8ad9c4bb339172d445d1346876b2c9f3c27199c1 (patch) | |
tree | 680654b1b25895b89ec685496bebeb44cbe2f703 /proto | |
parent | a4adb09f5a5c3806488fb121eafc0e6c969135e7 (diff) |
BGP config: Splitting Route Refresh and Enhanced Route Refresh
Both toggles are on by default but if some implementation needs one or
another to be switched off separately, then it's possible now.
Diffstat (limited to 'proto')
-rw-r--r-- | proto/bgp/bgp.h | 1 | ||||
-rw-r--r-- | proto/bgp/config.Y | 4 | ||||
-rw-r--r-- | proto/bgp/packets.c | 2 |
3 files changed, 5 insertions, 2 deletions
diff --git a/proto/bgp/bgp.h b/proto/bgp/bgp.h index c11433ec..1ba3de5e 100644 --- a/proto/bgp/bgp.h +++ b/proto/bgp/bgp.h @@ -96,6 +96,7 @@ struct bgp_config { u32 default_med; /* Default value for MULTI_EXIT_DISC attribute */ int capabilities; /* Enable capability handshake [RFC 5492] */ int enable_refresh; /* Enable local support for route refresh [RFC 2918] */ + int enable_enhanced_refresh; /* Enable local support for enhanced route refresh [RFC 7313] */ int enable_as4; /* Enable local support for 4B AS numbers [RFC 6793] */ int enable_extended_messages; /* Enable local support for extended messages [RFC 8654] */ int enable_hostname; /* Enable local support for hostname [draft] */ diff --git a/proto/bgp/config.Y b/proto/bgp/config.Y index d9ff24d8..f589fd84 100644 --- a/proto/bgp/config.Y +++ b/proto/bgp/config.Y @@ -24,7 +24,7 @@ CF_KEYWORDS(BGP, LOCAL, NEIGHBOR, AS, HOLD, TIME, CONNECT, RETRY, KEEPALIVE, BGP_AGGREGATOR, BGP_COMMUNITY, BGP_EXT_COMMUNITY, BGP_LARGE_COMMUNITY, SOURCE, ADDRESS, PASSWORD, RR, RS, CLIENT, CLUSTER, ID, AS4, ADVERTISE, IPV4, CAPABILITIES, LIMIT, PASSIVE, PREFER, OLDER, MISSING, LLADDR, - DROP, IGNORE, ROUTE, REFRESH, INTERPRET, COMMUNITIES, BGP_ORIGINATOR_ID, + DROP, IGNORE, ENHANCED, ROUTE, REFRESH, INTERPRET, COMMUNITIES, BGP_ORIGINATOR_ID, BGP_CLUSTER_LIST, IGP, TABLE, GATEWAY, DIRECT, RECURSIVE, MED, TTL, SECURITY, DETERMINISTIC, SECONDARY, ALLOW, BFD, ADD, PATHS, RX, TX, GRACEFUL, RESTART, AWARE, CHECK, LINK, PORT, EXTENDED, MESSAGES, SETKEY, @@ -62,6 +62,7 @@ bgp_proto_start: proto_start BGP { BGP_CFG->error_delay_time_min = 60; BGP_CFG->error_delay_time_max = 300; BGP_CFG->enable_refresh = 1; + BGP_CFG->enable_enhanced_refresh = 1; BGP_CFG->enable_as4 = 1; BGP_CFG->enable_hostname = 0; BGP_CFG->capabilities = 2; @@ -185,6 +186,7 @@ bgp_proto: | bgp_proto DISABLE AFTER ERROR bool ';' { BGP_CFG->disable_after_error = $5; } | bgp_proto DISABLE AFTER CEASE bgp_cease_mask ';' { BGP_CFG->disable_after_cease = $5; } | bgp_proto ENABLE ROUTE REFRESH bool ';' { BGP_CFG->enable_refresh = $5; } + | bgp_proto ENABLE ENHANCED ROUTE REFRESH bool ';' { BGP_CFG->enable_enhanced_refresh = $6; } | bgp_proto ENABLE AS4 bool ';' { BGP_CFG->enable_as4 = $4; } | bgp_proto ENABLE EXTENDED MESSAGES bool ';' { BGP_CFG->enable_extended_messages = $5; } | bgp_proto ADVERTISE HOSTNAME bool ';' { BGP_CFG->enable_hostname = $4; } diff --git a/proto/bgp/packets.c b/proto/bgp/packets.c index dc52e805..fd7828f0 100644 --- a/proto/bgp/packets.c +++ b/proto/bgp/packets.c @@ -245,7 +245,7 @@ bgp_prepare_capabilities(struct bgp_conn *conn) caps->as4_support = p->cf->enable_as4; caps->ext_messages = p->cf->enable_extended_messages; caps->route_refresh = p->cf->enable_refresh; - caps->enhanced_refresh = p->cf->enable_refresh; + caps->enhanced_refresh = p->cf->enable_refresh && p->cf->enable_enhanced_refresh; caps->role = p->cf->local_role; if (caps->as4_support) |