From nobody Fri May 10 02:09:48 2024 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 4VbC4r62XYz5KYL4; Fri, 10 May 2024 02:09:48 +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 4VbC4r5X11z4QnX; Fri, 10 May 2024 02:09:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715306988; 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=+rulnx6Se60wshkxEWpi7T42a2D0RhXZF4PYfEQexPY=; b=bxkWRYZjemqvJZ4cWNURbllgrQS/+vfOINkQIaCLtWQG+Sk+SkVnGsEoGCZeifDZnr3E0P WCcPmaGwtGsLNTpMWYhHjzZCNc8vJhDXv/nEH+FX7RtgSOBN+zs4Njvy7fAnrP+7EDdRZS 3JiaTMMlcLd7uJK3CMS8O+9Saxa4brK/Tfg5I4HIxP2ZPXERDqVcslijEVDp+NYSpib95H DaokHRQc/2QXh41PFe+Mu+AsiU6JvNiXyjt5ec7Ot3VEcrw32d4xBo4k+S95JTh+KOP6D6 JI8yHBg+lTgHbqQjVRdbKzJ4KsynCzzYTAqu70dtlZz3QNqHYHRzQRkEZKjI5Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715306988; a=rsa-sha256; cv=none; b=UoETVFa9HJiQ1lbSOPwjdomJrFwgly9kcU5ms8Op9Y346Sm8GWJ2lJ1q1z7cM4an0CACIX YshKHje8jEISDeuNDeIogB5/qWI1ElHtkg8y2DXU+7su/0QY7JrCv7dDgtG/Ww9R2GkeDg kPupwDOs0eoB8PLkyciotYcW6/IjUs/QDr14rix1Fz3ZPmHRr+7GIHFJi+CvCzjZlfnV6I NzXr7nGlVbhpawH74Gp/U5BQ1+cQdHwtIQFJQG1nEboencscqhDGxIlfkgKhnxebtw/wn8 kWWbf9IU9sy2wHr8pM3XKwMl+eO3c2QAp2RTDryjqtYS+u/XHz7oofoy4ITgKw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715306988; 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=+rulnx6Se60wshkxEWpi7T42a2D0RhXZF4PYfEQexPY=; b=bYDURaqNSSAitaK7m8dbG11p2EDh7QXFtIVqsaXo7wjYRchTKlv9WUet+uNf2QzBtOd5YQ dxKX8/HyjETEyD9IInpsRgLPkscFTGB0nnxb5O5jQAvhABZr25ZGsZ0JpyrPGeA4b2Bqqa P2ONK/SrumcQZ7NQeW9q+l4rcDd57Nbdh/nW4V8QbQwzPBjaGSnmseARfDi8APEVm/ql0L V5JH9KF67rA0cRy3X5h7trQY74s7s7MyWxMNE9oMnE+j0itZzjMzo4irtlbLx8rEnUp2PR 8aTWmDKfRWH0hMmeuxxTJVYYDNlYydp0HCtIgWhhxSYBwa8AmTyBTBPdcWIeQg== 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 4VbC4r4t36zHrP; Fri, 10 May 2024 02:09:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44A29mC4035960; Fri, 10 May 2024 02:09:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44A29mZ4035957; Fri, 10 May 2024 02:09:48 GMT (envelope-from git) Date: Fri, 10 May 2024 02:09:48 GMT Message-Id: <202405100209.44A29mZ4035957@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 09025a714708 - main - ipfw: correctly report table manipulation errors 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 09025a7147084783bf1dd4d1bec463ceab8d16b4 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=09025a7147084783bf1dd4d1bec463ceab8d16b4 commit 09025a7147084783bf1dd4d1bec463ceab8d16b4 Author: Ben Wilber AuthorDate: 2024-05-10 02:08:15 +0000 Commit: Warner Losh CommitDate: 2024-05-10 02:08:18 +0000 ipfw: correctly report table manipulation errors Let ipfw(8) report the actual error instead of the error that may have come from calling printf(). Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1221 --- sbin/ipfw/tables.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sbin/ipfw/tables.c b/sbin/ipfw/tables.c index 7901950acadd..4c783e02f856 100644 --- a/sbin/ipfw/tables.c +++ b/sbin/ipfw/tables.c @@ -1037,6 +1037,9 @@ table_modify_record(ipfw_obj_header *oh, int ac, char *av[], int add, } } + /* Get real OS error */ + error = errno; + /* Report results back */ ptent = tent_buf; for (i = 0; i < count; ptent++, i++) { @@ -1089,8 +1092,6 @@ table_modify_record(ipfw_obj_header *oh, int ac, char *av[], int add, if (error == 0) return; - /* Get real OS error */ - error = errno; /* Try to provide more human-readable error */ switch (error) {