From: Donald Sharp Date: Mon, 11 Feb 2019 02:19:48 +0000 (-0500) Subject: eigrpd: Do not redelete the eigrp interface data structure X-Git-Tag: 7.1_pulled~254^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=84b5e534e6bbf4ca69d4692dc89f472eb18adc68;p=matthieu%2Ffrr.git eigrpd: Do not redelete the eigrp interface data structure 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 --- diff --git a/eigrpd/eigrp_zebra.c b/eigrpd/eigrp_zebra.c index 09d876afaa..dc1ae675b0 100644 --- a/eigrpd/eigrp_zebra.c +++ b/eigrpd/eigrp_zebra.c @@ -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); diff --git a/tests/topotests/eigrp-topo1/r1/zebra.conf b/tests/topotests/eigrp-topo1/r1/zebra.conf index 8537f6dd80..56ae4a66f4 100644 --- a/tests/topotests/eigrp-topo1/r1/zebra.conf +++ b/tests/topotests/eigrp-topo1/r1/zebra.conf @@ -1,4 +1,5 @@ log file zebra.log +debug zebra rib detail ! hostname r1 ! diff --git a/tests/topotests/eigrp-topo1/test_eigrp_topo1.py b/tests/topotests/eigrp-topo1/test_eigrp_topo1.py index 8ea2f0b506..1c00face43 100755 --- a/tests/topotests/eigrp-topo1/test_eigrp_topo1.py +++ b/tests/topotests/eigrp-topo1/test_eigrp_topo1.py @@ -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: