MCPcopy Create free account
hub / github.com/cloud-hypervisor/cloud-hypervisor / set_mtu

Method set_mtu

net_util/src/tap.rs:442–450  ·  view source on GitHub ↗
(&self, mtu: i32)

Source from the content-addressed store, hash-verified

440 }
441
442 pub fn set_mtu(&self, mtu: i32) -> Result<()> {
443 let sock = create_unix_socket().map_err(Error::NetUtil)?;
444
445 let mut ifreq = self.get_ifreq();
446 ifreq.ifr_ifru.ifru_mtu = mtu;
447
448 // SAFETY: ioctl is safe. Called with a valid sock fd, and we check the return.
449 unsafe { Self::ioctl_with_ref(&sock, libc::SIOCSIFMTU as c_ulong, &ifreq) }
450 }
451
452 /// Set the offload flags for the tap interface.
453 pub fn set_offload(&self, flags: c_uint) -> Result<()> {

Callers 2

open_tap_rx_q_0Function · 0.80
from_tap_fdsMethod · 0.80

Calls 2

create_unix_socketFunction · 0.85
get_ifreqMethod · 0.80

Tested by

no test coverage detected