aboutsummaryrefslogtreecommitdiff
path: root/rustables/src/expr/masquerade.rs
diff options
context:
space:
mode:
Diffstat (limited to 'rustables/src/expr/masquerade.rs')
-rw-r--r--rustables/src/expr/masquerade.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/rustables/src/expr/masquerade.rs b/rustables/src/expr/masquerade.rs
index 66e9e0e..31b98c0 100644
--- a/rustables/src/expr/masquerade.rs
+++ b/rustables/src/expr/masquerade.rs
@@ -6,7 +6,11 @@ use std::os::raw::c_char;
pub struct Masquerade;
impl Expression for Masquerade {
+ fn get_raw_name() -> *const sys::libc::c_char {
+ b"masq\0" as *const _ as *const c_char
+ }
+
fn to_expr(&self, _rule: &Rule) -> *mut sys::nftnl_expr {
- try_alloc!(unsafe { sys::nftnl_expr_alloc(b"masq\0" as *const _ as *const c_char) })
+ try_alloc!(unsafe { sys::nftnl_expr_alloc(Self::get_raw_name()) })
}
}