mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
net_util: Replace use of rand crate with libc::getrandom()
The rand crate provides a full cross platform true cryptographic random number implementation. As such it brings it lots of othe dependencies and increases our binary size and compile time. This is excessive for generating a MAC address. From the cargo tree output: │ │ ├── rand v0.8.3 │ │ │ ├── libc v0.2.86 │ │ │ ├── rand_chacha v0.3.0 │ │ │ │ ├── ppv-lite86 v0.2.10 │ │ │ │ └── rand_core v0.6.0 │ │ │ │ └── getrandom v0.2.0 │ │ │ │ ├── cfg-if v0.1.10 │ │ │ │ └── libc v0.2.86 │ │ │ └── rand_core v0.6.0 (*) And cargo bloat: 0.0% 0.4% 40.4KiB rand_chacha rand_chacha::guts::refill_wide::impl_sse2 0.0% 0.4% 40.0KiB rand_chacha rand_chacha::guts::refill_wide::impl_ssse3 0.0% 0.3% 37.6KiB rand_chacha rand_chacha::guts::refill_wide::impl_avx 0.0% 0.3% 37.2KiB rand_chacha rand_chacha::guts::refill_wide::impl_sse41 0.0% 0.2% 26.1KiB rand_chacha rand_chacha::guts::refill_wide::impl_avx2 Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
@@ -8,7 +8,6 @@ epoll = ">=4.0.1"
|
||||
libc = "0.2.86"
|
||||
log = "0.4.14"
|
||||
net_gen = { path = "../net_gen" }
|
||||
rand = "0.8.3"
|
||||
serde = "1.0.123"
|
||||
virtio-bindings = "0.1.0"
|
||||
vm-memory = { version = "0.5.0", features = ["backend-mmap", "backend-atomic"] }
|
||||
|
||||
Reference in New Issue
Block a user