From nobody Wed Dec 01 10:16:34 2021 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 8D3E018BE7E8; Wed, 1 Dec 2021 10:16:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J3w3k2HFVz4Whq; Wed, 1 Dec 2021 10:16:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2A69D279E6; Wed, 1 Dec 2021 10:16:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1B1AGYLc067119; Wed, 1 Dec 2021 10:16:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1B1AGYUY067118; Wed, 1 Dec 2021 10:16:34 GMT (envelope-from git) Date: Wed, 1 Dec 2021 10:16:34 GMT Message-Id: <202112011016.1B1AGYUY067118@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 6e9309bd3b04 - main - libc sctp: improve error reporting of sctp_getladdrs() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6e9309bd3b04501b69593900a14e01114c7f2404 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638353794; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=up+G0k2K8pe+ClnS5yTtaUbumpuSlZX0gB74TnxfteI=; b=aipGHyO7V8BPpaYM+Ir6SLOLhdvrQnskfsQZh8pJME8prJMLuDcGc5EZAVE3fNswJFzpgh rxK9qu7TYxWS9LAcMrD1ggc/fNlSPU9VaQyyn6GVu3ZNxHth/uC8vw4bisNcV020ZU6G7B 80dd8BIi0dmMiuASqHHz/1MTP5ndciTlo/i0yRnoNEvkHr+/13ezLEQtK+0ysvKk4vwW0D EikczEoQ3UEsznTwOlARZQrJjkWw1QcQV3BS1gLNNzNwJd/EN6shxXpyW9rqYONpqmTtGf vFMqNfB9bVl3Ea0vBR5YmFCSbO8YyyPXD19w48gm44EYNQOsPMzQf5D2MnSrkQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638353794; a=rsa-sha256; cv=none; b=ceZD4KTMTpv7BWJH+7cfyUd+Arz12uViUdVNDuUaCZIdywpWNqSLPF2mLo1PuERNLTlXgP CgMFQdv+5ADVqdbPGZPKcGFNaJF5k9ewp0rkklw+Wzfi0P7jl5PjVcc2lYuTGZp+7aI3AP 05SDoWxm9iexdBpkzEOPvggsCH/YNNP/KCmB2wiw/v+I0TkBqw5GLBYO4246pFjx053Ztg m/64EVxyjIayJ5ikZ9Rty+n27lLL0F72Upt9vvQLcy8JVTAcu8f2k7zX+pk156LT1Pqc7b qE7Yzz4QqpO3P0fEXmE+in/GYe5+hIi6dM095fWW6ETS/YuXM5FqwwkifjGFAQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=6e9309bd3b04501b69593900a14e01114c7f2404 commit 6e9309bd3b04501b69593900a14e01114c7f2404 Author: Michael Tuexen AuthorDate: 2021-12-01 10:14:36 +0000 Commit: Michael Tuexen 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;