Here is the fix I propose :

Fix : Check the adjacency is with the same router as the source of the hellos. 
In this case,  it is not the same,  as adjacency with previous router R1 
prevails while hellos are arriving from newly connected router R2. Hence, bring 
down the adjacency with previous router R1, so the next hello from newly 
connected router R2 will be processed and a new adjacency will be created with 
the R2. This can be done by checking the source of the hello received once an 
adjacency is up, if a mismatch is detected, kill the adjacency and let the next 
hellos trigger creating the new adjacency.

Here is the patch. I am comparing the source of hello with the adjacency id.  
To bring down the adjacency, I simply call  isis_adj_state_change (adj, 
ISIS_ADJ_DOWN, "adj do not exist anymore")
In our case,  this will invoke isis_delete_adj which takes care of the SPF 
recalculation.

isis_pdu.c: check for source ID on receiving hello, match adjacency with source 
of hellos



    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

    hello trigger creating the new adjacency.





Files:

    Modified isisd/isis_pdu.c



--- a/isisd/isis_pdu.c

+++ b/isisd/isis_pdu.c

@@ -566,6 +566,14 @@ 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 
anymore");

+                return 0;

+        }

+  }

  if (!adj || adj->level != hdr->circuit_t)

     {

       if (!adj)


Please review and comment.

Thanks,
Amritha

From: Nambiar, Amritha [mailto:[email protected]]
Sent: Thursday, January 22, 2015 12:43 PM
To: [email protected]
Subject: [quagga-dev 11967] isisd : Adjacency update issue

Adjacency is not formed with the new router when swapping routers on mesh 
connections within hello expiry interval.

When a router R1 is disconnected from router R0 and replaced with a link to 
another router R2 on the same port of R0 within the hello expiry interval, the 
router R1 (that was disconnected) is still seen in the topology. R0 fails to 
form adjacency with the new router R2.

Root cause :  When the router R1 was disconnected from R0, the adjacency with 
R1 continues to exist until its hello/adjacency expiry interval times out. When 
router R2 was swapped into R0 on the same port (as R1 once occupied) within the 
time  the hellos from previously connected R1 expired, an adjacency is already 
up and existing (with a non-existent R1). Even though hellos from R2 arrive at 
R0, these hellos are never checked for their source and consequently processed 
to update the adjacency, while the previous adjacency with a non-existent R1 
prevails as the hold time does not expire since new hellos continue to arrive.

Has anyone seen this issue before ?

Thanks,
Amritha

_______________________________________________
Quagga-dev mailing list
[email protected]
https://lists.quagga.net/mailman/listinfo/quagga-dev

Reply via email to