diff options
author | Jordan Augé <jordan.auge+fdio@cisco.com> | 2020-01-15 09:23:24 +0100 |
---|---|---|
committer | Jordan Augé <jordan.auge+fdio@cisco.com> | 2020-01-15 09:23:24 +0100 |
commit | 78cba0aa6d51f9754cca59d3ddc31ba5e7286533 (patch) | |
tree | 1bee793c022d1aba27a64b042c3ee4da9b86f97f /ctrl/facemgr | |
parent | def98b1a2af5292519b18893133e419e940a850b (diff) |
[HICN-467] Priority settings on interfaces yet to be created should be cached for further application
Change-Id: I715f908587838b47b0491880391d875044e03293
Signed-off-by: Jordan Augé <jordan.auge+fdio@cisco.com>
Diffstat (limited to 'ctrl/facemgr')
-rw-r--r-- | ctrl/facemgr/src/api.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/ctrl/facemgr/src/api.c b/ctrl/facemgr/src/api.c index ddda26338..a6f8dbc84 100644 --- a/ctrl/facemgr/src/api.c +++ b/ctrl/facemgr/src/api.c @@ -1991,6 +1991,24 @@ facemgr_on_event(facemgr_t * facemgr, facelet_t * facelet_in) case FACELET_EVENT_UPDATE: DEBUG("[facemgr_on_event] UPDATE EXISTING %s", facelet_old_s); DEBUG(" WITH %s", facelet_s); + +#ifdef WITH_DEFAULT_PRIORITIES + if (facelet_has_netdevice_type(facelet_in) && !facelet_has_netdevice(facelet_in) && facelet_has_priority(facelet_in)) { + /* Remember last priority choice for newly created facelets */ + netdevice_type_t netdevice_type = NETDEVICE_TYPE_UNDEFINED; + u32 priority = 0; + if (facelet_get_netdevice_type(facelet_in, &netdevice_type) < 0) { + ERROR("[facelet_on_event] Error getting netdevice_type"); + goto ERR; + } + if (facelet_get_priority(facelet_in, &priority) < 0) { + ERROR("[facelet_on_event] Error getting priority"); + goto ERR; + } + facemgr->default_priority[netdevice_type] = priority; + } +#endif /* WITH_DEFAULT_PRIORITIES */ + if (facelet_merge(facelet, facelet_in) < 0) { ERROR("[facemgr_on_event] Error merging facelets"); continue; |