udp: clean up

This commit is contained in:
Joakim Frostegård 2021-11-15 22:23:55 +01:00
parent f3e41148fe
commit 6bd63c2f5d
2 changed files with 0 additions and 29 deletions

View file

@ -269,18 +269,6 @@ impl Default for State {
}
}
}
pub fn ip_version_from_ip(ip: IpAddr) -> IpVersion {
match ip {
IpAddr::V4(_) => IpVersion::IPv4,
IpAddr::V6(ip) => {
if let [0, 0, 0, 0, 0, 0xffff, ..] = ip.segments() {
IpVersion::IPv4
} else {
IpVersion::IPv6
}
}
}
}
#[cfg(test)]
mod tests {