summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJordan Augé <jordan.auge+fdio@cisco.com>2021-01-19 09:40:15 +0100
committerJordan Augé <jordan.auge+fdio@cisco.com>2021-01-19 09:40:15 +0100
commit3723df3455e88e8534041d1a29b12e8d4a72bb98 (patch)
tree2918789b05fe78a21d936254a3ed8bc2bcd5163a
parentf576bb657068397d7b536acd4199572e24afc613 (diff)
[HICN-675] Handle invalid face polled from hicn-light in facemgr
Change-Id: Icf2868033d98f6bbd091418c3632dab733621894 Signed-off-by: Jordan Augé <jordan.auge+fdio@cisco.com>
-rw-r--r--ctrl/facemgr/src/facelet.c6
-rw-r--r--ctrl/facemgr/src/interfaces/hicn_light/hicn_light.c5
2 files changed, 9 insertions, 2 deletions
diff --git a/ctrl/facemgr/src/facelet.c b/ctrl/facemgr/src/facelet.c
index 0cf44d4dc..9e9f3f67f 100644
--- a/ctrl/facemgr/src/facelet.c
+++ b/ctrl/facemgr/src/facelet.c
@@ -356,8 +356,10 @@ facelet_create_from_face(face_t * face)
facelet->error = 0;
/* TODO Consistency check between face type and found attributes */
- if (facelet_validate_face(facelet) < 0)
+ if (facelet_validate_face(facelet) < 0) {
+ ERROR("[facelet_create_from_face] Cannot validate face");
goto ERR_FACE;
+ }
facelet->bj_done = false;
facelet->au_done = false;
@@ -367,7 +369,7 @@ facelet_create_from_face(face_t * face)
/* We need to get route set */
facelet->routes = route_set_create();
if (!facelet->routes) {
- ERROR("[facelet_create] Cannot create route set");
+ ERROR("[facelet_create_from_face] Cannot create route set");
goto ERR_ROUTE_SET;
}
facelet->routes_done = false;
diff --git a/ctrl/facemgr/src/interfaces/hicn_light/hicn_light.c b/ctrl/facemgr/src/interfaces/hicn_light/hicn_light.c
index 508c0713b..74a0cd62b 100644
--- a/ctrl/facemgr/src/interfaces/hicn_light/hicn_light.c
+++ b/ctrl/facemgr/src/interfaces/hicn_light/hicn_light.c
@@ -642,6 +642,11 @@ int hl_callback(interface_t * interface, int fd, void * unused)
/* We can ignore faces on localhost */
facelet_t * facelet = facelet_create_from_face(&f->face);
+ if (!facelet) {
+ ERROR("[hl_callback] Could not create facelet... skipping");
+ continue;
+ }
+
foreach_route(r, data->polled_routes) {
if (r->face_id != f->id)
continue;