{"record":{"id":"cde2861fd5cc80e5","repo":"zeroclaw-labs/zeroclaw","slug":"nat64-prefix-is-empty","errorCode":null,"errorMessage":"NAT64 prefix is empty","messagePattern":"NAT64 prefix is empty","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/zeroclaw-infra/src/net_guard.rs","lineNumber":613,"sourceCode":"impl std::fmt::Display for Nat64Prefix {\n    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {\n        write!(f, \"{}/{}\", self.network, self.len)\n    }\n}\n\nimpl Nat64Prefix {\n    /// Parse one `<ipv6>/<len>` entry, for example `\"2001:db8:122:344::/96\"`.\n    ///\n    /// # Errors\n    ///\n    /// Returns an error describing the problem when the entry has no `/`, does\n    /// not parse as an IPv6 address, uses a prefix length outside\n    /// RFC 6052 §2.2's `/32`, `/40`, `/48`, `/56`, `/64`, `/96`, or sets any\n    /// bit beyond the prefix length.\n    pub fn parse(raw: &str) -> anyhow::Result<Self> {\n        let entry = raw.trim();\n        if entry.is_empty() {\n            anyhow::bail!(\"NAT64 prefix is empty\");\n        }\n\n        let (address, length) = entry\n            .split_once('/')\n            .ok_or_else(|| anyhow::Error::msg(\"missing '/<prefix-length>'\"))?;\n\n        let network = address\n            .parse::<std::net::Ipv6Addr>()\n            .map_err(|e| anyhow::Error::msg(format!(\"'{address}' is not an IPv6 address: {e}\")))?;\n        let len = length\n            .parse::<u8>()\n            .map_err(|e| anyhow::Error::msg(format!(\"'{length}' is not a prefix length: {e}\")))?;\n\n        if !RFC6052_PREFIX_LENGTHS.contains(&len) {\n            anyhow::bail!(\n                \"prefix length /{len} is not one of the RFC 6052 lengths /32, /40, /48, /56, /64, /96\"\n            );\n        }","sourceCodeStart":595,"sourceCodeEnd":631,"githubUrl":"https://github.com/zeroclaw-labs/zeroclaw/blob/88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc/crates/zeroclaw-infra/src/net_guard.rs#L595-L631","documentation":"Error \"NAT64 prefix is empty\" thrown in zeroclaw-labs/zeroclaw.","triggerScenarios":"Thrown at crates/zeroclaw-infra/src/net_guard.rs:613 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide a non-empty NAT64 prefix, e.g. 64:ff9b::/96."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc","analyzedAt":"2026-08-23T01:07:41.857Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}