diff --git a/src/netif.rs b/src/netif.rs index f609b713d5b..71be9f11ff8 100644 --- a/src/netif.rs +++ b/src/netif.rs @@ -599,16 +599,18 @@ impl EspNetif { Ok(()) } - #[cfg(esp_idf_lwip_ipv4_napt)] unsafe extern "C" fn napt_wrapper(ctx: *mut ffi::c_void) { - let ctx = unsafe { *(ctx as *mut (u8, i32)) }; + #[cfg(esp_idf_lwip_ipv4_napt)] + { + let ctx = unsafe { *(ctx as *mut (u8, i32)) }; - ip_napt_enable_no(ctx.0, ctx.1); + ip_napt_enable_no(ctx.0, ctx.1); + } } /// Enables or disables NAPT on this netif. /// - /// Enable operation can be performed only on one interface at a time. + /// Enable operation can be performed only on one interface at a time. /// NAPT cannot be enabled on multiple interfaces according to this implementation. #[cfg(esp_idf_lwip_ipv4_napt)] pub fn enable_napt(&mut self, enable: bool) -> Result<(), EspError> {