isis_pdu.c: match adjacency with source of hellos, check for source ID on receiving hello
If an adjacency exists, check the adjacency is with the same router as the source of the hellos. In case a mismatch is detected, bring down the adjacency and let the next hellos trigger creating the new adjacency. Signed-off-by: Amritha Nambiar <[email protected]> --- isisd/isis_pdu.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/isisd/isis_pdu.c b/isisd/isis_pdu.c index 8d8a5e0..166dd7c 100644 --- a/isisd/isis_pdu.c +++ b/isisd/isis_pdu.c @@ -566,6 +566,17 @@ process_p2p_hello (struct isis_circuit *circuit) * the circuit */ adj = circuit->u.p2p.neighbor; + /* If an adjacency exists, check it is with the source of the hello + * packets */ + if (adj) + { + if (memcmp(hdr->source_id, adj->sysid, ISIS_SYS_ID_LEN)) + { + zlog_debug("hello source and adjacency do not match, set adj down\n"); + isis_adj_state_change (adj, ISIS_ADJ_DOWN, "adj do not exist"); + return 0; + } + } if (!adj || adj->level != hdr->circuit_t) { if (!adj) _______________________________________________ Quagga-dev mailing list [email protected] https://lists.quagga.net/mailman/listinfo/quagga-dev
