Commit efbb2d3
authored
fix: prevent port replacement from corrupting IP addresses (#3035)
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/199251 parent bcc1f32 commit efbb2d3
1 file changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
419 | 419 | | |
420 | 420 | | |
421 | 421 | | |
422 | | - | |
| 422 | + | |
423 | 423 | | |
424 | 424 | | |
425 | 425 | | |
426 | | - | |
| 426 | + | |
427 | 427 | | |
428 | 428 | | |
429 | 429 | | |
| |||
0 commit comments