diff options
-rw-r--r-- | isisd/fabricd.c | 21 | ||||
-rw-r--r-- | isisd/isis_pdu.c | 21 | ||||
-rw-r--r-- | isisd/isis_pdu_counter.c | 2 | ||||
-rw-r--r-- | isisd/isis_tx_queue.c | 6 | ||||
-rw-r--r-- | isisd/isis_tx_queue.h | 4 | ||||
-rw-r--r-- | isisd/isis_vty_fabricd.c | 6 |
6 files changed, 33 insertions, 27 deletions
diff --git a/isisd/fabricd.c b/isisd/fabricd.c index 152bfb528..e8b729c77 100644 --- a/isisd/fabricd.c +++ b/isisd/fabricd.c @@ -81,7 +81,8 @@ struct neighbor_entry { static struct neighbor_entry *neighbor_entry_new(const uint8_t *id, struct isis_adjacency *adj) { - struct neighbor_entry *rv = XMALLOC(MTYPE_FABRICD_NEIGHBOR, sizeof(*rv)); + struct neighbor_entry *rv = XMALLOC(MTYPE_FABRICD_NEIGHBOR, + sizeof(*rv)); memcpy(rv->id, id, sizeof(rv->id)); rv->adj = adj; @@ -131,7 +132,7 @@ static int neighbor_entry_list_cmp(void *a, void *b) static struct neighbor_entry *neighbor_entry_lookup_list(struct skiplist *list, const uint8_t *id) { - struct neighbor_entry n = {{0}}; + struct neighbor_entry n = { {0} }; memcpy(n.id, id, sizeof(n.id)); @@ -551,7 +552,8 @@ static void move_to_queue(struct isis_lsp *lsp, struct neighbor_entry *n, if (n->adj) isis_tx_queue_add(n->adj->circuit->tx_queue, lsp, type); - uint8_t *neighbor_id = XMALLOC(MTYPE_FABRICD_FLOODING_INFO, sizeof(n->id)); + uint8_t *neighbor_id = XMALLOC(MTYPE_FABRICD_FLOODING_INFO, + sizeof(n->id)); memcpy(neighbor_id, n->id, sizeof(n->id)); listnode_add(lsp->flooding_neighbors[type], neighbor_id); @@ -624,7 +626,8 @@ static void fabricd_lsp_reset_flooding_info(struct isis_lsp *lsp, } lsp->flooding_neighbors[type] = list_new(); - lsp->flooding_neighbors[type]->del = fabricd_free_lsp_flooding_info; + lsp->flooding_neighbors[type]->del = + fabricd_free_lsp_flooding_info; } if (circuit) { @@ -646,16 +649,16 @@ void fabricd_lsp_flood(struct isis_lsp *lsp, struct isis_circuit *circuit) struct neighbor_entry *n; /* Mark all elements in NL as present */ - while (!skiplist_next(f->neighbors, NULL, (void **)&n, &cursor)) { + while (!skiplist_next(f->neighbors, NULL, (void **)&n, &cursor)) n->present = true; - } /* Mark all elements in NN as present */ hash_iterate(f->neighbors_neighbors, mark_neighbor_as_present, NULL); - struct isis_vertex *originator = isis_find_vertex(&f->spftree->paths, - lsp->hdr.lsp_id, - VTYPE_NONPSEUDO_TE_IS); + struct isis_vertex *originator = + isis_find_vertex(&f->spftree->paths, + lsp->hdr.lsp_id, + VTYPE_NONPSEUDO_TE_IS); /* Remove all IS from NL and NN in the shortest path * to the IS that originated the LSP */ diff --git a/isisd/isis_pdu.c b/isisd/isis_pdu.c index 349812dca..6303536c1 100644 --- a/isisd/isis_pdu.c +++ b/isisd/isis_pdu.c @@ -708,11 +708,10 @@ static void lsp_flood_or_update(struct isis_lsp *lsp, struct isis_circuit *circuit, bool circuit_scoped) { - if (!circuit_scoped) { + if (!circuit_scoped) lsp_flood(lsp, circuit); - } else { + else fabricd_update_lsp_no_flood(lsp, circuit); - } } /* @@ -990,7 +989,8 @@ dontcheckadj: /* our own LSP -> 7.3.16.4 c) */ if (comp == LSP_NEWER) { lsp_inc_seqno(lsp, hdr.seqno); - lsp_flood_or_update(lsp, NULL, circuit_scoped); + lsp_flood_or_update(lsp, NULL, + circuit_scoped); } else { isis_tx_queue_add(circuit->tx_queue, lsp, TX_LSP_NORMAL); @@ -998,7 +998,9 @@ dontcheckadj: } if (isis->debugs & DEBUG_UPDATE_PACKETS) zlog_debug( - "ISIS-Upd (%s): (1) re-originating LSP %s new seq 0x%08" PRIx32, + "ISIS-Upd (%s): (1) " + "re-originating LSP %s new seq " + "0x%08" PRIx32, circuit->area->area_tag, rawlspid_print(hdr.lsp_id), lsp->hdr.seqno); @@ -1746,7 +1748,8 @@ int send_hello(struct isis_circuit *circuit, int level) isis_free_tlvs(tlvs); - pdu_counter_count(circuit->area->pdu_tx_counters, hello_pdu_type(circuit, level)); + pdu_counter_count(circuit->area->pdu_tx_counters, + hello_pdu_type(circuit, level)); retval = circuit->tx(circuit, level); if (retval != ISIS_OK) flog_err(EC_ISIS_PACKET, @@ -1760,9 +1763,8 @@ int send_hello(struct isis_circuit *circuit, int level) static int send_hello_cb(struct thread *thread) { struct isis_circuit_arg *arg = THREAD_ARG(thread); - assert(arg); - + struct isis_circuit *circuit = arg->circuit; int level = arg->level; @@ -2248,7 +2250,8 @@ void send_lsp(struct isis_circuit *circuit, struct isis_lsp *lsp, if (tx_type == TX_LSP_CIRCUIT_SCOPED) { stream_putc_at(circuit->snd_stream, 4, FS_LINK_STATE); - stream_putc_at(circuit->snd_stream, 7, L2_CIRCUIT_FLOODING_SCOPE); + stream_putc_at(circuit->snd_stream, 7, + L2_CIRCUIT_FLOODING_SCOPE); } if (isis->debugs & DEBUG_UPDATE_PACKETS) { diff --git a/isisd/isis_pdu_counter.c b/isisd/isis_pdu_counter.c index 90bb758c2..ec2a0c207 100644 --- a/isisd/isis_pdu_counter.c +++ b/isisd/isis_pdu_counter.c @@ -56,7 +56,7 @@ static int pdu_type_to_counter_index(uint8_t pdu_type) static const char *pdu_counter_index_to_name(enum pdu_counter_index index) { - switch(index) { + switch (index) { case L1_LAN_HELLO_INDEX: return " L1 IIH"; case L2_LAN_HELLO_INDEX: diff --git a/isisd/isis_tx_queue.c b/isisd/isis_tx_queue.c index bf5817d00..270dcae7d 100644 --- a/isisd/isis_tx_queue.c +++ b/isisd/isis_tx_queue.c @@ -125,11 +125,11 @@ static int tx_queue_send_event(struct thread *thread) e->retry = NULL; thread_add_timer(master, tx_queue_send_event, e, 5, &e->retry); - if (e->is_retry) { + if (e->is_retry) queue->circuit->area->lsp_rxmt_count++; - } else { + else e->is_retry = true; - } + queue->send_event(queue->circuit, e->lsp, e->type); /* Don't access e here anymore, send_event might have destroyed it */ diff --git a/isisd/isis_tx_queue.h b/isisd/isis_tx_queue.h index 7b01f1a3d..c2beda45b 100644 --- a/isisd/isis_tx_queue.h +++ b/isisd/isis_tx_queue.h @@ -42,8 +42,8 @@ void isis_tx_queue_free(struct isis_tx_queue *queue); _isis_tx_queue_add((queue), (lsp), (type), \ __func__, __FILE__, __LINE__) void _isis_tx_queue_add(struct isis_tx_queue *queue, struct isis_lsp *lsp, - enum isis_tx_type type, const char *func, - const char *file, int line); + enum isis_tx_type type, const char *func, + const char *file, int line); #define isis_tx_queue_del(queue, lsp) \ _isis_tx_queue_del((queue), (lsp), __func__, __FILE__, __LINE__) diff --git a/isisd/isis_vty_fabricd.c b/isisd/isis_vty_fabricd.c index aa4ccdd07..aa48fe1d3 100644 --- a/isisd/isis_vty_fabricd.c +++ b/isisd/isis_vty_fabricd.c @@ -120,7 +120,8 @@ static void lsp_print_flooding(struct vty *vty, struct isis_lsp *lsp) vty_out(vty, " ago)\n"); if (lsp->flooding_circuit_scoped) { - vty_out(vty, " Received as circuit-scoped LSP, so not flooded.\n"); + vty_out(vty, " Received as circuit-scoped LSP, so not " + "flooded.\n"); return; } @@ -149,9 +150,8 @@ DEFUN (show_lsp_flooding, { const char *lspid = NULL; - if (argc == 4) { + if (argc == 4) lspid = argv[3]->arg; - } struct listnode *node; struct isis_area *area; |