-/* $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.
};
struct redirspec {
- struct redirection *rdr;
- struct pool_opts pool_opts;
+ struct redirection *rdr;
+ struct pool_opts pool_opts;
int binat;
int af;
};
| STRING
;
-varstring : numberstring varstring {
+varstring : numberstring varstring {
if (asprintf(&$$, "%s %s", $1, $2) == -1)
err(1, "string: asprintf");
free($1);
if ($2 && strchr($2, '/') != NULL) {
free($2);
yyerror("anchor paths containing '/' "
- "cannot be used for inline anchors.");
+ "cannot be used for inline anchors.");
YYERROR;
}
}
;
-os_list : xos optnl { $$ = $1; }
+os_list : xos optnl { $$ = $1; }
| os_list comma xos optnl {
$1->tail->next = $3;
$1->tail = $3;
$$->tail = $$;
}
;
-
+
optweight : WEIGHT NUMBER {
if ($2 < 1 || $2 > USHRT_MAX) {
yyerror("weight out of range");
}
;
-redirspec : host optweight {
+redirspec : host optweight {
if ($2 > 0) {
struct node_host *n;
for (n = $1; n != NULL; n = n->next)
}
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;
c = igetc();
}
}
-
+
return (c);
}
-/* $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
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;
* 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)) {
-/* $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
for (n = h; n != NULL; n = n->next) {
n->addr.type = PF_ADDR_ADDRMASK;
n->weight = 0;
- }
+ }
error:
free(ps);
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;
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 */
}
}
}
-
expect = 0;
return (0);
}
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;
}
-/* $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
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)