Skip to main content

make_interface_name

Function make_interface_name 

Source
pub fn make_interface_name(parts: &[&str], suffix: &str) -> String
Expand description

Generate a Linux-safe interface name guaranteed to be <= 15 chars.

Joins the parts with - after a "zl-" prefix and appends -{suffix} if non-empty. When the result exceeds 15 characters, a deterministic hash of all parts is used instead to keep the name unique and within the kernel limit.

Kept in the agent (and re-exported from the crate root) because callers outside the overlay machinery — notably runtimes/wsl2_delegate.rs — still use it for deterministic naming. overlayd has its own private copy for the names it generates server-side; the two are identical by construction.