From e786b6015e51953fde6404cfa18a4e879a8d7cac Mon Sep 17 00:00:00 2001 From: vivek Date: Mon, 22 Feb 2016 05:33:46 +0000 Subject: [PATCH] Zebra: Fix ignoring status for VRF device The earlier change to ignore status for VRF device was not quite perfect. As defect CM-9437 illustrates, there are situations when Quagga may get a VRF member interface (that refers to the VRF id of the VRF device) before it gets the VRF device itself. The code has some logic to handle this, creating a VRF structure which is partly initialized. The initialization is completed with some additional incorrect status processing when the VRF is learnt. The fix done earlier completely ignored the VRF message treating it as a status change because the VRF is already present, but this left the VRF structure not fully initialized in Quagga. The fix is to do some additional checks to handle this scenario. Fixes: 3e66be2ee6db028d808a304586e0b24d5374914e Ticket: CM-9437 Reviewed By: None Testing Done: Reproduced problem, verified fix. --- zebra/rt_netlink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c index d3ee6005c1..e2809fd595 100644 --- a/zebra/rt_netlink.c +++ b/zebra/rt_netlink.c @@ -545,7 +545,7 @@ netlink_vrf_change (struct nlmsghdr *h, struct rtattr *tb, const char *name) * TODO: Status changes will be handled against the VRF "interface". */ vrf = vrf_lookup ((vrf_id_t)ifi->ifi_index); - if (vrf) + if (vrf && vrf->info) { if (IS_ZEBRA_DEBUG_KERNEL) zlog_debug ("%s: RTM_NEWLINK status for VRF(%s) index %u - ignored", -- 2.39.5