From cc00608f208258ecce9f7502a6ceca86f095076b Mon Sep 17 00:00:00 2001 From: Jordan Augé Date: Fri, 7 Oct 2022 08:46:31 +0200 Subject: fix(libhicnctrl): connections created without interface conflict with existing listeners MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Idc891221b2cd149a4a5decc45c2e84da74b832df Ticket: HICN-804 Signed-off-by: Jordan Augé --- ctrl/libhicnctrl/src/objects/listener.c | 6 ++++-- 1 file 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; -- cgit 1.2.3-korg