Skip to content

Commit 54c727d

Browse files
committed
atenet/router: bind the CONNECT listeners dual-stack too
The CONNECT-terminating listeners landed after the first commit of this series, so they kept a bare 0.0.0.0 socket while ingress HTTP and HTTPS gained their "::" pair. Give them the same additional address, so all four of the router's socket listeners answer on both families. Both are port-gated and no e2e suite configures them yet, which is why nothing caught this; the internal main_internal listener has no socket and needs nothing.
1 parent 4b478a0 commit 54c727d

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

‎cmd/atenet/internal/router/xds.go‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1236,6 +1236,7 @@ func (x *XdsServer) buildConnectTerminateListener() *listenerv3.Listener {
12361236
},
12371237
},
12381238
},
1239+
AdditionalAddresses: dualStackAdditionalAddresses(uint32(x.connectPlainTextPort)),
12391240
FilterChains: []*listenerv3.FilterChain{
12401241
{
12411242
Filters: []*listenerv3.Filter{
@@ -1269,6 +1270,7 @@ func (x *XdsServer) buildConnectTerminateTLSListener() *listenerv3.Listener {
12691270
},
12701271
},
12711272
},
1273+
AdditionalAddresses: dualStackAdditionalAddresses(uint32(x.connectTLSPort)),
12721274
FilterChains: []*listenerv3.FilterChain{
12731275
{
12741276
Filters: []*listenerv3.Filter{

‎cmd/atenet/internal/router/xds_test.go‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -374,16 +374,14 @@ func TestXdsServer_UpdateSnapshot_WithConnect(t *testing.T) {
374374
}
375375
if raw, exists := listenersMap["connect_terminate"]; !exists {
376376
t.Error("connect_terminate listener missing")
377-
} else if sa := raw.(*listenerv3.Listener).GetAddress().GetSocketAddress(); sa.GetPortValue() != 8081 {
378-
t.Errorf("Expected connect_terminate port 8081, got %d", sa.GetPortValue())
377+
} else {
378+
assertDualStackIngress(t, raw.(*listenerv3.Listener), 8081)
379379
}
380380
if raw, exists := listenersMap["connect_terminate_tls"]; !exists {
381381
t.Error("connect_terminate_tls listener missing")
382382
} else {
383383
l := raw.(*listenerv3.Listener)
384-
if sa := l.GetAddress().GetSocketAddress(); sa.GetPortValue() != 8444 {
385-
t.Errorf("Expected connect_terminate_tls port 8444, got %d", sa.GetPortValue())
386-
}
384+
assertDualStackIngress(t, l, 8444)
387385
ts := l.GetFilterChains()[0].GetTransportSocket()
388386
if ts.GetName() != "envoy.transport_sockets.tls" {
389387
t.Errorf("Expected connect_terminate_tls to be TLS-wrapped, got transport socket %q", ts.GetName())

0 commit comments

Comments
 (0)