Support multiple bind addresses for dual-stack (IPv4 + IPv6)
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 5/5
- Tempo estimado
- Mais de uma semana
- Facilidade para iniciantes
- 35/100
- Tipo de issue
- Funcionalidade
- Clareza
- Claramente especificada
- Status de atividade
- Ativa
- Stack de tecnologia
- ruby, yaml
- Domínio
- infrastructure, networking
Direção de pesquisa
Start by locating the HAProxy job templates and specs that render every use of ha_proxy.binding_ip, including HTTP, HTTPS, WSS, health-check, and TCP bindings. Compare the proposed binding_ips behavior with the existing v4v6 rendering; completion should apply validated addresses across all bind sites and ensure IPv6 entries generate the intended v6only setting.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Problem
The current ha_proxy.binding_ip property accepts a single scalar address. Combined with ha_proxy.v4v6: true, it enables dual-stack by creating one IPv6 socket that also accepts IPv4 connections via the kernel's IPv4-mapped IPv6 mechanism (::ffff:x.x.x.x).
This has two drawbacks:
-
IPv4-mapped addresses in logs -- All IPv4 client addresses appear as
::ffff:10.x.x.xbecause they arrive through the IPv6 socket. This may affect log parsing, ACL matching, and monitoring tools that expect plain IPv4 addresses. -
No separate socket option -- Some environments my require distinct IPv4 and IPv6 sockets (e.g., for independent firewall rules, clean logging, or compliance). The only workaround today is
ha_proxy.frontend_config, which is fragile because it applies to all frontends, requires manually duplicating TLS/ALPN/mTLS options, and forces disabling the HTTP frontend to avoid port conflicts.
Related bug
ha_proxy.v4v6 uses if_p (presence check) instead of checking the Boolean value. Since the property defaults to false, binding_ip: "::" always renders v4v6 regardless of the property value. On most Linux stemcells this is masked by the kernel default (net.ipv6.bindv6only=0), but it is incorrect behavior.
Options
Option A: Flat address list (implemented on branch)
- Auto-detects IPv4 vs IPv6 via IPAddr and applies v6only on IPv6 entries
- Makes IPv6 addresses explicitly IPv6 only
- Global scope: replaces binding_ip at all generated bind sites (HTTP, HTTPS, WSS, health checks, TCP routing, generic TCP)
- Validates for type, duplicates, and invalid IPs
- Rejects combination with v4v6: true
- Simplest API for the dominant use case (0.0.0.0 + ::)
- No explicit control over v4v6 vs v6only per address
ha_proxy:
binding_ips:
- 0.0.0.0
- "::"
Option B: Per-family lists
- Explicit control: operator chooses v4v6 or v6only per IPv6 address
- More complex API and validation (combinatorial: what if same address in multiple lists? IPv4 in v6only?)
- v4v6 list alongside v4 list creates overlapping socket ownership
- Less ergonomic in BOSH ops files (nested properties)
ha_proxy:
binding_ips:
v4:
- 0.0.0.0
v4v6:
- "::"
v6only:
- "::"
Option C: Flat list + mode flag
- Keeps the simple flat list
- Adds a single property to override the IPv6 socket behavior globally
- Covers the rare case where v4v6 is desired on listed IPv6 addresses
- Minimal additional complexity
ha_proxy:
binding_ips:
- 0.0.0.0
- "::"
binding_ips_v6_mode: v6only # default, or "v4v6"
Recommendation
Option A (flat list) covers ~95% of real-world usage. Option C is a reasonable extension if explicit v4v6 control is ever needed. Option B adds complexity without a clear use case that justifies it.
+++ Additional Remarks +++
When binding_ip is set to :: and the v4v6 flag is not set or false the configuration / acceptance of IPv4 traffic depends on the kernel / stemcell configuration. This makes it non-deterministic whether IPv4 traffic is accepted when binding ::.
Proposal
When binding_ip is set to :: and the v4v6 flag is not set or false only accept IPv6 traffic by setting the v6only flag.
+++ This is can be a breaking change +++
- Linguagem predominante
- Ruby
- Estrelas
- 36
- Forks
- 84
- Merge médio
- 2d 6h
- PRs com merge (30d)
- 11
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Issues semelhantes
-
Bug Ruby
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
getsentry/sentry-ruby#3211 · 1 comentário ·
Mantenedores costumam responder em até 2 dias
-
enhancement
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 66/100
internetee/registry#2984 ·
Mantenedores costumam responder em até 6 dias
-
interest-zsv
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 62/100
hitobito/hitobito_zsv#6 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
ecosyste-ms/issues#862 ·
Mantenedores costumam responder em até 1 dia
-
Redis Lua error `@user_script:52: ERR value is not an integer or out of range` when `window_size` is configuredTalvez já em andamento @mimosa assumiu hoje. Abertabug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
Mantenedores costumam responder em até 1 dia