build: Bump getrandom from 0.2.15 to 0.3.1

Manually bump `getrandom` due to API changes.

Bumps [getrandom](https://github.com/rust-random/getrandom) from 0.2.15 to 0.3.1.
- [Changelog](https://github.com/rust-random/getrandom/blob/master/CHANGELOG.md)
- [Commits](rust-random/getrandom@v0.2.15...v0.3.1)

Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
This commit is contained in:
Ruoqing He
2025-02-11 07:40:16 +08:00
parent dc9142f86c
commit 07b7457c2e
3 changed files with 38 additions and 8 deletions

View File

@@ -6,7 +6,7 @@ version = "0.1.0"
[dependencies]
epoll = "4.3.3"
getrandom = "0.2.15"
getrandom = "0.3.1"
libc = "0.2.167"
log = "0.4.22"
net_gen = { path = "../net_gen" }

View File

@@ -80,7 +80,7 @@ impl MacAddr {
pub fn local_random() -> MacAddr {
// Generate a fully random MAC
let mut random_bytes = [0u8; MAC_ADDR_LEN];
if let Err(e) = getrandom::getrandom(&mut random_bytes) {
if let Err(e) = getrandom::fill(&mut random_bytes) {
error!(
"Error populating MAC address with random data: {}",
e.to_string()