From bdc04d5a8af426b125995b66f380bf1aae169f16 Mon Sep 17 00:00:00 2001 From: Bogdan Pricope Date: Sun, 17 May 2020 12:03:03 +0300 Subject: [PATCH] udp: fix ofp_send/ofp_sendto return value on success On UDP side, remaining bytes to process were not updated. This commit fixes issue #250. Signed-off-by: Bogdan Pricope Reviewed-by: Matias Elo --- src/ofp_uipc_socket.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ofp_uipc_socket.c b/src/ofp_uipc_socket.c index d284dcf2..9e8cf348 100644 --- a/src/ofp_uipc_socket.c +++ b/src/ofp_uipc_socket.c @@ -1051,6 +1051,8 @@ ofp_sosend_dgram(struct socket *so, struct ofp_sockaddr *addr, struct uio *uio, clen = 0; control = ODP_PACKET_INVALID; top = ODP_PACKET_INVALID; + if (!error && uio) + uio->uio_resid = resid; out: if (top != ODP_PACKET_INVALID) odp_packet_free(top);