]> git.proxmox.com Git - mirror_frr.git/blobdiff - isisd/isis_pdu.c
lib: enforce vrf_name_to_id by returning default_vrf when name is null
[mirror_frr.git] / isisd / isis_pdu.c
index 6b3cd031923334399f0d28fed837c192cd0a1979..330da9b216b62a5c760200dacf64f6bb0b3adf57 100644 (file)
@@ -916,6 +916,17 @@ static int process_lsp(uint8_t pdu_type, struct isis_circuit *circuit,
                             circuit->rcv_stream, &tlvs, &error_log)) {
                zlog_warn("Something went wrong unpacking the LSP: %s",
                          error_log);
+#ifndef FABRICD
+               /* send northbound notification. Note that the tlv-type and
+                * offset cannot correctly be set here as they are not returned
+                * by isis_unpack_tlvs, but in there I cannot fire a
+                * notification because I have no circuit information. So until
+                * we change the code above to return those extra fields, we
+                * will send dummy values which are ignored in the callback
+                */
+               isis_notif_lsp_error(circuit, rawlspid_print(hdr.lsp_id),
+                                    raw_pdu, 0, 0);
+#endif /* ifndef FABRICD */
                goto out;
        }
 
@@ -1080,6 +1091,16 @@ dontcheckadj:
                        } else if (lsp->hdr.rem_lifetime != 0) {
                                /* our own LSP -> 7.3.16.4 c) */
                                if (comp == LSP_NEWER) {
+#ifndef FABRICD
+                                       if (lsp->hdr.seqno < hdr.seqno) {
+                                               /* send northbound
+                                                * notification */
+                                               isis_notif_seqno_skipped(
+                                                       circuit,
+                                                       rawlspid_print(
+                                                               hdr.lsp_id));
+                                       }
+#endif /* ifndef FABRICD */
                                        lsp_inc_seqno(lsp, hdr.seqno);
                                        lsp_flood_or_update(lsp, NULL,
                                                            circuit_scoped);
@@ -1096,6 +1117,13 @@ dontcheckadj:
                                                circuit->area->area_tag,
                                                rawlspid_print(hdr.lsp_id),
                                                lsp->hdr.seqno);
+                       } else {
+                               /* our own LSP with 0 remaining life time */
+#ifndef FABRICD
+                               /* send northbound notification */
+                               isis_notif_own_lsp_purge(
+                                       circuit, rawlspid_print(hdr.lsp_id));
+#endif /* ifndef FABRICD */
                        }
                }
                goto out;
@@ -1120,6 +1148,11 @@ dontcheckadj:
                if (comp == LSP_NEWER) {
                        /* 7.3.16.1  */
                        lsp_inc_seqno(lsp, hdr.seqno);
+#ifndef FABRICD
+                       /* send northbound notification */
+                       isis_notif_seqno_skipped(circuit,
+                                                rawlspid_print(hdr.lsp_id));
+#endif /* ifndef FABRICD */
                        if (isis->debugs & DEBUG_UPDATE_PACKETS) {
                                zlog_debug(
                                        "ISIS-Upd (%s): (2) re-originating LSP %s new seq 0x%08" PRIx32,
@@ -1575,6 +1608,10 @@ int isis_handle_pdu(struct isis_circuit *circuit, uint8_t *ssnpa)
 
        if (version1 != 1) {
                zlog_warn("Unsupported ISIS version %" PRIu8, version1);
+#ifndef FABRICD
+               /* send northbound notification */
+               isis_notif_version_skew(circuit, version1, raw_pdu);
+#endif /* ifndef FABRICD */
                return ISIS_WARNING;
        }
 
@@ -1584,6 +1621,10 @@ int isis_handle_pdu(struct isis_circuit *circuit, uint8_t *ssnpa)
                        "IDFieldLengthMismatch: ID Length field in a received PDU  %" PRIu8
                        ", while the parameter for this IS is %u",
                        id_len, ISIS_SYS_ID_LEN);
+#ifndef FABRICD
+               /* send northbound notification */
+               isis_notif_id_len_mismatch(circuit, id_len, raw_pdu);
+#endif /* ifndef FABRICD */
                return ISIS_ERROR;
        }
 
@@ -1610,6 +1651,10 @@ int isis_handle_pdu(struct isis_circuit *circuit, uint8_t *ssnpa)
 
        if (version2 != 1) {
                zlog_warn("Unsupported ISIS PDU version %" PRIu8, version2);
+#ifndef FABRICD
+               /* send northbound notification */
+               isis_notif_version_skew(circuit, version2, raw_pdu);
+#endif /* ifndef FABRICD */
                return ISIS_WARNING;
        }