Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 1 Dec 2021 10:16:34 GMT
From:      Michael Tuexen <tuexen@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 6e9309bd3b04 - main - libc sctp: improve error reporting of sctp_getladdrs()
Message-ID:  <202112011016.1B1AGYUY067118@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by tuexen:

URL: https://cgit.FreeBSD.org/src/commit/?id=6e9309bd3b04501b69593900a14e01114c7f2404

commit 6e9309bd3b04501b69593900a14e01114c7f2404
Author:     Michael Tuexen <tuexen@FreeBSD.org>
AuthorDate: 2021-12-01 10:14:36 +0000
Commit:     Michael Tuexen <tuexen@FreeBSD.org>
CommitDate: 2021-12-01 10:14:36 +0000

    libc sctp: improve error reporting of sctp_getladdrs()
    
    Do not hide errno from getsockopt() called internally.
    
    MFC after:      1 week
---
 lib/libc/net/sctp_sys_calls.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/lib/libc/net/sctp_sys_calls.c b/lib/libc/net/sctp_sys_calls.c
index 5acb957c3d3f..3249eeaa4c4e 100644
--- a/lib/libc/net/sctp_sys_calls.c
+++ b/lib/libc/net/sctp_sys_calls.c
@@ -460,7 +460,6 @@ sctp_getladdrs(int sd, sctp_assoc_t id, struct sockaddr **raddrs)
 	opt_len = (socklen_t)sizeof(uint32_t);
 	if (getsockopt(sd, IPPROTO_SCTP, SCTP_GET_LOCAL_ADDR_SIZE,
 	    &size_of_addresses, &opt_len) != 0) {
-		errno = ENOMEM;
 		return (-1);
 	}
 	if (size_of_addresses == 0) {
@@ -478,7 +477,6 @@ sctp_getladdrs(int sd, sctp_assoc_t id, struct sockaddr **raddrs)
 	if (getsockopt(sd, IPPROTO_SCTP, SCTP_GET_LOCAL_ADDRESSES, addrs,
 	    &opt_len) != 0) {
 		free(addrs);
-		errno = ENOMEM;
 		return (-1);
 	}
 	*raddrs = &addrs->addr[0].sa;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202112011016.1B1AGYUY067118>