From 51c3dac4682050a5d169d858114cfdc58b813431 Mon Sep 17 00:00:00 2001 From: Alberto Compagno Date: Wed, 11 Dec 2019 14:30:43 +0000 Subject: [HICN-447] Converting incomplete udp face into a complete one When inserting a udp face through cli or binary api, if an incomplete udp face already exist with the same local and remote addresses and port, the face is converted into a complete face Signed-off-by: Alberto Compagno Change-Id: I8e7b5eee6c492367f663b2b97d50b6ca166b4824 --- hicn-plugin/src/faces/udp/face_udp.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'hicn-plugin') diff --git a/hicn-plugin/src/faces/udp/face_udp.c b/hicn-plugin/src/faces/udp/face_udp.c index 6a8e5c9e0..54d773358 100644 --- a/hicn-plugin/src/faces/udp/face_udp.c +++ b/hicn-plugin/src/faces/udp/face_udp.c @@ -159,10 +159,8 @@ hicn_face_udp_add (const ip46_address_t * local_addr, hicn_face_udp4_get (&local_addr->ip4, &remote_addr->ip4, local_port, remote_port); - if (face != NULL) - return HICN_ERROR_FACE_ALREADY_CREATED; - - pool_get (hicn_dpoi_face_pool, face); + if (face == NULL) + pool_get (hicn_dpoi_face_pool, face); hicn_face_udp_t *udp_face = (hicn_face_udp_t *) face->data; @@ -225,10 +223,8 @@ hicn_face_udp_add (const ip46_address_t * local_addr, hicn_face_udp6_get (&local_addr->ip6, &remote_addr->ip6, local_port, remote_port); - if (face != NULL) - return HICN_ERROR_FACE_ALREADY_CREATED; - - pool_get (hicn_dpoi_face_pool, face); + if (face == NULL) + pool_get (hicn_dpoi_face_pool, face); hicn_face_udp_t *udp_face = (hicn_face_udp_t *) face->data; -- cgit 1.2.3-korg