There are two problems with the current code for processing the attached
bit:
- we should process it when acting both a level-1-only and level-1-2
- we should add the default route when we don't have L2 adjacensies, not
when we don't have other routers configured on the device
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
(cherry picked from commit
a4777e465ab5515bf36ad5f3dc4c413adf9d15b6)
return;
}
-static bool isis_level2_adj_up(struct isis_area *area)
+bool isis_level2_adj_up(struct isis_area *area)
{
struct listnode *node, *cnode;
struct isis_circuit *circuit;
struct list *adjdb;
struct isis_adjacency *adj;
+ if (area->is_type == IS_LEVEL_1)
+ return false;
+
for (ALL_LIST_ELEMENTS_RO(area->circuit_list, cnode, circuit)) {
if (circuit->circ_type == CIRCUIT_T_BROADCAST) {
adjdb = circuit->u.bc.adjdb[1];
int lsp_generate_pseudo(struct isis_circuit *circuit, int level);
int lsp_regenerate_schedule_pseudo(struct isis_circuit *circuit, int level);
+bool isis_level2_adj_up(struct isis_area *area);
+
struct isis_lsp *lsp_new(struct isis_area *area, uint8_t *lsp_id,
uint16_t rem_lifetime, uint32_t seq_num,
uint8_t lsp_bits, uint16_t checksum,
*/
if ((lsp->hdr.lsp_bits & LSPBIT_ATT) == LSPBIT_ATT
&& !spftree->area->attached_bit_rcv_ignore
- && spftree->area->is_type == IS_LEVEL_1
- && !isis_area_count(spftree->area->isis, IS_LEVEL_2)) {
+ && (spftree->area->is_type & IS_LEVEL_1)
+ && !isis_level2_adj_up(spftree->area)) {
struct prefix_pair ip_info = { {0} };
if (IS_DEBUG_RTE_EVENTS)
zlog_debug("ISIS-Spf (%s): add default %s route",
return CMD_SUCCESS;
}
-/* return the number of Level1 and level-1-2 routers or
- * the number of Level2 and level-1-2 routers configured
- */
-int isis_area_count(const struct isis *isis, int levels)
-{
- struct isis_area *area;
- struct listnode *node;
- int count = 0;
-
- for (ALL_LIST_ELEMENTS_RO(isis->area_list, node, area))
- if (area->is_type & levels)
- count++;
-
- return count;
-}
-
void isis_area_destroy(struct isis_area *area)
{
struct listnode *node, *nnode;
struct isis_area *isis_area_lookup_by_vrf(const char *area_tag,
const char *vrf_name);
int isis_area_get(struct vty *vty, const char *area_tag);
-int isis_area_count(const struct isis *isis, int levels);
void isis_area_destroy(struct isis_area *area);
void isis_filter_update(struct access_list *access);
void isis_prefix_list_update(struct prefix_list *plist);