From 58bdf8124dc1ae95988efd6cb0956cc535512cb3 Mon Sep 17 00:00:00 2001 From: Toni Peter Date: Wed, 4 Dec 2024 10:41:56 +0100 Subject: [PATCH] Fix experimental build --- rust/src/nasl/builtin/host/mod.rs | 2 +- rust/src/nasl/builtin/raw_ip/packet_forgery.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rust/src/nasl/builtin/host/mod.rs b/rust/src/nasl/builtin/host/mod.rs index 9d57a0bc8..60d73bcc5 100644 --- a/rust/src/nasl/builtin/host/mod.rs +++ b/rust/src/nasl/builtin/host/mod.rs @@ -48,7 +48,7 @@ fn get_host_names(context: &Context) -> Result { } /// Return the target's IP address as IpAddr. -fn get_host_ip(context: &Context) -> Result { +pub fn get_host_ip(context: &Context) -> Result { let default_ip = "127.0.0.1"; let r_sock_addr = match context.target() { x if !x.is_empty() => IpAddr::from_str(x), diff --git a/rust/src/nasl/builtin/raw_ip/packet_forgery.rs b/rust/src/nasl/builtin/raw_ip/packet_forgery.rs index 3a477f2ff..71decc73a 100644 --- a/rust/src/nasl/builtin/raw_ip/packet_forgery.rs +++ b/rust/src/nasl/builtin/raw_ip/packet_forgery.rs @@ -2300,7 +2300,7 @@ fn nasl_send_capture( let frame = EthernetPacket::new(packet.data).ok_or_else(|| { FunctionErrorKind::Dirty("No possible to create a packet from buffer".to_string()) })?; - return Ok(NaslValue::Data(frame.payload().to_vec())); + Ok(NaslValue::Data(frame.payload().to_vec())) } Err(_) => Ok(NaslValue::Null), }