From 78cba0aa6d51f9754cca59d3ddc31ba5e7286533 Mon Sep 17 00:00:00 2001 From: Jordan Augé Date: Wed, 15 Jan 2020 09:23:24 +0100 Subject: [HICN-467] Priority settings on interfaces yet to be created should be cached for further application MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I715f908587838b47b0491880391d875044e03293 Signed-off-by: Jordan Augé --- ctrl/facemgr/src/api.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 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; -- cgit 1.2.3-korg