aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJordan Augé <jordan.auge+fdio@cisco.com>2022-10-07 08:46:31 +0200
committerJordan Augé <jordan.auge+fdio@cisco.com>2022-10-07 08:52:56 +0200
commitcc00608f208258ecce9f7502a6ceca86f095076b (patch)
tree1d97d734303c727fc4d83c0f2b62405122a0f08f
parent7b75353ecccaeb6b8dd79f46593adb0551182a96 (diff)
fix(libhicnctrl): connections created without interface conflict with existing listeners
Change-Id: Idc891221b2cd149a4a5decc45c2e84da74b832df Ticket: HICN-804 Signed-off-by: Jordan Augé <jordan.auge+fdio@cisco.com>
-rw-r--r--ctrl/libhicnctrl/src/objects/listener.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ctrl/libhicnctrl/src/objects/listener.c b/ctrl/libhicnctrl/src/objects/listener.c
index 660a4931d..f7da6bd9c 100644
--- a/ctrl/libhicnctrl/src/objects/listener.c
+++ b/ctrl/libhicnctrl/src/objects/listener.c
@@ -135,8 +135,10 @@ int hc_listener_cmp(const hc_listener_t *l1, const hc_listener_t *l2) {
rc = INT_CMP(l1->family, l2->family);
if (rc != 0) return rc;
- rc = strncmp(l1->interface_name, l2->interface_name, INTERFACE_LEN);
- if (rc != 0) return rc;
+ if (!isempty(l1->interface_name) && !isempty(l2->interface_name)) {
+ rc = strncmp(l1->interface_name, l2->interface_name, INTERFACE_LEN);
+ if (rc != 0) return rc;
+ }
rc = hicn_ip_address_cmp(&l1->local_addr, &l2->local_addr);
if (rc != 0) return rc;