From 352b17dc2f71a4eda20d11b956537151f922d89f Mon Sep 17 00:00:00 2001 From: deraadt Date: Thu, 26 Oct 2023 16:26:01 +0000 Subject: [PATCH] whitespace cleanup my fingers couldn't avoid doing while i was re-reading the parsing code --- sbin/pfctl/parse.y | 20 ++++++++++---------- sbin/pfctl/pfctl.c | 6 +++--- sbin/pfctl/pfctl_parser.c | 13 ++++++------- sbin/pfctl/pfctl_table.c | 4 ++-- 4 files changed, 21 insertions(+), 22 deletions(-) diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index de1506cda8a..adc71340d3e 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.713 2023/02/07 17:58:43 sashan Exp $ */ +/* $OpenBSD: parse.y,v 1.714 2023/10/26 16:26:01 deraadt Exp $ */ /* * Copyright (c) 2001 Markus Friedl. All rights reserved. @@ -223,8 +223,8 @@ struct divertspec { }; struct redirspec { - struct redirection *rdr; - struct pool_opts pool_opts; + struct redirection *rdr; + struct pool_opts pool_opts; int binat; int af; }; @@ -761,7 +761,7 @@ string : STRING string { | STRING ; -varstring : numberstring varstring { +varstring : numberstring varstring { if (asprintf(&$$, "%s %s", $1, $2) == -1) err(1, "string: asprintf"); free($1); @@ -877,7 +877,7 @@ anchorrule : ANCHOR anchorname dir quick interface af proto fromto if ($2 && strchr($2, '/') != NULL) { free($2); yyerror("anchor paths containing '/' " - "cannot be used for inline anchors."); + "cannot be used for inline anchors."); YYERROR; } @@ -2526,7 +2526,7 @@ xos : STRING { } ; -os_list : xos optnl { $$ = $1; } +os_list : xos optnl { $$ = $1; } | os_list comma xos optnl { $1->tail->next = $3; $1->tail = $3; @@ -2621,7 +2621,7 @@ xhost : not host { $$->tail = $$; } ; - + optweight : WEIGHT NUMBER { if ($2 < 1 || $2 > USHRT_MAX) { yyerror("weight out of range"); @@ -3524,7 +3524,7 @@ portstar : numberstring { } ; -redirspec : host optweight { +redirspec : host optweight { if ($2 > 0) { struct node_host *n; for (n = $1; n != NULL; n = n->next) @@ -4471,7 +4471,7 @@ collapse_redirspec(struct pf_pool *rpool, struct pf_rule *r, } if (tbl) { if ((pf->opts & PF_OPT_NOACTION) == 0 && - pf_opt_create_table(pf, tbl)) + pf_opt_create_table(pf, tbl)) return (1); pf->tdirty = 1; @@ -5135,7 +5135,7 @@ lgetc(int quotec) c = igetc(); } } - + return (c); } diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c index bf85aa0e148..f4ff345a49a 100644 --- a/sbin/pfctl/pfctl.c +++ b/sbin/pfctl/pfctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pfctl.c,v 1.391 2023/04/28 14:08:38 sashan Exp $ */ +/* $OpenBSD: pfctl.c,v 1.392 2023/10/26 16:26:01 deraadt Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -367,7 +367,7 @@ pfctl_clear_interface_flags(int dev, int opts) int pfctl_clear_rules(int dev, int opts, char *anchorname) { - struct pfr_buffer t; + struct pfr_buffer t; memset(&t, 0, sizeof(t)); t.pfrb_type = PFRB_TRANS; @@ -931,7 +931,7 @@ pfctl_show_rules(int dev, char *path, int opts, enum pfctl_show format, * the user has explicitly requested recursion, * print it recursively. */ - if (pr.anchor_call[0] && + if (pr.anchor_call[0] && (((p = strrchr(pr.anchor_call, '/')) ? p[1] == '_' : pr.anchor_call[0] == '_') || opts & PF_OPT_RECURSE)) { diff --git a/sbin/pfctl/pfctl_parser.c b/sbin/pfctl/pfctl_parser.c index 226e73f74a9..220b0007029 100644 --- a/sbin/pfctl/pfctl_parser.c +++ b/sbin/pfctl/pfctl_parser.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pfctl_parser.c,v 1.348 2023/04/18 13:31:14 tb Exp $ */ +/* $OpenBSD: pfctl_parser.c,v 1.349 2023/10/26 16:26:01 deraadt Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -1639,7 +1639,7 @@ host(const char *s, int opts) for (n = h; n != NULL; n = n->next) { n->addr.type = PF_ADDR_ADDRMASK; n->weight = 0; - } + } error: free(ps); @@ -1802,7 +1802,7 @@ error: int append_addr(struct pfr_buffer *b, char *s, int test, int opts) { - static int previous = 0; + static int previous = 0; static int expect = 0; struct pfr_addr *a; struct node_host *h, *n; @@ -1810,13 +1810,13 @@ append_addr(struct pfr_buffer *b, char *s, int test, int opts) const char *errstr; int rv, not = 0, i = 0; u_int16_t weight; - + /* skip weight if given */ if (strcmp(s, "weight") == 0) { expect = 1; return (1); /* expecting further call */ } - + /* check if previous host is set */ if (expect) { /* parse and append load balancing weight */ @@ -1833,7 +1833,6 @@ append_addr(struct pfr_buffer *b, char *s, int test, int opts) } } } - expect = 0; return (0); } @@ -1873,7 +1872,7 @@ append_addr_host(struct pfr_buffer *b, struct node_host *n, int test, int not) addr.pfra_net = unmask(&n->addr.v.a.mask); if (n->ifname) { if (strlcpy(addr.pfra_ifname, n->ifname, - sizeof(addr.pfra_ifname)) >= sizeof(addr.pfra_ifname)) + sizeof(addr.pfra_ifname)) >= sizeof(addr.pfra_ifname)) errx(1, "append_addr_host: strlcpy"); addr.pfra_type = PFRKE_ROUTE; } diff --git a/sbin/pfctl/pfctl_table.c b/sbin/pfctl/pfctl_table.c index a7ff5533964..d041b15d568 100644 --- a/sbin/pfctl/pfctl_table.c +++ b/sbin/pfctl/pfctl_table.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pfctl_table.c,v 1.85 2022/11/21 07:27:10 sashan Exp $ */ +/* $OpenBSD: pfctl_table.c,v 1.86 2023/10/26 16:26:01 deraadt Exp $ */ /* * Copyright (c) 2002 Cedric Berger @@ -495,7 +495,7 @@ print_astats(struct pfr_astats *as, int dns) if (as->pfras_a.pfra_states) printf("\tActive States: %d\n", as->pfras_a.pfra_states); if (as->pfras_a.pfra_type == PFRKE_COST) - printf("\tWeight: %d\n", as->pfras_a.pfra_weight); + printf("\tWeight: %d\n", as->pfras_a.pfra_weight); if (as->pfras_a.pfra_ifname[0]) printf("\tInterface: %s\n", as->pfras_a.pfra_ifname); if (as->pfras_a.pfra_fback == PFR_FB_NOCOUNT) -- 2.20.1