diff --git a/src/iface/ethernet.rs b/src/iface/ethernet.rs index a3c3552..1cb3410 100644 --- a/src/iface/ethernet.rs +++ b/src/iface/ethernet.rs @@ -250,9 +250,13 @@ impl<'b, 'c, DeviceT> Interface<'b, 'c, DeviceT> } /// Set the IPv4 gateway of the interface. + /// + /// # Panics + /// This function panics if the given address is not unicast. pub fn set_ipv4_gateway(&mut self, gateway: GatewayAddrT) where GatewayAddrT: Into> { self.inner.ipv4_gateway = gateway.into(); + self.inner.ipv4_gateway.map(|addr| InterfaceInner::check_gateway_addr(&addr)); } /// Transmit packets queued in the given sockets, and receive packets queued