diff options
-rw-r--r-- | isisd/isis_lsp.c | 9 | ||||
-rw-r--r-- | isisd/isis_northbound.c | 19 | ||||
-rw-r--r-- | isisd/isisd.h | 2 |
3 files changed, 30 insertions, 0 deletions
diff --git a/isisd/isis_lsp.c b/isisd/isis_lsp.c index 8d393c7a0..8b2af9975 100644 --- a/isisd/isis_lsp.c +++ b/isisd/isis_lsp.c @@ -355,6 +355,15 @@ void lsp_inc_seqno(struct isis_lsp *lsp, uint32_t seqno) else newseq = seqno + 1; +#ifndef FABRICD + /* check for overflow */ + if (newseq < lsp->hdr.seqno) { + /* send northbound notification */ + isis_notif_lsp_exceed_max(lsp->area, + rawlspid_print(lsp->hdr.lsp_id)); + } +#endif /* ifndef FABRICD */ + lsp->hdr.seqno = newseq; lsp_pack_pdu(lsp); diff --git a/isisd/isis_northbound.c b/isisd/isis_northbound.c index 136fec237..c112c64ca 100644 --- a/isisd/isis_northbound.c +++ b/isisd/isis_northbound.c @@ -2569,6 +2569,25 @@ void isis_notif_corrupted_lsp(const struct isis_area *area, const char *lsp_id) nb_notification_send(xpath, arguments); } +/* + * XPath: + * /frr-isisd:attempt-to-exceed-max-sequence + */ +void isis_notif_lsp_exceed_max(const struct isis_area *area, const char *lsp_id) +{ + const char *xpath = "/frr-isisd:attempt-to-exceed-max-sequence"; + struct list *arguments = yang_data_list_new(); + char xpath_arg[XPATH_MAXLEN]; + struct yang_data *data; + + notif_prep_instance_hdr(xpath, area, "default", arguments); + snprintf(xpath_arg, sizeof(xpath_arg), "%s/lsp-id", xpath); + data = yang_data_new_string(xpath_arg, lsp_id); + listnode_add(arguments, data); + + nb_notification_send(xpath, arguments); +} + /* clang-format off */ const struct frr_yang_module_info frr_isisd_info = { .name = "frr-isisd", diff --git a/isisd/isisd.h b/isisd/isisd.h index 12d3f2bec..6f32dbdd5 100644 --- a/isisd/isisd.h +++ b/isisd/isisd.h @@ -229,6 +229,8 @@ extern void isis_notif_if_state_change(const struct isis_circuit *circuit, bool down); extern void isis_notif_corrupted_lsp(const struct isis_area *area, const char *lsp_id); /* currently unused */ +extern void isis_notif_lsp_exceed_max(const struct isis_area *area, + const char *lsp_id); /* Master of threads. */ extern struct thread_master *master; |