From 4030583f6a80ac9c620937d1d526438bfd881280 Mon Sep 17 00:00:00 2001 From: vivek Date: Sat, 20 Jan 2018 13:21:05 -0800 Subject: [PATCH] zebra: Install connected routes during VRF change only if interface is up During VRF change handling, the connected route for the interface should be installed only if the interface is up. Otherwise, we end up with duplicate connected routes which can lead to other problems. Signed-off-by: Vivek Venkatraman Reviewed-by: Don Slice Ticket: CM-19364 Reviewed By: CCR-7099 Testing Done: Manual verification --- zebra/interface.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zebra/interface.c b/zebra/interface.c index 906f796136..07570e64bf 100644 --- a/zebra/interface.c +++ b/zebra/interface.c @@ -768,7 +768,8 @@ void if_handle_vrf_change(struct interface *ifp, vrf_id_t vrf_id) zebra_interface_vrf_update_add(ifp, old_vrf_id); /* Install connected routes (in new VRF). */ - if_install_connected(ifp); + if (if_is_operative(ifp)) + if_install_connected(ifp); static_ifindex_update(ifp, true);