]> git.puffer.fish Git - mirror/frr.git/commitdiff
eigrpd: Do not redelete the eigrp interface data structure 3771/head
authorDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 11 Feb 2019 02:19:48 +0000 (21:19 -0500)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 11 Feb 2019 12:23:23 +0000 (07:23 -0500)
On interface down do not delete the eigrp interface data
structure.  Ensure that the address that we have setup the
eigrp data structure ontop of is what we are deleting.

Additionally add a test to show that this is no-longer
crashing eigrp.  Future commits will further modify
this test to actually ensure that the eigrp topo is
updated correctly and the rib has the correct data.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
eigrpd/eigrp_zebra.c
tests/topotests/eigrp-topo1/r1/zebra.conf
tests/topotests/eigrp-topo1/test_eigrp_topo1.py

index 09d876afaa2c4ddd0e07916f038943b6dacd16ce..dc1ae675b04c7c653072adebe3dcf1efd54150aa 100644 (file)
@@ -258,7 +258,8 @@ static int eigrp_interface_address_delete(int command, struct zclient *zclient,
                return 0;
 
        /* Call interface hook functions to clean up */
-       eigrp_if_free(ei, INTERFACE_DOWN_BY_ZEBRA);
+       if (prefix_cmp(&ei->address, c->address) == 0)
+               eigrp_if_free(ei, INTERFACE_DOWN_BY_ZEBRA);
 
        connected_free(c);
 
index 8537f6dd80edadc79aa35b5c5165b5035f94ad89..56ae4a66f4698057e7a063ceaa5b635c9d9c45b9 100644 (file)
@@ -1,4 +1,5 @@
 log file zebra.log
+debug zebra rib detail
 !
 hostname r1
 !
index 8ea2f0b506e263c9194ad340855533b9dc535d04..1c00face43fdfe2109140fff69c5f377281d24f3 100755 (executable)
@@ -171,6 +171,16 @@ def test_zebra_ipv4_routingTable():
         assertmsg = 'Zebra IPv4 Routing Table verification failed for router {}'.format(router.name)
         assert topotest.json_cmp(output, expected) is None, assertmsg
 
+def test_shut_interface_and_recover():
+    "Test shutdown of an interface and recovery of the interface"
+
+    tgen = get_topogen()
+    router = tgen.gears['r1']
+    router.run('ip link set r1-eth1 down')
+    topotest.sleep(5, 'Waiting for EIGRP convergence')
+    router.run('ip link set r1-eth1 up')
+
+
 
 def test_shutdown_check_stderr():
     if os.environ.get('TOPOTESTS_CHECK_STDERR') is None: