From nobody Tue Jan 04 02:31:25 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 E89771928CB0 for ; Tue, 4 Jan 2022 02:31:32 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JSc7S5z4Cz3M6g for ; Tue, 4 Jan 2022 02:31:32 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wr1-f52.google.com with SMTP id v6so11413498wra.8 for ; Mon, 03 Jan 2022 18:31:32 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=pN0I6eDojzvBr2Ja1YLKDa2fp5fYXvngserpLf2cLrk=; b=K8izBpHFknBxo9Kww1AKUkB3kvBFVCxdNuxGdOAszYMV72efHEpGnj4P6dWhLRhCKB teld3Ddhp8fqydb6o7W0nKU++tkTRRM423VpZ5lAL8CEB7DFHXi0ir0wb974g9EInN8o 7+szBbGmNmn/YuH1GBa2BhGWb9U4QfBhCHJ0HnQJTZtjNp6jp7vaaNWgPuFg/bDqAjeB 1qhaYI59VH+FkCylGKGq4LcCys5lJ/d1tSdfk+hX2LzGVtcLilAqZdfdBy9eshPLN1zA e/E2OEt7q03eYy/4MgZmuHQABnQkaRGbOhWZOEE81K4dZTq/z91wuQL0fn3iRWvWmqv9 etww== X-Gm-Message-State: AOAM532/+GXdJzcZj7I4lAteRglmfQyIs+gaLEfENeqzaSHPnq7IRPrJ riv1AfNyky3WLHPqlpMPzy2JAQ== X-Google-Smtp-Source: ABdhPJxDrDrV7OwGyTNOwy/apUEcrIKpj33YIdjOBu/3P1tQu5VXFwfFNCV6XN3TSWtaaA8eLZqJPQ== X-Received: by 2002:a5d:4b04:: with SMTP id v4mr9926120wrq.395.1641263485979; Mon, 03 Jan 2022 18:31:25 -0800 (PST) Received: from smtpclient.apple (global-5-141.nat-2.net.cam.ac.uk. [131.111.5.141]) by smtp.gmail.com with ESMTPSA id i4sm38079232wmd.34.2022.01.03.18.31.25 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Jan 2022 18:31:25 -0800 (PST) Content-Type: text/plain; charset=utf-8 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 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Subject: Re: git: 2582ae574018 - main - ipfilter: Adjust userland returns to conform to style(9) From: Jessica Clarke In-Reply-To: <202201040207.20427dG2042684@gitrepo.freebsd.org> Date: Tue, 4 Jan 2022 02:31:25 +0000 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <15C99D06-58BE-4836-BAB3-6EE247276D8D@freebsd.org> References: <202201040207.20427dG2042684@gitrepo.freebsd.org> To: Cy Schubert X-Mailer: Apple Mail (2.3654.120.0.1.13) X-Rspamd-Queue-Id: 4JSc7S5z4Cz3M6g X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On 4 Jan 2022, at 02:07, Cy Schubert wrote: >=20 > The branch main has been updated by cy: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D2582ae5740181e0d2bab10003d66ae91= c9b56329 >=20 > commit 2582ae5740181e0d2bab10003d66ae91c9b56329 > Author: Cy Schubert > AuthorDate: 2021-12-22 02:37:19 +0000 > Commit: Cy Schubert > CommitDate: 2022-01-04 02:06:43 +0000 >=20 > ipfilter: Adjust userland returns to conform to style(9) >=20 > Adjust ipfilter's userland return statements to conform to = style(9). >=20 > MFC after: 1 month > --- > sbin/ipf/common/genmask.c | 14 +++--- > sbin/ipf/common/ipf_y.y | 62 ++++++++++++------------- > sbin/ipf/common/lexer.c | 34 +++++++------- > sbin/ipf/ipf/bpf_filter.c | 76 +++++++++++++++--------------- > sbin/ipf/ipf/ipf.4 | 8 ++-- > sbin/ipf/ipf/ipf.5 | 10 ++-- > sbin/ipf/ipf/ipf.c | 18 ++++---- > sbin/ipf/ipf/ipfcomp.c | 95 = ++++++++++++++++++++++---------------- > sbin/ipf/ipf/ipl.4 | 2 +- > sbin/ipf/ipfs/ipfs.c | 80 = ++++++++++++++++---------------- > sbin/ipf/ipfstat/ipfstat.c | 84 = ++++++++++++++++----------------- > sbin/ipf/ipftest/ip_fil.c | 88 = +++++++++++++++++------------------ > sbin/ipf/ipftest/ipftest.1 | 2 +- > sbin/ipf/ipftest/ipftest.c | 42 ++++++++--------- > sbin/ipf/iplang/iplang_l.l | 28 +++++------ > sbin/ipf/iplang/iplang_y.y | 18 ++++---- > sbin/ipf/ipmon/ipmon.c | 52 ++++++++++----------- > sbin/ipf/ipmon/ipmon_y.y | 36 +++++++-------- > sbin/ipf/ipnat/ipnat.5 | 4 +- > sbin/ipf/ipnat/ipnat.c | 6 +-- > sbin/ipf/ipnat/ipnat_y.y | 32 ++++++------- > sbin/ipf/ippool/ippool.c | 62 ++++++++++++------------- > sbin/ipf/ippool/ippool_y.y | 28 +++++------ > sbin/ipf/ipscan/ipscan_y.y | 14 +++--- > sbin/ipf/ipsend/44arp.c | 14 +++--- > sbin/ipf/ipsend/arp.c | 18 ++++---- > sbin/ipf/ipsend/dlcommon.c | 24 +++++----- > sbin/ipf/ipsend/ip.c | 28 +++++------ > sbin/ipf/ipsend/ipresend.c | 2 +- > sbin/ipf/ipsend/ipsend.c | 10 ++-- > sbin/ipf/ipsend/ipsopt.c | 12 ++--- > sbin/ipf/ipsend/iptest.c | 2 +- > sbin/ipf/ipsend/resend.c | 8 ++-- > sbin/ipf/ipsend/sbpf.c | 14 +++--- > sbin/ipf/ipsend/sdlpi.c | 8 ++-- > sbin/ipf/ipsend/snit.c | 10 ++-- > sbin/ipf/ipsend/sock.c | 38 +++++++-------- > sbin/ipf/ipsend/sockraw.c | 10 ++-- > sbin/ipf/libipf/addipopt.c | 4 +- > sbin/ipf/libipf/alist_new.c | 8 ++-- > sbin/ipf/libipf/allocmbt.c | 4 +- > sbin/ipf/libipf/bcopywrap.c | 2 +- > sbin/ipf/libipf/buildopts.c | 4 +- > sbin/ipf/libipf/checkrev.c | 8 ++-- > sbin/ipf/libipf/connecttcp.c | 10 ++-- > sbin/ipf/libipf/count4bits.c | 6 +-- > sbin/ipf/libipf/count6bits.c | 2 +- > sbin/ipf/libipf/dupmbt.c | 4 +- > sbin/ipf/libipf/facpri.c | 20 ++++---- > sbin/ipf/libipf/familyname.c | 6 +-- > sbin/ipf/libipf/findword.c | 4 +- > sbin/ipf/libipf/ftov.c | 8 ++-- > sbin/ipf/libipf/gethost.c | 10 ++-- > sbin/ipf/libipf/geticmptype.c | 8 ++-- > sbin/ipf/libipf/getifname.c | 20 ++++---- > sbin/ipf/libipf/getnattype.c | 4 +- > sbin/ipf/libipf/getport.c | 24 +++++----- > sbin/ipf/libipf/getportproto.c | 10 ++-- > sbin/ipf/libipf/getproto.c | 8 ++-- > sbin/ipf/libipf/getsumd.c | 2 +- > sbin/ipf/libipf/hostname.c | 12 ++--- > sbin/ipf/libipf/icmptypename.c | 8 ++-- > sbin/ipf/libipf/inet_addr.c | 22 ++++----- > sbin/ipf/libipf/interror.c | 12 ++--- > sbin/ipf/libipf/ipf_perror.c | 2 +- > sbin/ipf/libipf/ipft_hx.c | 14 +++--- > sbin/ipf/libipf/ipft_pc.c | 36 +++++++-------- > sbin/ipf/libipf/ipft_tx.c | 68 +++++++++++++-------------- > sbin/ipf/libipf/ipoptsec.c | 10 ++-- > sbin/ipf/libipf/kmem.c | 20 ++++---- > sbin/ipf/libipf/kmemcpywrap.c | 2 +- > sbin/ipf/libipf/kvatoname.c | 4 +- > sbin/ipf/libipf/load_dstlist.c | 14 +++--- > sbin/ipf/libipf/load_dstlistnode.c | 8 ++-- > sbin/ipf/libipf/load_file.c | 6 +-- > sbin/ipf/libipf/load_hash.c | 14 +++--- > sbin/ipf/libipf/load_hashnode.c | 6 +-- > sbin/ipf/libipf/load_http.c | 8 ++-- > sbin/ipf/libipf/load_pool.c | 12 ++--- > sbin/ipf/libipf/load_poolnode.c | 6 +-- > sbin/ipf/libipf/load_url.c | 2 +- > sbin/ipf/libipf/msgdsize.c | 2 +- > sbin/ipf/libipf/nametokva.c | 4 +- > sbin/ipf/libipf/ntomask.c | 10 ++-- > sbin/ipf/libipf/optname.c | 8 ++-- > sbin/ipf/libipf/optvalue.c | 8 ++-- > sbin/ipf/libipf/parsefields.c | 2 +- > sbin/ipf/libipf/parseipfexpr.c | 4 +- > sbin/ipf/libipf/parsewhoisline.c | 34 +++++++------- > sbin/ipf/libipf/poolio.c | 8 ++-- > sbin/ipf/libipf/portname.c | 6 +-- > sbin/ipf/libipf/prependmbt.c | 2 +- > sbin/ipf/libipf/printdstl_live.c | 8 ++-- > sbin/ipf/libipf/printdstlist.c | 8 ++-- > sbin/ipf/libipf/printdstlistnode.c | 8 ++-- > sbin/ipf/libipf/printhash.c | 8 ++-- > sbin/ipf/libipf/printhash_live.c | 4 +- > sbin/ipf/libipf/printhashnode.c | 4 +- > sbin/ipf/libipf/printpool.c | 6 +-- > sbin/ipf/libipf/printpool_live.c | 4 +- > sbin/ipf/libipf/printpoolnode.c | 2 +- > sbin/ipf/libipf/printstate.c | 4 +- > sbin/ipf/libipf/remove_hash.c | 8 ++-- > sbin/ipf/libipf/remove_hashnode.c | 8 ++-- > sbin/ipf/libipf/remove_pool.c | 8 ++-- > sbin/ipf/libipf/remove_poolnode.c | 8 ++-- > sbin/ipf/libipf/save_execute.c | 6 +-- > sbin/ipf/libipf/save_file.c | 14 +++--- > sbin/ipf/libipf/save_nothing.c | 4 +- > sbin/ipf/libipf/save_syslog.c | 10 ++-- > sbin/ipf/libipf/save_v1trap.c | 54 +++++++++++----------- > sbin/ipf/libipf/save_v2trap.c | 50 ++++++++++---------- > sbin/ipf/libipf/tcp_flags.c | 2 +- > sbin/ipf/libipf/tcpflags.c | 4 +- > sbin/ipf/libipf/v6optvalue.c | 8 ++-- > sbin/ipf/libipf/var.c | 22 ++++----- > sbin/ipf/libipf/vtof.c | 8 ++-- > 117 files changed, 965 insertions(+), 948 deletions(-) >=20 > diff --git a/sbin/ipf/common/genmask.c b/sbin/ipf/common/genmask.c > index 75193e3ea398..581573463c4c 100644 > --- a/sbin/ipf/common/genmask.c > +++ b/sbin/ipf/common/genmask.c > @@ -26,15 +26,15 @@ int genmask(family, msk, mskp) > #ifdef USE_INET6 > case AF_INET6 : > if (inet_pton(AF_INET6, msk, &mskp->in4) !=3D 1) > - return -1; > + return(-1); As with the kernel commit; needs a space. > [...] > diff --git a/sbin/ipf/ipf/ipf.4 b/sbin/ipf/ipf/ipf.4 > index 73a17a0cc8d3..559e48a3c6a5 100644 > --- a/sbin/ipf/ipf/ipf.4 > +++ b/sbin/ipf/ipf/ipf.4 > @@ -91,7 +91,7 @@ typedef struct frentry { > u_short fr_skip; /* # of rules to skip */ > u_short fr_loglevel; /* syslog log facility + priority */ > int (*fr_func)(int, ip_t *, fr_info_t *)); > - char fr_icode; /* return ICMP code */ > +( char fr_icode; /* return ICMP code */); Something=E2=80=99s gone horribly wrong throughout this file. > char fr_ifname[IFNAMSIZ]; > #ifdef BSD > char fr_oifname[IFNAMSIZ]; > @@ -118,8 +118,8 @@ Flags which are recognised in fr_flags: > FR_LOGP 0x000012 /* Log-pass */ > FR_LOGBODY 0x000020 /* log the body of packets too */ > FR_LOGFIRST 0x000040 /* log only the first packet to match = */ > - FR_RETRST 0x000080 /* return a TCP RST packet if blocked = */ > - FR_RETICMP 0x000100 /* return an ICMP packet if blocked = */ > +( FR_RETRST 0x000080 /* return a TCP RST packet if = blocked */); > +( FR_RETICMP 0x000100 /* return an ICMP packet if blocked = */); > FR_FAKEICMP 0x00180 /* Return ICMP unreachable with fake = source */ > FR_NOMATCH 0x000200 /* no match occured */ > FR_ACCOUNT 0x000400 /* count packet bytes */ > @@ -210,7 +210,7 @@ struct filterstats { > u_long fr_npkl; /* packets unmatched and logged */ > u_long fr_pkl; /* packets logged */ > u_long fr_skip; /* packets to be logged but buffer = full */ > - u_long fr_ret; /* packets for which a return is sent = */ > +( u_long fr_ret; /* packets for which a return is = sent */); > u_long fr_acct; /* packets for which counting was = performed */ > u_long fr_bnfr; /* bad attempts to allocate fragment = state */ > u_long fr_nfr; /* new fragment state kept */ > diff --git a/sbin/ipf/ipf/ipf.5 b/sbin/ipf/ipf/ipf.5 > index 8ef56493df5a..2b5d756531eb 100644 > --- a/sbin/ipf/ipf/ipf.5 > +++ b/sbin/ipf/ipf/ipf.5 > @@ -108,7 +108,7 @@ auth > rules cause the matching packet to be queued up for processing by a > user space program. The user space program is responsible for making > an ioctl system call to collect the information about the queued > -packet and another ioctl system call to return the verdict (block, > +packet( and another ioctl system call to return the verdict (block,); > pass, etc) on what to do with the packet. In the event that the queue > becomes full, the packets will end up being dropped. > .HP > @@ -224,7 +224,7 @@ To address this problem, a block rule can be = qualified in two ways. > The first of these is specific to TCP and instructs IPFilter to send = back > a reset (RST) packet. This packet indicates to the remote system that = the > packet it sent has been rejected and that it shouldn't make any = further > -attempts to send packets to that port. Telling IPFilter to return a = TCP > +attempts( to send packets to that port. Telling IPFilter to return a = TCP); > RST packet in response to something that has been received is achieved > with the return-rst keyword like this: > .PP > @@ -240,18 +240,18 @@ For all of the other protocols handled by the IP = protocol suite, to send > back an error indicating that the received packet was dropped requires > sending back an ICMP error packet. Whilst these can also be used for = TCP, > the sending host may not treat the received ICMP error as a hard error > -in the same way as it does the TCP RST packet. To return an ICMP = error > +in( the same way as it does the TCP RST packet. To return an ICMP = error); > it is necessary to place return-icmp after the block keyword like = this: > .PP > .nf > block return-icmp in proto udp from any to 192.168.0.1/24 > .fi > .PP > -When electing to return an ICMP error packet, it is also possible to > +When( electing to return an ICMP error packet, it is also possible = to); > select what type of ICMP error is returned. Whilst the full compliment > of ICMP unreachable codes can be used by specifying a number instead = of > the string below, only the following should be used in conjunction = with > -return-icmp. Which return code to use is a choice to be made when > +return-icmp.( Which return code to use is a choice to be made when); > weighing up the pro's and con's. Using some of the codes may make it > more obvious that a firewall is being used rather than just the host > not responding. > diff --git a/sbin/ipf/ipf/ipf.c b/sbin/ipf/ipf/ipf.c > index 3567a82484fb..0cd393f37d5e 100644 > --- a/sbin/ipf/ipf/ipf.c > +++ b/sbin/ipf/ipf/ipf.c > @@ -174,11 +174,11 @@ static int > opendevice(char *ipfdev, int check) > { > if (opts & OPT_DONOTHING) > - return -2; > + return(-2); >=20 > if (check && checkrev(ipfname) =3D=3D -1) { > fprintf(stderr, "User/kernel version check failed\n"); > - return -2; > + return(-2); > } >=20 > if (!ipfdev) > @@ -188,7 +188,7 @@ opendevice(char *ipfdev, int check) > if ((fd =3D open(ipfdev, O_RDWR)) =3D=3D -1) > if ((fd =3D open(ipfdev, O_RDONLY)) =3D=3D -1) > ipferror(fd, "open device"); > - return fd; > + return(fd); > } >=20 >=20 > @@ -208,9 +208,9 @@ get_flags(void) > if ((opendevice(ipfname, 1) !=3D -2) && > (ioctl(fd, SIOCGETFF, &i) =3D=3D -1)) { > ipferror(fd, "SIOCGETFF"); > - return 0; > + return(0); > } > - return i; > + return(i); > } >=20 >=20 > @@ -256,7 +256,7 @@ ipf_interceptadd(int fd, ioctlfunc_t ioctlfunc, = void *ptr) >=20 > if (ipf_addrule(fd, ioctlfunc, ptr) !=3D 0) > exitstatus =3D 1; > - return 0; > + return(0); > } >=20 >=20 > @@ -527,13 +527,13 @@ showversion(void) >=20 > if ((vfd =3D open(ipfname, O_RDONLY)) =3D=3D -1) { > perror("open device"); > - return 1; > + return(1); > } >=20 > if (ioctl(vfd, SIOCGETFS, &ipfo)) { > ipferror(vfd, "ioctl(SIOCGETFS)"); > close(vfd); > - return 1; > + return(1); > } > close(vfd); > flags =3D get_flags(); > @@ -574,5 +574,5 @@ showversion(void) > printf("Active list: %d\n", fio.f_active); > printf("Feature mask: %#x\n", fio.f_features); >=20 > - return 0; > + return(0); > } > diff --git a/sbin/ipf/ipf/ipfcomp.c b/sbin/ipf/ipf/ipfcomp.c > index 105ff2b852e8..19a61c8bb0e0 100644 > --- a/sbin/ipf/ipf/ipfcomp.c > +++ b/sbin/ipf/ipf/ipfcomp.c > @@ -62,8 +62,8 @@ static FILE *cfile =3D NULL; > * This is called once per filter rule being loaded to emit data = structures > * required. > */ > -void > -printc(frentry_t *fr) > +void printc(fr) > + frentry_t *fr; > { > u_long *ulp; > char *and; > @@ -162,8 +162,9 @@ printc(frentry_t *fr) > static frgroup_t *groups =3D NULL; >=20 >=20 > -static void > -addrule(FILE *fp, frentry_t *fr) > +static void addrule(fp, fr) > + FILE *fp; > + frentry_t *fr; > { > frentry_t *f, **fpp; > frgroup_t *g; > @@ -242,27 +243,30 @@ static u_long ipf%s_rule_data_%s_%u[] =3D {\n", > } >=20 >=20 > *** 6134 LINES SKIPPED ***