From 793ec4733d47fcc2a2f60e55961b0511bdb61273 Mon Sep 17 00:00:00 2001 From: Amritha Nambiar Date: Wed, 28 Jan 2015 18:09:30 +0000 Subject: [PATCH] isisd: match adjacency with source of hellos 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 Signed-off-by: David Lamparter (cherry picked from commit 3c28aaf437d8d473adb89c5e74574a61a9ea7cc6) --- isisd/isis_pdu.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/isisd/isis_pdu.c b/isisd/isis_pdu.c index dad39bcda3..a4fe65af45 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) -- 2.39.5