The transport layer's functional interface foresees having error codes
percolate back up to the caller.  However, up until now, the udp6 module
simply returned -1 for any error.  This patch lets the code return the
specific error instead.

Signed-off-by: Richard Cochran <richardcoch...@gmail.com>
---
 udp6.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/udp6.c b/udp6.c
index 6cb571b..744a5bc 100644
--- a/udp6.c
+++ b/udp6.c
@@ -271,7 +271,7 @@ static int udp6_send(struct transport *t, struct fdarray 
*fda,
        cnt = sendto(fd, buf, len, 0, &addr->sa, sizeof(addr->sin6));
        if (cnt < 1) {
                pr_err("sendto failed: %m");
-               return cnt;
+               return -errno;
        }
        /*
         * Get the time stamp right away.
-- 
2.20.1



_______________________________________________
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

Reply via email to