-
Notifications
You must be signed in to change notification settings - Fork 271
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bind outbound proxy to the IPv6 loopback #2854
Conversation
e3ea28e
to
423f6f7
Compare
In order for the proxy to support IPv6 traffic we need to bind the outbound proxy to the IPv6 loopback (`::1`), in addition to the existing binding to the IPv4 loopback (`127.0.0.1`). Note, this is not necessary for inbound; on the proxy side we'll set `LINKERD2_PROXY_INBOUND_LISTEN_ADDR` (and the other `*_LISTEN_ADDR`) vars to the IPv6 wildcard address (`::`) which also works for IPv4. This change adds the `LINKERD2_PROXY_OUTBOUND_LISTEN_ADDRS` var, which is supposed to be set as `127.0.0.1:4140,[::1]:4140` (maximum two entries). If not set, we default to the value in `LINKERD2_PROXY_OUTBOUND_LISTEN_ADDR`. The `ServerConfig` got expanded with an optional `addr_additional` field, which should be populated with `[::1]:4140`. When set, we bind using `BindWithOrigDst`'s new method `bind_additional` which leverages `ServerConfig`'s `InsertParam` implementation for putting its `addr_additional` into `addr` for the regular binding logic to continue.
423f6f7
to
bd0dac0
Compare
Ok I've rebased and pushed again using the suggested approach. I introduced a new |
In my last push I added the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great to me! Thanks. Two small suggestions.
Co-authored-by: Oliver Gould <ver@buoyant.io>
In order for the proxy to support IPv6 traffic we need to bind the outbound proxy to the IPv6 loopback (
::1
), in addition to the existing binding to the IPv4 loopback (127.0.0.1
).Note, this is not necessary for inbound; on the proxy side we'll set
LINKERD2_PROXY_INBOUND_LISTEN_ADDR
(and the other*_LISTEN_ADDR
) vars to the IPv6 wildcard address (::
) which also works for IPv4.This change adds the
LINKERD2_PROXY_OUTBOUND_LISTEN_ADDRS
var, which is supposed to be set as127.0.0.1:4140,[::1]:4140
(maximum two entries). If not set, we default to the value inLINKERD2_PROXY_OUTBOUND_LISTEN_ADDR
.TheServerConfig
got expanded with an optionaladdr_additional
field, which should be populated with[::1]:4140
. When set, we bind usingBindWithOrigDst
's new methodbind_additional
which leveragesServerConfig
'sInsertParam
implementation for putting itsaddr_additional
intoaddr
for the regular binding logic to continue.Update:
The field
ServerConfig.addr
is now of the new typeDualListenAddr
which holds a primarySocketAddr
and an optional one.The outbound listener is now bound via the
DualBind
implementation ofBind
which also binds to the secondSocketAddr
if set, merging the two streams using Tokio'smerge
stream extension method.