Commit 6e9309bd authored by Michael Tuexen's avatar Michael Tuexen
Browse files

libc sctp: improve error reporting of sctp_getladdrs()

Do not hide errno from getsockopt() called internally.

MFC after:	1 week
parent dabd8bf9
......@@ -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;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment