Commit acf98286 authored by zu1k's avatar zu1k

gen_rang_ipv6 use or

parent 74fedcf7
......@@ -107,6 +107,6 @@ fn get_rand_ipv6(mut ipv6: u128, prefix_len: u8) -> IpAddr {
let rand: u128 = rand::thread_rng().gen();
let net_part = (ipv6 >> (128 - prefix_len)) << (128 - prefix_len);
let host_part = (rand << prefix_len) >> prefix_len;
ipv6 = net_part + host_part;
ipv6 = net_part | host_part;
IpAddr::V6(ipv6.into())
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment