From nobody Fri Dec 10 10:39:27 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 99C2118D66DF; Fri, 10 Dec 2021 10:39:27 +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 4J9S7z2Jq4z3ClB; Fri, 10 Dec 2021 10:39:27 +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 30B7218EB3; Fri, 10 Dec 2021 10:39:27 +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 1BAAdRPs006015; Fri, 10 Dec 2021 10:39:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BAAdRqS006014; Fri, 10 Dec 2021 10:39:27 GMT (envelope-from git) Date: Fri, 10 Dec 2021 10:39:27 GMT Message-Id: <202112101039.1BAAdRqS006014@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 4bf3c8ea0d10 - stable/13 - libc sctp: improve conformance of sctp_getpaddrs() 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 4bf3c8ea0d107e24c62a96cd5e88c188c629d19b Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1639132767; 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=xT1EhB5Db58yo1YzQ9LUEVQfeL/eprWHjYsJB6ZzoJE=; b=Cdah1mZZhXOiBxpVT+X2EbkPnByQ4xYPEwill6ezdApra/aaxgwx7iTeHVcqRVSbzNkGy2 8qP8P41V6p1NKncqLiYeQYlx+ZNnNPGCbGaXlqI/uNlNmJ6te5alkd8OpyFEOSpdlHGCN+ M13L9d+y1ei1+QyrGQ/B07VQiaCTYam0KQf9p3JDFy784SDaSH3h8ArbXBYHxrF1shIuHF H2DbeemEcA0vpBRa+kpk/iRlcEaPGAskvy4hV2GZRgVBRiqInF6Pe9TFEGnyxRHWab1ceE YqrZ1pY7IBuG0LLhlJj31HOetrXHMwbtcM05GUpYyCumo99Z5z/sVafRsAgjqA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1639132767; a=rsa-sha256; cv=none; b=dvUSSC6ytayUHceCaasU2EafykLSxHNs1WeRN+WIusGOzETYJKf/lni1tpEKqC+ywN0Ajf CCCjGI+4ew59/AzYRIDV2BpJyulVijAGW0nFZ0rNdBxtmxzgwwoKqgSPxbRk+Z7ztlAu0G iVk9EZ1u27sqlMAMxUsISe90jN7rXcK5pFzbOFkR7RpZZITV1Tdi781Tqvqhluhs2y0xWn xQfNZg3A3WmP9/uC8CqhCcmDhKVCEq08DDOfnIgzLb1edwqEchUSvoABUYZlkNW25t/ois hhayLsXmoEvBNXYKhkMChfE3bDTQFnZdvzaYQ2iWRKmz1uMlFB4WVt9BMPBCEA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=4bf3c8ea0d107e24c62a96cd5e88c188c629d19b commit 4bf3c8ea0d107e24c62a96cd5e88c188c629d19b Author: Michael Tuexen AuthorDate: 2021-12-01 18:47:50 +0000 Commit: Michael Tuexen CommitDate: 2021-12-10 10:39:15 +0000 libc sctp: improve conformance of sctp_getpaddrs() When there is no association, don't return -1 and indicate ENOENT, but return 0 instead. This is specified in RFC 6458. PR: 260117 MFC after: 1 week (cherry picked from commit 83a103ec429a6dd862a73857ebeeff863a41a34d) --- lib/libc/net/sctp_sys_calls.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/libc/net/sctp_sys_calls.c b/lib/libc/net/sctp_sys_calls.c index 615b14ede5aa..7c3652ff5d3c 100644 --- a/lib/libc/net/sctp_sys_calls.c +++ b/lib/libc/net/sctp_sys_calls.c @@ -405,7 +405,11 @@ sctp_getpaddrs(int sd, sctp_assoc_t id, struct sockaddr **raddrs) opt_len = (socklen_t)sizeof(uint32_t); if (getsockopt(sd, IPPROTO_SCTP, SCTP_GET_REMOTE_ADDR_SIZE, &size_of_addresses, &opt_len) != 0) { - return (-1); + if (errno == ENOENT) { + return (0); + } else { + return (-1); + } } opt_len = (socklen_t)((size_t)size_of_addresses + sizeof(struct sctp_getaddresses)); addrs = calloc(1, (size_t)opt_len);