]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra: Install/Update success caused flags to be cleared for lsp 1458/head
authorDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 16 Nov 2017 19:06:10 +0000 (14:06 -0500)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 16 Nov 2017 19:08:42 +0000 (14:08 -0500)
When the kernel installs/updates a lsp the return code for
success is a 0.  The code was interpreting the 0 as a failure
case for the Install/Update code paths.  This caused upon
a true deletion zebra loosing knowledge of the lsp
but the kernel still had it installed.

Failure:
mpls label bind 10.50.4.11/32 4444
!
line vty
!
end
robot.cumulusnetworks.com# conf t
robot.cumulusnetworks.com(config)# no mpls lsp 6666 10.50.11.1 3933
robot.cumulusnetworks.com(config)# exit
robot.cumulusnetworks.com# show mpls table 6666
robot.cumulusnetworks.com# exit
sharpd@robot ~/frr4> ip -f mpls route show
6666 as to 3933 via inet 10.50.11.1 dev enp0s10 proto static

With Fix:
sharpd@robot ~/frr4> ip -f mpls route show
6666 as to 3933 via inet 10.50.11.1 dev enp0s10 proto static
sharpd@robot ~/frr4> sudo vtysh

Hello, this is FRRouting (version 3.1-dev).
Copyright 1996-2005 Kunihiro Ishiguro, et al.

robot.cumulusnetworks.com# conf t
robot.cumulusnetworks.com(config)# no mpls lsp 6666 10.50.11.1 3933
robot.cumulusnetworks.com(config)# end
robot.cumulusnetworks.com# show mpls table 6666
robot.cumulusnetworks.com# exit
sharpd@robot ~/frr4> ip -f mpls route show
sharpd@robot ~/frr4>

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
zebra/zebra_mpls.c

index 6e7e52183152577165bb5b2c3bd11c2ab8e02897..320176ba3a97f97942cd1dd041b8d10376721d0e 100644 (file)
@@ -909,33 +909,39 @@ static wq_item_status lsp_process(struct work_queue *wq, void *data)
 
                        if (!ret)
                                SET_FLAG(lsp->flags, LSP_FLAG_INSTALLED);
+                       else
+                               clear_nhlfe_installed(lsp);
 
                        zvrf->lsp_installs++;
                }
        } else {
                /* Installed, may need an update and/or delete. */
                if (!newbest) {
+
                        ret = kernel_del_lsp(lsp);
 
-                       if (!ret)
+                       if (!ret) {
                                UNSET_FLAG(lsp->flags, LSP_FLAG_INSTALLED);
+                               clear_nhlfe_installed(lsp);
+                       }
+
                        zvrf->lsp_removals++;
                } else if (CHECK_FLAG(lsp->flags, LSP_FLAG_CHANGED)) {
 
                        UNSET_FLAG(lsp->flags, LSP_FLAG_CHANGED);
                        UNSET_FLAG(lsp->flags, LSP_FLAG_INSTALLED);
+
                        ret = kernel_upd_lsp(lsp);
 
                        if (!ret)
                                SET_FLAG(lsp->flags, LSP_FLAG_INSTALLED);
+                       else
+                               clear_nhlfe_installed(lsp);
 
                        zvrf->lsp_installs++;
                }
        }
 
-       if (!ret)
-               clear_nhlfe_installed(lsp);
-
        return WQ_SUCCESS;
 }