Revision 7e5f769d proto/bgp/bgp.c

View differences:

proto/bgp/bgp.c
491 491
}
492 492

  
493 493
static const struct bgp_af_caps dummy_af_caps = { };
494
static const struct bgp_af_caps basic_af_caps = { .ready = 1 };
494 495

  
495 496
void
496 497
bgp_conn_enter_established_state(struct bgp_conn *conn)
......
541 542
    const struct bgp_af_caps *loc = bgp_find_af_caps(local, c->afi);
542 543
    const struct bgp_af_caps *rem = bgp_find_af_caps(peer,  c->afi);
543 544

  
545
    /* Use default if capabilities were not announced */
546
    if (!local->length && (c->afi == BGP_AF_IPV4))
547
      loc = &basic_af_caps;
548

  
549
    if (!peer->length && (c->afi == BGP_AF_IPV4))
550
      rem = &basic_af_caps;
551

  
544 552
    /* Ignore AFIs that were not announced in multiprotocol capability */
545 553
    if (!loc || !loc->ready)
546 554
      loc = &dummy_af_caps;

Also available in: Unified diff