From nobody Wed Dec 01 19:14:41 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 4043418BE4F3; Wed, 1 Dec 2021 19:14:42 +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 4J480d5FrTz3qh0; Wed, 1 Dec 2021 19:14:41 +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 948027800; Wed, 1 Dec 2021 19:14:41 +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 1B1JEfBV087866; Wed, 1 Dec 2021 19:14:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1B1JEfc3087865; Wed, 1 Dec 2021 19:14:41 GMT (envelope-from git) Date: Wed, 1 Dec 2021 19:14:41 GMT Message-Id: <202112011914.1B1JEfc3087865@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: 83a103ec429a - main - 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/main X-Git-Reftype: branch X-Git-Commit: 83a103ec429a6dd862a73857ebeeff863a41a34d Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638386081; 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=Hj6oAO8pkaL/naNqz7jwbrdv5TIlKyLXd6U8CZ2hHLY=; b=c1Mm98UDZi2O0tHha5ZXoqL6Bc8yRKW1Q7Owrs7j8IhcUzIUkhFTXVud5Yz5Jn76PR45WQ xGLaAz68Qlmo7y9ig4+XZtAYtP66xsskuQ6sK5hLbXYxelPKqGuEhp1Yooa3r/Sv2rgM43 j7tBQfWHhLzvnk9o/O+I8IAkyzvadkN7bHBn/G6Uim49TVdZiS9nKLt14HiOVvXkwE8fgF /h5ng8bkLwPoJBnfn7xmM4PrAEU95QK6n20ywKgsBsoOF5+lb/EgfXrWz4YXDDKWTHm0C5 +eDYCwxAYSKRUFz3/S7EgPxQ+oHcZAfhBLd1Qr/eRlwwp1Lsdo4xMh6Qs1vTSw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638386081; a=rsa-sha256; cv=none; b=Hw/imGwqtycDe6TgDScd/Dho+LgXy5qIzBpvkvXx7xgBgq37iNucB/ClFG3q9UXaxxKC+c o3R4uULKEb25GX7XsB9Mwz1IocAOdHkbX7skrOzaq5D++jLa5YmWQD/blaEm5doapUjbMG 8hdIEp8CkGGhiydtiKIxoxDc5AQVkv/96sIXUeEdtSxc2KBqwgXUPaNHzhoL8grgtm2wVw ww6gmLo1zAQ1gYPyegp1jNvd4iSRxDITjo1AFYEwgxIIP/BGSQKQ75vq+c8vrEhPv3Dz2U eQ7Ghwzcz23C6JluE12na+yB3f/93VnzSSIEBTa293jLMQCiGSE4Wy5y/310mA== 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=83a103ec429a6dd862a73857ebeeff863a41a34d commit 83a103ec429a6dd862a73857ebeeff863a41a34d Author: Michael Tuexen AuthorDate: 2021-12-01 18:47:50 +0000 Commit: Michael Tuexen CommitDate: 2021-12-01 18:50:26 +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 --- 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);