sync with OpenBSD -current

This commit is contained in:
purplerain 2024-06-22 04:21:29 +00:00
parent b7453d5ddb
commit 747d3a4033
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
3 changed files with 22 additions and 13 deletions

View file

@ -1,4 +1,4 @@
/* $OpenBSD: cpu.c,v 1.119 2024/06/11 15:44:55 kettenis Exp $ */ /* $OpenBSD: cpu.c,v 1.120 2024/06/21 01:52:17 jsg Exp $ */
/* /*
* Copyright (c) 2016 Dale Rahn <drahn@dalerahn.com> * Copyright (c) 2016 Dale Rahn <drahn@dalerahn.com>
@ -103,6 +103,7 @@
#define CPU_PART_X_GENE 0x000 #define CPU_PART_X_GENE 0x000
/* Qualcomm */ /* Qualcomm */
#define CPU_PART_ORYON 0x001
#define CPU_PART_KRYO400_GOLD 0x804 #define CPU_PART_KRYO400_GOLD 0x804
#define CPU_PART_KRYO400_SILVER 0x805 #define CPU_PART_KRYO400_SILVER 0x805
@ -194,6 +195,7 @@ struct cpu_cores cpu_cores_amcc[] = {
struct cpu_cores cpu_cores_qcom[] = { struct cpu_cores cpu_cores_qcom[] = {
{ CPU_PART_KRYO400_GOLD, "Kryo 400 Gold" }, { CPU_PART_KRYO400_GOLD, "Kryo 400 Gold" },
{ CPU_PART_KRYO400_SILVER, "Kryo 400 Silver" }, { CPU_PART_KRYO400_SILVER, "Kryo 400 Silver" },
{ CPU_PART_ORYON, "Oryon" },
{ 0, NULL }, { 0, NULL },
}; };

View file

@ -1,4 +1,4 @@
/* $OpenBSD: pf.c,v 1.1198 2024/06/20 19:25:42 bluhm Exp $ */ /* $OpenBSD: pf.c,v 1.1199 2024/06/21 12:51:29 sashan Exp $ */
/* /*
* Copyright (c) 2001 Daniel Hartmeier * Copyright (c) 2001 Daniel Hartmeier
@ -3666,8 +3666,8 @@ pf_anchor_stack_top(void)
} }
int int
pf_anchor_stack_push(struct pf_ruleset *rs, struct pf_rule *r, pf_anchor_stack_push(struct pf_ruleset *rs, struct pf_rule *anchor,
struct pf_anchor *child, int jump_target) struct pf_rule *r, struct pf_anchor *child, int jump_target)
{ {
struct pf_anchor_stackframe *stack; struct pf_anchor_stackframe *stack;
struct pf_anchor_stackframe *top_sf = pf_anchor_stack_top(); struct pf_anchor_stackframe *top_sf = pf_anchor_stack_top();
@ -3677,6 +3677,7 @@ pf_anchor_stack_push(struct pf_ruleset *rs, struct pf_rule *r,
return (-1); return (-1);
top_sf->sf_rs = rs; top_sf->sf_rs = rs;
top_sf->sf_anchor = anchor;
top_sf->sf_r = r; top_sf->sf_r = r;
top_sf->sf_child = child; top_sf->sf_child = child;
top_sf->sf_jump_target = jump_target; top_sf->sf_jump_target = jump_target;
@ -3693,8 +3694,8 @@ pf_anchor_stack_push(struct pf_ruleset *rs, struct pf_rule *r,
} }
int int
pf_anchor_stack_pop(struct pf_ruleset **rs, struct pf_rule **r, pf_anchor_stack_pop(struct pf_ruleset **rs, struct pf_rule **anchor,
struct pf_anchor **child, int *jump_target) struct pf_rule **r, struct pf_anchor **child, int *jump_target)
{ {
struct pf_anchor_stackframe *top_sf = pf_anchor_stack_top(); struct pf_anchor_stackframe *top_sf = pf_anchor_stack_top();
struct pf_anchor_stackframe *stack; struct pf_anchor_stackframe *stack;
@ -3710,6 +3711,7 @@ pf_anchor_stack_pop(struct pf_ruleset **rs, struct pf_rule **r,
__func__); __func__);
*rs = top_sf->sf_rs; *rs = top_sf->sf_rs;
*anchor = top_sf->sf_anchor;
*r = top_sf->sf_r; *r = top_sf->sf_r;
*child = top_sf->sf_child; *child = top_sf->sf_child;
*jump_target = top_sf->sf_jump_target; *jump_target = top_sf->sf_jump_target;
@ -4306,25 +4308,27 @@ enter_ruleset:
if (r->quick) if (r->quick)
return (PF_TEST_QUICK); return (PF_TEST_QUICK);
} else { } else {
ctx->a = r;
ctx->aruleset = &r->anchor->ruleset; ctx->aruleset = &r->anchor->ruleset;
if (r->anchor_wildcard) { if (r->anchor_wildcard) {
RB_FOREACH(child, pf_anchor_node, RB_FOREACH(child, pf_anchor_node,
&r->anchor->children) { &r->anchor->children) {
if (pf_anchor_stack_push(ruleset, r, if (pf_anchor_stack_push(ruleset,
child, PF_NEXT_CHILD) != 0) ctx->a, r, child,
PF_NEXT_CHILD) != 0)
return (PF_TEST_FAIL); return (PF_TEST_FAIL);
ctx->a = r;
ruleset = &child->ruleset; ruleset = &child->ruleset;
goto enter_ruleset; goto enter_ruleset;
next_child: next_child:
continue; /* with RB_FOREACH() */ continue; /* with RB_FOREACH() */
} }
} else { } else {
if (pf_anchor_stack_push(ruleset, r, child, if (pf_anchor_stack_push(ruleset, ctx->a,
PF_NEXT_RULE) != 0) r, child, PF_NEXT_RULE) != 0)
return (PF_TEST_FAIL); return (PF_TEST_FAIL);
ctx->a = r;
ruleset = &r->anchor->ruleset; ruleset = &r->anchor->ruleset;
child = NULL; child = NULL;
goto enter_ruleset; goto enter_ruleset;
@ -4335,7 +4339,9 @@ next_rule:
r = TAILQ_NEXT(r, entries); r = TAILQ_NEXT(r, entries);
} }
if (pf_anchor_stack_pop(&ruleset, &r, &child, &target) == 0) { if (pf_anchor_stack_pop(&ruleset, &ctx->a, &r, &child,
&target) == 0) {
/* stop if any rule matched within quick anchors. */ /* stop if any rule matched within quick anchors. */
if (r->quick == PF_TEST_QUICK && *ctx->am == r) if (r->quick == PF_TEST_QUICK && *ctx->am == r)
return (PF_TEST_QUICK); return (PF_TEST_QUICK);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: pfvar_priv.h,v 1.36 2024/04/22 13:30:22 bluhm Exp $ */ /* $OpenBSD: pfvar_priv.h,v 1.37 2024/06/21 12:51:29 sashan Exp $ */
/* /*
* Copyright (c) 2001 Daniel Hartmeier * Copyright (c) 2001 Daniel Hartmeier
@ -321,6 +321,7 @@ struct pf_pdesc {
struct pf_anchor_stackframe { struct pf_anchor_stackframe {
struct pf_ruleset *sf_rs; struct pf_ruleset *sf_rs;
struct pf_rule *sf_anchor;
union { union {
struct pf_rule *u_r; struct pf_rule *u_r;
struct pf_anchor_stackframe *u_stack_top; struct pf_anchor_stackframe *u_stack_top;