Page MenuHomeFreeBSD

pf: tag dummynet'd route-to packets with their real destination
ClosedPublic

Authored by kp on May 10 2022, 8:53 AM.
Tags
None
Referenced Files
F115652141: D35159.id105854.diff
Sat, Apr 26, 2:31 PM
Unknown Object (File)
Fri, Apr 25, 2:04 AM
Unknown Object (File)
Sun, Apr 20, 11:46 AM
Unknown Object (File)
Mar 5 2025, 1:20 PM
Unknown Object (File)
Mar 3 2025, 4:39 PM
Unknown Object (File)
Feb 28 2025, 7:11 PM
Unknown Object (File)
Feb 25 2025, 7:04 PM
Unknown Object (File)
Feb 22 2025, 1:08 AM

Details

Summary

If we delay route-to/dup-to/reply-to through dummynet we are eventually
returned to pf_test(). At that point we no longer have the context for
the route-to destination. We'd just skip the pf_test() and continue
processing. This means that route-to did not work as expected.

Extend pf_mtag to carry the route-to destination so we can apply it when
we re-enter pf_test().

Sponsored by: Rubicon Communications, LLC ("Netgate")

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

sys/netpfil/pf/pf.c
6871

Can we assert network epoch here?

7427

What do you think about changing ifnet_byindexgen() to never return IFF_DYING interfaces?

P.S. I desire the need for this flag to be eliminated.

sys/netpfil/pf/pf.c
6871

Yeah, that makes sense.

Pretty much all of pf runs under net_epoch, but an assert will make it more obvious that it's safe to access these fields here.

7427

That would make sense to me, yes.

  • add NET_EPOCH_ASSERT
  • return 'int' for errors rather than 'bool'
This revision was not accepted when it landed; it landed in state Needs Review.May 12 2022, 7:58 PM
This revision was automatically updated to reflect the committed changes.