You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
inbound: Introduce a policy::LookupAddr type (#2264)
Currently, the inbound crate's `GetPolicy` trait performs lookups on
`OrigDstAddr`s. This is not strictly correct: the `OrigDstAddr` newtype
is intended to specifically represent an address that was returned by a
`getsockopt(..., SO_ORIGINAL_DST, ...)` call. Various uses of `OrigDstAddr`,
especially in the inbound policy stack, overload `OrigDstAddr` for other
uses so that other addresses must be coerced into an `OrigDstAddr`.
To simplify the inbound proxy's use of address types:
- Policy types (e.g. `ServerPolicy`, `AllowPermit`, etc) now represent
addresses as `ServerAddr` rather than `OrigDstAddr`.
- The `inbound::policy` module now defines a `LookupAddr` newtype, which
is passed as an argument to `GetPolicy`.
- The inbound accept and direct stacks provide `ExtractParam` impls to
the `policy::Discover` layer indicating how `LookupAddr`s are produced
from targets in that stack. This makes the different behaviors between
the normal accept stack and the direct stack more explicit at the
callsite.
0 commit comments