Skip to content

fix: Add IPv6 support for bind parameter#240

Open
I501307 wants to merge 3 commits intofluent:masterfrom
I501307:fix/ipv6-bind-support
Open

fix: Add IPv6 support for bind parameter#240
I501307 wants to merge 3 commits intofluent:masterfrom
I501307:fix/ipv6-bind-support

Conversation

@I501307
Copy link

@I501307 I501307 commented Jan 28, 2026

Fixes two IPv6-related bugs when using bind='::':

  1. Log message construction: Previously created invalid URL 'http://:::24231' instead of 'http://[::]:24231'

  2. Worker aggregation: When bind is '::', the code tried to connect to '::' directly instead of converting it to '::1' (IPv6 localhost), causing connection failures

Changes:

  • Add bracket notation for IPv6 addresses in log messages
  • Convert '::' to '::1' for inter-worker communication
  • Maintain backward compatibility with IPv4 addresses

Fixes #229

Fixes two IPv6-related bugs when using bind='::':

1. Log message construction: Previously created invalid URL
   'http://:::24231' instead of 'http://[::]:24231'

2. Worker aggregation: When bind is '::', the code tried to
   connect to '::' directly instead of converting it to '::1'
   (IPv6 localhost), causing connection failures

Changes:
- Add bracket notation for IPv6 addresses in log messages
- Convert '::' to '::1' for inter-worker communication
- Maintain backward compatibility with IPv4 addresses

Fixes fluent#229

Signed-off-by: Jesse Awan <jesse.awan@sap.com>
@I501307 I501307 force-pushed the fix/ipv6-bind-support branch from 82ad754 to be6af88 Compare January 28, 2026 10:13
@I501307
Copy link
Author

I501307 commented Jan 29, 2026

Could a maintainer please add the bug label? This fixes a crash affecting all Fluentd versions when binding to IPv6 addresses.

@I501307
Copy link
Author

I501307 commented Feb 9, 2026

@Watson1978 @kenhys isn't this more or less the same problem : fluent/fluentd#5239

@Watson1978
Copy link
Contributor

Can you add the tests?

- Add ipv6_enabled? helper to detect IPv6 support
- Add integration tests for IPv6 loopback (::1), any (::), and pre-bracketed addresses
- Refactor tests using shared_examples pattern to reduce duplication (60 → 35 lines)
- Handle pre-bracketed addresses by stripping brackets before socket binding
- Pass bracketed IPv6 addresses to http_server helper for proper URI construction
- All IPv6 tests pass on systems with IPv6 support, skip gracefully otherwise
- Add /vendor/ to .gitignore for local bundle installations

Signed-off-by: Jesse Awan <jesse.awan@sap.com>
@I501307 I501307 force-pushed the fix/ipv6-bind-support branch from b207100 to 456e024 Compare February 10, 2026 14:22
@I501307
Copy link
Author

I501307 commented Feb 10, 2026

456e024

ah I did this here 456e024

@I501307
Copy link
Author

I501307 commented Feb 10, 2026

@Watson1978 can you try triggering github unit tests so we can verify? 🌻

Signed-off-by: Jesse Awan <jesse.awan@sap.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants