From nobody Tue Jan 4 03:44:14 2022 X-Original-To: dev-commits-src-main@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 96BCF193B426; Tue, 4 Jan 2022 03:44:16 +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 4JSdlM3wS7z3qtB; Tue, 4 Jan 2022 03:44:15 +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 1B3DA11D61; Tue, 4 Jan 2022 03:44:15 +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 2043iFVl076546; Tue, 4 Jan 2022 03:44:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2043iErk076545; Tue, 4 Jan 2022 03:44:14 GMT (envelope-from git) Date: Tue, 4 Jan 2022 03:44:14 GMT Message-Id: <202201040344.2043iErk076545@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: a3522837b021 - main - ipfilter userland: Fix branch mismerge List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a3522837b021a46f2de81303247599ea51163d13 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1641267855; 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=ECL52ZcVTwrRpaEQKF3AvuXQB22AxZqkZEAnLnrLIJ0=; b=F6Q6UdSw1lX9D+C8NmDr6Z3k32GFibB7iLqO73esmMHVxJYvTG6AxELo0SyKfg+igDbTxS rVA0JTMD6xboypFZwHtUBeclEMs9fcZpwqLuvxZrLcGlFUT42Uhbg1YzBfmYbdRsgEpLHQ b7nEEzZAP2kL3MPy4nGgawKfSVw0uTlYxUb+Qzp4oGDkgnl8HdCHmW3WdHbusWpzMXucOI As0f37q4IMvX+3iHR+Itb0N+TNnQXgx3E1OBWYbFMf2lcfXrzz9AOm6z31B4A61V2IRT/W JihAeMnxeiJJkPYUHrnJOyGoASO6b5xldt6yfjiBbgxRDfyOKqz06Ojv/aM9bA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1641267855; a=rsa-sha256; cv=none; b=aLBL0ity/a+avH0m5JIyY0xLOgSGHipmf6kw1jzU3JKsatYIiqJ68VaHSiXVWqx4p9uETP UKICAsJBGjPi0qBL/ZKBV3lfS5q02ieaoZ/l3KiksIzp4yYbS6I01d2xPq4hrno+YlYgC8 QN37QbSUKDnG9nHSgRhgtnCQZrUvraeRc5rnlvIUxEuEL5KBX8y3F2IWcHehE+UNUUIWPt 5Hu0pTAuP0GwSE+vwToKkq0muLwD/ZrzpxbZcAx6qZBGr/XqpzAJ5oeKNEomh+SmZg1Scd C10no6gCTrTSx8CZvcsRSHa6/CZ+/FjOBjIcE4ogrY55w9zf0w8wTFX9k6SVaQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=a3522837b021a46f2de81303247599ea51163d13 commit a3522837b021a46f2de81303247599ea51163d13 Author: Cy Schubert AuthorDate: 2022-01-04 03:04:04 +0000 Commit: Cy Schubert CommitDate: 2022-01-04 03:39:24 +0000 ipfilter userland: Fix branch mismerge The work to ANSIfy and adjust returns to style(9) resulted in a mismerge of a stash when ipfilter was moved from contrib to sbin. An older file replaced WIP at the time, resulting in a regression. The majority of this work was done in 2018 saved as git stashes within a git-svn tree and migrated to the git tree. The regression occurred when the various stashes were sequentially merged to create individual commits, following the ipfilter move to netpfil and sbin. Reported by: jrtc27 Fixes: 2582ae5740181e0d2bab10003d66ae91c9b56329 Pointy hat to: cy MFC after: 1 month --- sbin/ipf/ipf/ipfcomp.c | 71 +++++++++++++++++++------------------------------- 1 file changed, 27 insertions(+), 44 deletions(-) diff --git a/sbin/ipf/ipf/ipfcomp.c b/sbin/ipf/ipf/ipfcomp.c index fc16f4adea2c..cf01838d7966 100644 --- a/sbin/ipf/ipf/ipfcomp.c +++ b/sbin/ipf/ipf/ipfcomp.c @@ -62,8 +62,8 @@ static FILE *cfile = NULL; * This is called once per filter rule being loaded to emit data structures * required. */ -void printc(fr) - frentry_t *fr; +void +printc(frentry_t *fr) { u_long *ulp; char *and; @@ -162,9 +162,8 @@ void printc(fr) static frgroup_t *groups = NULL; -static void addrule(fp, fr) - FILE *fp; - frentry_t *fr; +static void +addrule(FILE *fp, frentry_t *fr) { frentry_t *f, **fpp; frgroup_t *g; @@ -243,8 +242,8 @@ static u_long ipf%s_rule_data_%s_%u[] = {\n", } -int intcmp(c1, c2) - const void *c1, *c2; +int +intcmp(const void *c1, const void *c2) { const mc_t *i1 = (const mc_t *)c1, *i2 = (const mc_t *)c2; @@ -255,18 +254,15 @@ int intcmp(c1, c2) } -static void indent(fp, in) - FILE *fp; - int in; +static void +indent(FILE *fp, int in) { for (; in; in--) fputc('\t', fp); } -static void printeq(fp, var, m, max, v) - FILE *fp; - char *var; - int m, max, v; +static void +printeq(FILE *fp, char *var, int m, int max, int v) { if (m == max) fprintf(fp, "%s == %#x) {\n", var, v); @@ -280,10 +276,8 @@ static void printeq(fp, var, m, max, v) * m - netmask * v - required address */ -static void printipeq(fp, var, fl, m, v) - FILE *fp; - char *var; - int fl, m, v; +static void +printipeq(FILE *fp, char *var, int fl, int m, int v) { if (m == 0xffffffff) fprintf(fp, "%s ", var); @@ -294,10 +288,8 @@ static void printipeq(fp, var, fl, m, v) } -void emit(num, dir, v, fr) - int num, dir; - void *v; - frentry_t *fr; +void +emit(int num, int dir, void *v, frentry_t *fr) { u_int incnt, outcnt; frgroup_t *g; @@ -346,9 +338,8 @@ void emit(num, dir, v, fr) } -static void emitheader(grp, incount, outcount) - frgroup_t *grp; - u_int incount, outcount; +static void +emitheader(frgroup_t *grp, u_int incount, u_int outcount) { static FILE *fph = NULL; frgroup_t *g; @@ -401,7 +392,8 @@ extern int ipfrule_remove_out_%s(void));\n", } } -static void emittail() +static void +emittail(void) { frgroup_t *g; @@ -438,12 +430,9 @@ int ipfrule_remove()\n\ } -static void emitGroup(num, dir, v, fr, group, incount, outcount) - int num, dir; - void *v; - frentry_t *fr; - char *group; - u_int incount, outcount; +static void +emitGroup(int num, int dir, void *v, frentry_t *fr, char *group, + u_int incount, u_int outcount) { static FILE *fp = NULL; static int header[2] = { 0, 0 }; @@ -956,8 +945,8 @@ static void emitGroup(num, dir, v, fr, group, incount, outcount) } -void printC(dir) - int dir; +void +printC(int dir) { static mc_t *m = NULL; frgroup_t *g; @@ -979,11 +968,8 @@ void printC(dir) /* * Now print out code to implement all of the rules. */ -static void printCgroup(dir, top, m, group) - int dir; - frentry_t *top; - mc_t *m; - char *group; +static void +printCgroup(int dir, frentry_t *top, mc_t *m, char *group) { frentry_t *fr, *fr1; int i, n, rn; @@ -1229,11 +1215,8 @@ static void printCgroup(dir, top, m, group) } } -static void printhooks(fp, in, out, grp) - FILE *fp; - int in; - int out; - frgroup_t *grp; +static void +printhooks(FILE *fp, int in, int out, frgroup_t *grp) { frentry_t *fr; char *group;