diff options
-rw-r--r-- | MAINTAINERS | 5 | ||||
-rw-r--r-- | src/vnet/udp/udp.c | 15 |
2 files changed, 14 insertions, 6 deletions
diff --git a/MAINTAINERS b/MAINTAINERS index 54e9a63a5bd..4bcd82ee0dd 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -199,6 +199,11 @@ I: tcp M: Florin Coras <fcoras@cisco.com> F: src/vnet/tcp +VNET UDP +I: udp +M: Florin Coras <fcoras@cisco.com> +F: src/vnet/udp + VNET VXLAN I: vxlan M: John Lo <loj@cisco.com> diff --git a/src/vnet/udp/udp.c b/src/vnet/udp/udp.c index 1fb7a507544..fafe8900242 100644 --- a/src/vnet/udp/udp.c +++ b/src/vnet/udp/udp.c @@ -357,9 +357,10 @@ udpc_connection_open (transport_endpoint_cfg_t * rmt) u32 thread_index = vlib_num_workers ()? 1 : vlib_get_main ()->thread_index; u32 uc_index; uc_index = udp_open_connection (rmt); + if (uc_index == (u32) ~ 0) + return -1; uc = udp_connection_get (uc_index, thread_index); - if (uc) - uc->is_connected = 1; + uc->is_connected = 1; return uc_index; } @@ -367,11 +368,13 @@ u32 udpc_connection_listen (u32 session_index, transport_endpoint_t * lcl) { udp_connection_t *listener; - u32 li; - li = udp_session_bind (session_index, lcl); - listener = udp_listener_get (li); + u32 li_index; + li_index = udp_session_bind (session_index, lcl); + if (li_index == (u32) ~ 0) + return -1; + listener = udp_listener_get (li_index); listener->is_connected = 1; - return li; + return li_index; } /* *INDENT-OFF* */ |