diff options
author | Ondrej Zajicek <santiago@crfreenet.org> | 2023-11-23 17:18:04 +0100 |
---|---|---|
committer | Ondrej Zajicek <santiago@crfreenet.org> | 2023-11-23 17:18:04 +0100 |
commit | b6923f6386b04340d6b2b6a75fbe83c392f207ca (patch) | |
tree | 77299aae78af31a8a95d097516708dfd766a49e0 /proto/bgp/bgp.c | |
parent | 31aa62ae6d2e111e87c08b4b27a16ead968f0689 (diff) |
BGP: Simplify capability handling
Diffstat (limited to 'proto/bgp/bgp.c')
-rw-r--r-- | proto/bgp/bgp.c | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/proto/bgp/bgp.c b/proto/bgp/bgp.c index f8146bdf..914935b9 100644 --- a/proto/bgp/bgp.c +++ b/proto/bgp/bgp.c @@ -546,9 +546,6 @@ bgp_conn_enter_openconfirm_state(struct bgp_conn *conn) bgp_conn_set_state(conn, BS_OPENCONFIRM); } -static const struct bgp_af_caps dummy_af_caps = { }; -static const struct bgp_af_caps basic_af_caps = { .ready = 1 }; - void bgp_conn_enter_established_state(struct bgp_conn *conn) { @@ -604,20 +601,6 @@ bgp_conn_enter_established_state(struct bgp_conn *conn) const struct bgp_af_caps *loc = bgp_find_af_caps(local, c->afi); const struct bgp_af_caps *rem = bgp_find_af_caps(peer, c->afi); - /* Use default if capabilities were not announced */ - if (!local->length && (c->afi == BGP_AF_IPV4)) - loc = &basic_af_caps; - - if (!peer->length && (c->afi == BGP_AF_IPV4)) - rem = &basic_af_caps; - - /* Ignore AFIs that were not announced in multiprotocol capability */ - if (!loc || !loc->ready) - loc = &dummy_af_caps; - - if (!rem || !rem->ready) - rem = &dummy_af_caps; - int active = loc->ready && rem->ready; c->c.disabled = !active; c->c.reloadable = p->route_refresh || c->cf->import_table; |