Date: Thu, 19 Oct 2023 13:34:06 -0700 From: Gleb Smirnoff <glebius@freebsd.org> To: Kristof Provost <kp@freebsd.org> Cc: Igor Ostapenko <pm@igoro.pro>, src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: fabf705f4b5a - main - pf: fix pf divert-to loop Message-ID: <ZTGSvkMAAjX7zK1y@FreeBSD.org> In-Reply-To: <86D6E74C-3062-4718-816E-07CBA4F2903F@FreeBSD.org> References: <202310191237.39JCbdXp094554@gitrepo.freebsd.org> <ZTFV74-C4amIm0ru@FreeBSD.org> <86D6E74C-3062-4718-816E-07CBA4F2903F@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Oct 19, 2023 at 10:03:02PM +0200, Kristof Provost wrote:
K> Something like this?
...
K> --- a/sys/netinet/ip_var.h
K> +++ b/sys/netinet/ip_var.h
K> @@ -328,11 +328,17 @@ extern int (*ip_dn_ctl_ptr)(struct sockopt
K> *);
K> extern int (*ip_dn_io_ptr)(struct mbuf **, struct ip_fw_args *);
K>
K> /* pf specific mtag for divert(4) support */
K> -enum { PF_DIVERT_MTAG_DIR_IN=1, PF_DIVERT_MTAG_DIR_OUT=2 };
K> +__enum_uint8_decl(pf_mtag_dir) {
K> + PF_DIVERT_MTAG_DIR_IN = 1,
K> + PF_DIVERT_MTAG_DIR_OUT = 2
K> +};
K> struct pf_divert_mtag {
K> uint16_t idir; // initial pkt direction
K> - uint16_t ndir; // a) divert(4) port upon initial diversion
K> - // b) new direction upon pkt re-enter
K> + union {
K> + __enum_uint8(pf_mtag_dir) ndir; // a) divert(4) port upon
K> initial diversion
K> + // b) new direction upon pkt re-enter
K> + uint16_t port; /* Initial divert(4) port */
K> + };
K> };
idir should also be __enum_uint8(pf_mtag_dir) or a typedefed type for brevity.
--
Gleb Smirnoff
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?ZTGSvkMAAjX7zK1y>
