]> git.puffer.fish Git - matthieu/frr.git/commitdiff
Zebra: Fix ignoring status for VRF device
authorvivek <vivek@cumulusnetworks.com>
Mon, 22 Feb 2016 05:33:46 +0000 (05:33 +0000)
committervivek <vivek@cumulusnetworks.com>
Mon, 22 Feb 2016 05:33:46 +0000 (05:33 +0000)
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

index d3ee6005c1c7f75616df3b31a0a8b4ff144d1a71..e2809fd59563b956bc2a30fd67c9cde172330a97 100644 (file)
@@ -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",