retval = circuit->tx(circuit, level);
if (retval != ISIS_OK)
- flog_err(ISIS_ERR_PACKET,
- "ISIS-Upd (%s): Send L%d LSP PSNP on %s failed",
- circuit->area->area_tag, level,
- circuit->interface->name);
+ flog_err(EC_ISIS_PACKET,
+ "ISIS-Upd (%s): Send L%d LSP PSNP on %s failed",
+ circuit->area->area_tag, level,
+ circuit->interface->name);
return retval;
}
}
if (!p2p_hello && !(level & iih.circ_type)) {
- flog_err(ISIS_ERR_PACKET,
- "Level %d LAN Hello with Circuit Type %d", level,
- iih.circ_type);
+ flog_err(EC_ISIS_PACKET,
+ "Level %d LAN Hello with Circuit Type %d", level,
+ iih.circ_type);
return ISIS_ERROR;
}
* is
* "greater" than that held by S, ... */
- if (hdr.seqno > lsp->hdr.seqno) {
+ if (comp == LSP_NEWER) {
/* 7.3.16.1 */
lsp_inc_seqno(lsp, hdr.seqno);
- if (isis->debugs & DEBUG_UPDATE_PACKETS)
+ if (isis->debugs & DEBUG_UPDATE_PACKETS) {
zlog_debug(
"ISIS-Upd (%s): (2) re-originating LSP %s new seq 0x%08" PRIx32,
circuit->area->area_tag,
rawlspid_print(hdr.lsp_id),
lsp->hdr.seqno);
+ }
+ lsp_flood(lsp, NULL);
+ } else if (comp == LSP_EQUAL) {
+ isis_tx_queue_del(circuit->tx_queue, lsp);
+ if (circuit->circ_type != CIRCUIT_T_BROADCAST)
+ ISIS_SET_FLAG(lsp->SSNflags, circuit);
+ } else {
+ isis_tx_queue_add(circuit->tx_queue, lsp,
+ TX_LSP_NORMAL);
+ ISIS_CLEAR_FLAG(lsp->SSNflags, circuit);
}
- /* If the received LSP is older or equal,
- * resend the LSP which will act as ACK */
- lsp_flood(lsp, NULL);
} else {
/* 7.3.15.1 e) - This lsp originated on another system */
continue;
}
}
- struct isis_lsp *lsp =
- lsp_new(circuit->area, entry->id,
+ lsp = lsp_new(circuit->area, entry->id,
entry->rem_lifetime, 0, 0,
entry->checksum, lsp0, level);
lsp_insert(lsp,
}
/* lets free it */
- list_delete_and_null(&lsp_list);
+ list_delete(&lsp_list);
}
if (fabricd_initial_sync_is_complete(circuit->area) && resync_needed)
/* Verify that at least the 8 bytes fixed header have been received */
if (stream_get_endp(circuit->rcv_stream) < ISIS_FIXED_HDR_LEN) {
- flog_err(ISIS_ERR_PACKET, "PDU is too short to be IS-IS.");
+ flog_err(EC_ISIS_PACKET, "PDU is too short to be IS-IS.");
return ISIS_ERROR;
}
uint8_t max_area_addrs = stream_getc(circuit->rcv_stream);
if (idrp == ISO9542_ESIS) {
- flog_err(LIB_ERR_DEVELOPMENT,
- "No support for ES-IS packet IDRP=%" PRIx8, idrp);
+ flog_err(EC_LIB_DEVELOPMENT,
+ "No support for ES-IS packet IDRP=%" PRIx8, idrp);
return ISIS_ERROR;
}
if (idrp != ISO10589_ISIS) {
- flog_err(ISIS_ERR_PACKET, "Not an IS-IS packet IDRP=%" PRIx8,
- idrp);
+ flog_err(EC_ISIS_PACKET, "Not an IS-IS packet IDRP=%" PRIx8,
+ idrp);
return ISIS_ERROR;
}
if (id_len != 0 && id_len != ISIS_SYS_ID_LEN) {
flog_err(
- ISIS_ERR_PACKET,
+ EC_ISIS_PACKET,
"IDFieldLengthMismatch: ID Length field in a received PDU %" PRIu8
", while the parameter for this IS is %u",
id_len, ISIS_SYS_ID_LEN);
}
if (length != expected_length) {
- flog_err(ISIS_ERR_PACKET,
- "Exepected fixed header length = %" PRIu8
- " but got %" PRIu8,
- expected_length, length);
+ flog_err(EC_ISIS_PACKET,
+ "Exepected fixed header length = %" PRIu8
+ " but got %" PRIu8,
+ expected_length, length);
return ISIS_ERROR;
}
if (stream_get_endp(circuit->rcv_stream) < length) {
flog_err(
- ISIS_ERR_PACKET,
+ EC_ISIS_PACKET,
"PDU is too short to contain fixed header of given PDU type.");
return ISIS_ERROR;
}
&& max_area_addrs != 0
&& max_area_addrs != isis->max_area_addrs) {
flog_err(
- ISIS_ERR_PACKET,
+ EC_ISIS_PACKET,
"maximumAreaAddressesMismatch: maximumAreaAdresses in a received PDU %" PRIu8
" while the parameter for this IS is %u",
max_area_addrs, isis->max_area_addrs);
retval = circuit->tx(circuit, level);
if (retval != ISIS_OK)
- flog_err(ISIS_ERR_PACKET,
- "ISIS-Adj (%s): Send L%d IIH on %s failed",
- circuit->area->area_tag, level,
- circuit->interface->name);
+ flog_err(EC_ISIS_PACKET,
+ "ISIS-Adj (%s): Send L%d IIH on %s failed",
+ circuit->area->area_tag, level,
+ circuit->interface->name);
return retval;
}
int retval = circuit->tx(circuit, level);
if (retval != ISIS_OK) {
- flog_err(ISIS_ERR_PACKET,
- "ISIS-Snp (%s): Send L%d CSNP on %s failed",
- circuit->area->area_tag, level,
- circuit->interface->name);
+ flog_err(EC_ISIS_PACKET,
+ "ISIS-Snp (%s): Send L%d CSNP on %s failed",
+ circuit->area->area_tag, level,
+ circuit->interface->name);
isis_free_tlvs(tlvs);
return retval;
}
int retval = circuit->tx(circuit, level);
if (retval != ISIS_OK) {
- flog_err(ISIS_ERR_PACKET,
- "ISIS-Snp (%s): Send L%d PSNP on %s failed",
- circuit->area->area_tag, level,
- circuit->interface->name);
+ flog_err(EC_ISIS_PACKET,
+ "ISIS-Snp (%s): Send L%d PSNP on %s failed",
+ circuit->area->area_tag, level,
+ circuit->interface->name);
isis_free_tlvs(tlvs);
return retval;
}
* the circuit's MTU. So handle and log this case here. */
if (stream_get_endp(lsp->pdu) > stream_get_size(circuit->snd_stream)) {
flog_err(
- ISIS_ERR_PACKET,
+ EC_ISIS_PACKET,
"ISIS-Upd (%s): Can't send L%d LSP %s, seq 0x%08" PRIx32
", cksum 0x%04" PRIx16 ", lifetime %" PRIu16
"s on %s. LSP Size is %zu while interface stream size is %zu.",
clear_srm = 0;
retval = circuit->tx(circuit, lsp->level);
if (retval != ISIS_OK) {
- flog_err(ISIS_ERR_PACKET,
- "ISIS-Upd (%s): Send L%d LSP on %s failed %s",
- circuit->area->area_tag, lsp->level,
- circuit->interface->name,
- (retval == ISIS_WARNING) ? "temporarily"
- : "permanently");
+ flog_err(EC_ISIS_PACKET,
+ "ISIS-Upd (%s): Send L%d LSP on %s failed %s",
+ circuit->area->area_tag, lsp->level,
+ circuit->interface->name,
+ (retval == ISIS_WARNING) ? "temporarily"
+ : "permanently");
}
out: