adding fields to struct mbuf

From: Kajetan Staszkiewicz <vegeta_at_tuxpowered.net>
Date: Thu, 31 Jul 2025 11:03:22 UTC
Hello group,

I'm researching loop prevention in pfil. There are cases where packets
are reinjected into the network stack and would be handled by the same
hooks again, i.e. pf + dummynet where currently pf itself handles loop
prevention on its own. My current experiment's approach to making loop
prevention a general, non-pf-specific thing is to create a new mtag with
pointer to the last hook and update it in pfil.c/pfil_mbuf_common().
That works good so far, but it means memory allocation when pfil hooks
are involved. I'm unsure what the impact on performance would be.
Another approach would be to extend struct mbuf, or probably rather
struct m_pkthdr, to contain the aforementioned pointer. But is changing
that struct something that can be easily done and approved and merged?

For those curious the experiment will be uploaded to Phabricator soon-ish.

-- 
| pozdrawiam / regards | Powered by Debian and FreeBSD  |
| Kajetan Staszkiewicz |   www: http://tuxpowered.net   |
|                      | matrix: @vegeta:tuxpowered.net |
`----------------------^--------------------------------'