(&self, mtu: i32)
| 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<()> { |
no test coverage detected