Skip to content

Conversation

@lidel
Copy link
Member

@lidel lidel commented Dec 18, 2025

the naive string replacement in checkPorts() could corrupt multiaddr IP addresses when the port number appeared in the IP portion.

for example, replacing port 0 in /ip4/127.0.0.1/tcp/0 would match the first 0 in 127.0.0.1, producing /ip4/127.5001.0.1/tcp/0.

this caused "invalid ip address" errors on startup when ports were busy.

fix by using /tcp/${port} pattern to match only the port component.

ref: https://discuss.ipfs.tech/t/invalid-ip-address/19925

the naive string replacement in checkPorts() could corrupt multiaddr
IP addresses when the port number appeared in the IP portion.

for example, replacing port `0` in `/ip4/127.0.0.1/tcp/0` would match
the first `0` in `127.0.0.1`, producing `/ip4/127.5001.0.1/tcp/0`.

this caused "invalid ip address" errors on startup when ports were busy.

fix by using `/tcp/${port}` pattern to match only the port component.

ref: https://discuss.ipfs.tech/t/invalid-ip-address/19925
@lidel lidel marked this pull request as ready for review December 18, 2025 06:46
@lidel lidel requested a review from a team as a code owner December 18, 2025 06:46
@lidel
Copy link
Member Author

lidel commented Dec 18, 2025

@lidel lidel self-assigned this Dec 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants