zeroclaw-labs/zeroclaw · error
NAT64 prefix is empty
Error message
NAT64 prefix is empty
What it means
Error "NAT64 prefix is empty" thrown in zeroclaw-labs/zeroclaw.
Source
Thrown at crates/zeroclaw-infra/src/net_guard.rs:613
impl std::fmt::Display for Nat64Prefix {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{}/{}", self.network, self.len)
}
}
impl Nat64Prefix {
/// Parse one `<ipv6>/<len>` entry, for example `"2001:db8:122:344::/96"`.
///
/// # Errors
///
/// Returns an error describing the problem when the entry has no `/`, does
/// not parse as an IPv6 address, uses a prefix length outside
/// RFC 6052 §2.2's `/32`, `/40`, `/48`, `/56`, `/64`, `/96`, or sets any
/// bit beyond the prefix length.
pub fn parse(raw: &str) -> anyhow::Result<Self> {
let entry = raw.trim();
if entry.is_empty() {
anyhow::bail!("NAT64 prefix is empty");
}
let (address, length) = entry
.split_once('/')
.ok_or_else(|| anyhow::Error::msg("missing '/<prefix-length>'"))?;
let network = address
.parse::<std::net::Ipv6Addr>()
.map_err(|e| anyhow::Error::msg(format!("'{address}' is not an IPv6 address: {e}")))?;
let len = length
.parse::<u8>()
.map_err(|e| anyhow::Error::msg(format!("'{length}' is not a prefix length: {e}")))?;
if !RFC6052_PREFIX_LENGTHS.contains(&len) {
anyhow::bail!(
"prefix length /{len} is not one of the RFC 6052 lengths /32, /40, /48, /56, /64, /96"
);
}View on GitHub (pinned to 88bb9c8533)
Solutions
- Provide a non-empty NAT64 prefix, e.g. 64:ff9b::/96.
When it happens
Trigger: Thrown at crates/zeroclaw-infra/src/net_guard.rs:613 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of zeroclaw-labs/zeroclaw@88bb9c8533 (2026-08-23).
Data as JSON: /api/errors/cde2861fd5cc80e5.
Report an issue: GitHub.