Index | Thread | Search

From:
Alexandr Nedvedicky <sashan@fastmail.net>
Subject:
Re: link mbufs/inpcbs to pf_states, not pf_state_keys
To:
David Gwynne <david@gwynne.id.au>
Cc:
Alexander Bluhm <alexander.bluhm@gmx.net>, tech@openbsd.org
Date:
Mon, 19 May 2025 08:46:55 +0200

Download raw body.

Thread
Hello,

I took a look at it. Although diff is large it's fairly mechanical
change (kind of s/pf_mbuf_unlink_state_key/pf_mbuf_unlink_stat)

I could spout just single nit in a diff here:

> @@ -1123,13 +1122,40 @@ pf_compare_state_keys(struct pf_state_ke
>  	}
>  }
>  
> +static inline struct pf_state *
> +pf_find_state_lookup(struct pf_pdesc *pd, const struct pf_state_key_cmp *key)
> +{
> +	struct pf_state_key	*sk;
> +	struct pf_state_item	*si;
> +	struct pf_state		*st;
> +	uint8_t			 dir = pd->dir;
		^^^^^^^^^^^^^^^^^^^^^^^6
    here I would do  'sk_idx = pd->dir == PF_IN ? PF_SK_WIRE : PF_SK_STACK;'
    so we don't need to compute it in every loop iteration. It is a nit
    It's up to you if you address it or not.


OK sashan