{"record":{"id":"8aee75d83b3799a4","repo":"cloudflare/quiche","slug":"unable-to-parse-bind-address","errorCode":null,"errorMessage":"unable to parse bind address","messagePattern":"unable to parse bind address","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"h3i/src/client/mod.rs","lineNumber":595,"sourceCode":"        *url::Url::parse(&x)\n            .unwrap()\n            .socket_addrs(|| None)\n            .unwrap()\n            .first()\n            .unwrap()\n    };\n\n    // Bind to INADDR_ANY or IN6ADDR_ANY depending on the IP family of the\n    // server address. This is needed on macOS and BSD variants that don't\n    // support binding to IN6ADDR_ANY for both v4 and v6.\n    let bind_addr = match peer_addr {\n        std::net::SocketAddr::V4(_) => format!(\"0.0.0.0:{}\", args.source_port),\n        std::net::SocketAddr::V6(_) => format!(\"[::]:{}\", args.source_port),\n    };\n\n    (\n        peer_addr,\n        bind_addr.parse().expect(\"unable to parse bind address\"),\n    )\n}\n","sourceCodeStart":577,"sourceCodeEnd":598,"githubUrl":"https://github.com/cloudflare/quiche/blob/9f96daa2c22a4468b0036fb0a0a3894eee6498b8/h3i/src/client/mod.rs#L577-L598","documentation":"resolve_socket_addrs builds a bind address string (0.0.0.0 or [::] plus --source-port) and panics via expect if it fails to parse as a SocketAddr. This only fails if the constructed string is malformed, which in practice means an invalid --source-port value.","triggerScenarios":"Passing a non-numeric or out-of-range --source-port (e.g. >65535 or empty) so the composed bind string fails SocketAddr parsing.","commonSituations":"Scripting h3i with an unvalidated port variable; typos like --source-port 99999.","solutions":["Pass a valid port number between 0 and 65535 for --source-port.","Omit --source-port to use an ephemeral port.","Validate the port in wrapper scripts before invoking h3i."],"exampleFix":"// before\nh3i --host_port example.com:443 --source-port 70000\n// after\nh3i --host_port example.com:443 --source-port 51000","handlingStrategy":"validation","validationCode":"let port: u16 = source_port.parse()\n    .map_err(|_| \"--source-port must be 0-65535\")?;","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate port range 0-65535 in wrapper scripts.","Quote shell variables to avoid empty values reaching the flag."],"tags":["cli","socket-address","binding","panic"],"backgroundTag":"invalid-config-value","analyzedSha":"9f96daa2c22a4468b0036fb0a0a3894eee6498b8","analyzedAt":"2026-09-08T11:27:09.536Z","contentChangedAt":"2026-09-08T11:27:09.536Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}