diff options
author | Alberto Compagno <acompagn+fdio@cisco.com> | 2019-12-11 14:30:43 +0000 |
---|---|---|
committer | Alberto Compagno <acompagn+fdio@cisco.com> | 2019-12-11 14:30:43 +0000 |
commit | 51c3dac4682050a5d169d858114cfdc58b813431 (patch) | |
tree | f6fc66d1fbc90c1a779052d424102fecf474e21b /hicn-plugin/src | |
parent | 7631d5c804f61e618deb9e48ecb2458c77d36577 (diff) |
[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 <acompagn+fdio@cisco.com>
Change-Id: I8e7b5eee6c492367f663b2b97d50b6ca166b4824
Diffstat (limited to 'hicn-plugin/src')
-rw-r--r-- | hicn-plugin/src/faces/udp/face_udp.c | 12 |
1 files changed, 4 insertions, 8 deletions
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; |