summaryrefslogtreecommitdiffstats
path: root/ctrl/libhicnctrl/src/api.c
diff options
context:
space:
mode:
Diffstat (limited to 'ctrl/libhicnctrl/src/api.c')
-rw-r--r--ctrl/libhicnctrl/src/api.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/ctrl/libhicnctrl/src/api.c b/ctrl/libhicnctrl/src/api.c
index 4156ceff9..472e07bc4 100644
--- a/ctrl/libhicnctrl/src/api.c
+++ b/ctrl/libhicnctrl/src/api.c
@@ -689,7 +689,12 @@ int hc_route_validate(const hc_route_t *route) {
ERROR("[hc_route_validate] Invalid connection id");
return -1;
}
- if (!IS_VALID_NAME(route->name) && !IS_VALID_STR_ID(route->name)) {
+ if (route->name[0] == '\0') {
+ if (!IS_VALID_FACE_ID(route->face_id)) {
+ ERROR("[hc_route_validate] Invalid face_id");
+ return -1;
+ }
+ } else if (!IS_VALID_NAME(route->name) && !IS_VALID_STR_ID(route->name)) {
ERROR("[hc_route_validate] Invalid name specified");
return -1;
}