From nobody Wed Mar 02 21:57:31 2022 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 B2F1419E0CAD; Wed, 2 Mar 2022 21:57: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 4K87JX1m72z3KXh; Wed, 2 Mar 2022 21:57:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1646258253; 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=Ogkovll0DdOUxU1DwgIxWQ4bjpwhHuHd5+CJnThcztM=; b=LlOaSCcatkfUI0cKfYTdZCdxn00GW3KIBHHebQNlFALEKltyUHb568UoRM7AvBgV31yyr1 QB8WxMkwThpKfPgN6SpCTwhEXcuIrOmXV+RYYJ8PP6d8VFZqmTMDIu86jpcWRrYmwPuFf6 SFyCFMLs6agWKKW25nmXQS0ob18L4o3X+j1FtIzOfG4Vk0V2XWt6vrkjcKcmLXaVUwgilz jegoF3/vw3hiS7zJ6LKtBGByz9TpTHp+HSP56iD7AttFwS3EVKPQaEfTOas7w4iRwDwXTH lOJRu2gjLq0XFf0CiIcxqnMExgwpBBWEGliSIeUVrjp2vJYWHF0nFYAy3xzsGg== 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 C77B03A8D; Wed, 2 Mar 2022 21:57:31 +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 222LvVts065342; Wed, 2 Mar 2022 21:57:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 222LvVGY065341; Wed, 2 Mar 2022 21:57:31 GMT (envelope-from git) Date: Wed, 2 Mar 2022 21:57:31 GMT Message-Id: <202203022157.222LvVGY065341@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eric van Gyzen Subject: git: b43916e2300a - stable/13 - rtsold: Use correct error in llflags_get() 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: vangyzen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b43916e2300af65350d874481d15521a0458ef6a Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1646258253; 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=Ogkovll0DdOUxU1DwgIxWQ4bjpwhHuHd5+CJnThcztM=; b=w26Z3spQ8sG1Mb0ZLCvlNXpwNEs4ZJkLWsreSbzRxLy4RHls768WT8pkUB0mkgEx224UBm wzM+WnAO1HMNb0EaQhlblEXdWkpz+PLFKlfOUzqJ8BCC+Rwsc2ywLn+CddfbXFHoU9MWsN l7tqPzuKyo1A6hleJp4z2TXh0FZOqRlyGIugoB0p5Ai4U1exORGQaFLnoJstYx6Bf0iS1F QHIlWIDNUsQCWrzPAZ/vuHTvHQlarWI1Do9bJRiyWEEioxD/uXMlFxtIFrO1SeAJ3vmiJS 4Vn3Ye024Am9AwtaPMckNJvOJE3ESaQdz/9Bb1g0bTrYfFYKVAK/FfBYfID1Tw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1646258253; a=rsa-sha256; cv=none; b=hstXQkuK5TZApFMbfqBRGkylYXM4GnkZdNK+gnOGCHb3LwGKwXHLwdl7QiMrT/zFyVu9bj jZ+6EtG/kpJOXzM9SJ5VxzCvV+cmBi5Dzw5dWe52UJ5jD66mEMV5vQSbU2bwjqcZafAzgj GUqNr3k0bRvonNMRTbVPZtTyOq5IgOjJ0ZO+HKkPRcb5fFlYg0AB/Dsll800MxAfkUie67 gthqlYNJ+di4WFMQvTIT98V5XtZ6OzgnLjoly9SQuKddNa4hweaYb2UKz48yTwxKSDj3Iv lRut97u9VIeqD+MGsm+Hs4waM8hrmA/HJnDSOLTbyGTvxq9G0gCxA+PIL7xRXA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by vangyzen: URL: https://cgit.FreeBSD.org/src/commit/?id=b43916e2300af65350d874481d15521a0458ef6a commit b43916e2300af65350d874481d15521a0458ef6a Author: Eric van Gyzen AuthorDate: 2022-02-23 16:29:53 +0000 Commit: Eric van Gyzen CommitDate: 2022-03-02 21:56:31 +0000 rtsold: Use correct error in llflags_get() Set errno to EINVAL if the name overflows the buffer, as was done before commit ecce515d54bc. Reviewed by: dab, markj Fixes: ecce515d54bcea54fea03f731aad646c87761d22 MFC after: 1 week Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D34354 (cherry picked from commit a2a8efb4f6c15ad0880167cb22452e50aaacf52f) --- usr.sbin/rtsold/cap_llflags.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/rtsold/cap_llflags.c b/usr.sbin/rtsold/cap_llflags.c index 195f83893b4d..aea45d9fb8a0 100644 --- a/usr.sbin/rtsold/cap_llflags.c +++ b/usr.sbin/rtsold/cap_llflags.c @@ -91,7 +91,7 @@ llflags_get(const char *ifname, int *flagsp) memset(&ifr6, 0, sizeof(ifr6)); if (strlcpy(ifr6.ifr_name, ifname, sizeof(ifr6.ifr_name)) >= sizeof(ifr6.ifr_name)) { - error = errno; + error = EINVAL; goto out; } memcpy(&ifr6.ifr_ifru.ifru_addr, sin6, sin6->sin6_len);