diff --git a/net-utils/src/lib.rs b/net-utils/src/lib.rs index dda59af209d20e..34092540c45573 100644 --- a/net-utils/src/lib.rs +++ b/net-utils/src/lib.rs @@ -343,6 +343,11 @@ pub fn parse_port_range(port_range: &str) -> Option { Some((start_port, end_port)) } +/// note: this is a very naive simplification done to support IPv6 bindings +/// +/// conversely it does not do hostname reverse lookup +/// +/// recommended values to use are `127.0.0.1`, `0.0.0.0`, or `::1` or `::` for binding pub fn parse_host(host: &str) -> Result { IpAddr::from_str(host) .map_err(|err| format!("Unable to parse host bind address <{}>: {}", host, err))