From nobody Tue Jan 14 10:37:47 2025 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 4YXQZ33M4wz5kVqK; Tue, 14 Jan 2025 10:37:47 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YXQZ30xq3z3Bq3; Tue, 14 Jan 2025 10:37:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736851067; 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=bcI+0kl9w5zO98toiuVyXCJA9Pin2oDuACuwm02VTHk=; b=WU+NidOrTJRPiuh2jZMO4aRcP3mwhJdi9BeHCtGXAHv6pgkRzLFC4nt60QHLW/huTAHHO+ IiNpdgLJFUZZYd8JSL03AzCgMH7SJLIx3FGNXqe5jTbiKDdfpfA4cwNTk7QVe7sZF10R5p mE/bcS0l1VnfdZEXCWSfWZOP6vZ1I3iAM0PXv56Nlsve7GuL7IIEjM04pX5TSIF/CFYQii mz2JCiH5DCosnM3Vj9GasHNeMicZv5Q+MB8XJgBHA7WLCqSxKpalSO6ojZ+lCLFfNC0bic qMvGG4WohDJKKUwoItVEpwTNy9S3JRtqgbmBVvzXXKQtcc4m5SN9DxqTRLwZsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736851067; 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=bcI+0kl9w5zO98toiuVyXCJA9Pin2oDuACuwm02VTHk=; b=FXjmh3iJ94xarRHCZXfR7KOtsm3CKIMCTPKN0LpoP5qP+eMrGa82dC9SS8n84z+2JSB8Ds iYS5IarI/xqGVHOlip1NfUcEl9KMtMxQdV+nCxyt4xfIQN9MjZjYSWjq9K7ODn2VYxLy5u mIYRsEGzivFh+ITPFb+vH3u2QCzMJQWyAfOsRAATMtAqD0Q3fQtVYi6Czlti5NW8HBczV9 305HQ5cMSQLYVp9Y0/nRUo3rshF7aWqQC9nuEWrDAm3E/D9csPrbCiiI4MScSs1b3AqYRy XN8lDRCg2Y/borBVueQV5zNkmeH12SQFgCZJIb6+6J9JD1pMiBawZoXa1TOQLw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736851067; a=rsa-sha256; cv=none; b=u7B95bI/l2GOVLU4tGD66fHva7w1q+NFKIMn0Ej1AlKQJ/QdTxkg2Sdc9YDz0wPWRbx92A ML3Rbnci3srAi+NEGiXCkNGFf68rgL3zOq1AwvVIKswlv1BQd9m0IVS7qD/RaCCvgWg0xH LQ4Wc7dJgO0FZuLRDKCpHK0EL2htTbqHyFvx93AkJYC2O3hHV3koFlS5Eqkv12n7l+1XIL /eQXcAs4PXaMuzUY3inSxTFQ/VtTnDqvvB4/tRomovAP4cnOZoxOGO6Hp4Fp05nVU8o3xF iBdnjb1Lx8Cpty/RUzpvWTzTdJQNbE/m05/OahAC7g8khi5PNwl0Or2UerpxtA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4YXQZ30Y24z1C6T; Tue, 14 Jan 2025 10:37:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50EAblcR047778; Tue, 14 Jan 2025 10:37:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50EAblgj047775; Tue, 14 Jan 2025 10:37:47 GMT (envelope-from git) Date: Tue, 14 Jan 2025 10:37:47 GMT Message-Id: <202501141037.50EAblgj047775@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 4aafc73d1255 - main - pfctl: pfctl_set_hostid always returns 0 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: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4aafc73d1255a92463d2ee73cea381462775e64a Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=4aafc73d1255a92463d2ee73cea381462775e64a commit 4aafc73d1255a92463d2ee73cea381462775e64a Author: Kristof Provost AuthorDate: 2025-01-07 10:55:05 +0000 Commit: Kristof Provost CommitDate: 2025-01-14 08:54:17 +0000 pfctl: pfctl_set_hostid always returns 0 Don't pretend otherwise and make it a void function instead. ok dlg Obtained from: OpenBSD, mcbride , 9ac6101ff7 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/parse.y | 5 +---- sbin/pfctl/pfctl.c | 6 ++---- sbin/pfctl/pfctl_parser.h | 2 +- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index fc9cf86081f6..63bee3ab6a1c 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -702,10 +702,7 @@ option : SET REASSEMBLE yesno optnodf { yyerror("hostid must be non-zero"); YYERROR; } - if (pfctl_set_hostid(pf, $3) != 0) { - yyerror("error setting hostid %08x", $3); - YYERROR; - } + pfctl_set_hostid(pf, $3); } | SET BLOCKPOLICY DROP { if (pf->opts & PF_OPT_VERBOSE) diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c index 190d1a382c03..4b2a69f456a2 100644 --- a/sbin/pfctl/pfctl.c +++ b/sbin/pfctl/pfctl.c @@ -2571,11 +2571,11 @@ pfctl_load_logif(struct pfctl *pf, char *ifname) return (pfctl_set_statusif(pfh, ifname ? ifname : "")); } -int +void pfctl_set_hostid(struct pfctl *pf, u_int32_t hostid) { if ((loadopt & PFCTL_FLAG_OPTION) == 0) - return (0); + return; HTONL(hostid); @@ -2584,8 +2584,6 @@ pfctl_set_hostid(struct pfctl *pf, u_int32_t hostid) if (pf->opts & PF_OPT_VERBOSE) printf("set hostid 0x%08x\n", ntohl(hostid)); - - return (0); } int diff --git a/sbin/pfctl/pfctl_parser.h b/sbin/pfctl/pfctl_parser.h index 551f2ff7537c..2b0766dfd99f 100644 --- a/sbin/pfctl/pfctl_parser.h +++ b/sbin/pfctl/pfctl_parser.h @@ -290,7 +290,7 @@ int pfctl_set_reassembly(struct pfctl *, int, int); int pfctl_set_optimization(struct pfctl *, const char *); int pfctl_apply_limit(struct pfctl *, const char *, unsigned int); int pfctl_set_logif(struct pfctl *, char *); -int pfctl_set_hostid(struct pfctl *, u_int32_t); +void pfctl_set_hostid(struct pfctl *, u_int32_t); int pfctl_do_set_debug(struct pfctl *, char *); int pfctl_set_interface_flags(struct pfctl *, char *, int, int); int pfctl_cfg_syncookies(struct pfctl *, uint8_t, struct pfctl_watermarks *);