]>
git.proxmox.com Git - mirror_frr.git/blob - zebra/zebra_mpls_netlink.c
3 #include "zebra/rt_netlink.h"
4 #include "zebra/zebra_mpls.h"
7 * Install Label Forwarding entry into the kernel.
10 kernel_add_lsp (zebra_lsp_t
*lsp
)
14 if (!lsp
|| !lsp
->best_nhlfe
) // unexpected
17 UNSET_FLAG (lsp
->flags
, LSP_FLAG_CHANGED
);
18 ret
= netlink_mpls_multipath (RTM_NEWROUTE
, lsp
);
20 SET_FLAG (lsp
->flags
, LSP_FLAG_INSTALLED
);
22 clear_nhlfe_installed (lsp
);
28 * Update Label Forwarding entry in the kernel. This means that the Label
29 * forwarding entry is already installed and needs an update - either a new
30 * path is to be added, an installed path has changed (e.g., outgoing label)
31 * or an installed path (but not all paths) has to be removed.
32 * TODO: Performs a DEL followed by ADD now, need to change to REPLACE. Note
33 * that REPLACE was originally implemented for IPv4 nexthops but removed as
34 * it was not functioning when moving from swap to PHP as that was signaled
35 * through the metric field (before kernel-MPLS). This shouldn't be an issue
36 * any longer, so REPLACE can be reintroduced.
39 kernel_upd_lsp (zebra_lsp_t
*lsp
)
43 if (!lsp
|| !lsp
->best_nhlfe
) // unexpected
46 UNSET_FLAG (lsp
->flags
, LSP_FLAG_CHANGED
);
48 /* First issue a DEL and clear the installed flag. */
49 netlink_mpls_multipath (RTM_DELROUTE
, lsp
);
50 UNSET_FLAG (lsp
->flags
, LSP_FLAG_INSTALLED
);
52 /* Then issue an ADD. */
53 ret
= netlink_mpls_multipath (RTM_NEWROUTE
, lsp
);
55 SET_FLAG (lsp
->flags
, LSP_FLAG_INSTALLED
);
57 clear_nhlfe_installed (lsp
);
63 * Delete Label Forwarding entry from the kernel.
66 kernel_del_lsp (zebra_lsp_t
*lsp
)
68 if (!lsp
) // unexpected
71 if (CHECK_FLAG (lsp
->flags
, LSP_FLAG_INSTALLED
))
73 netlink_mpls_multipath (RTM_DELROUTE
, lsp
);
74 UNSET_FLAG (lsp
->flags
, LSP_FLAG_INSTALLED
);
80 void mpls_kernel_init (void) {};