diff options
Diffstat (limited to 'rustables/src/expr/verdict.rs')
-rw-r--r-- | rustables/src/expr/verdict.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/rustables/src/expr/verdict.rs b/rustables/src/expr/verdict.rs index dc006bb..0c87a8e 100644 --- a/rustables/src/expr/verdict.rs +++ b/rustables/src/expr/verdict.rs @@ -90,9 +90,7 @@ impl Verdict { reject_type: RejectionType, family: ProtoFamily, ) -> *mut sys::nftnl_expr { - let expr = try_alloc!(sys::nftnl_expr_alloc( - b"reject\0" as *const _ as *const c_char - )); + let expr = try_alloc!(sys::nftnl_expr_alloc(Self::get_raw_name())); sys::nftnl_expr_set_u32( expr, @@ -120,6 +118,10 @@ impl Verdict { } impl Expression for Verdict { + fn get_raw_name() -> *const libc::c_char { + b"reject\0" as *const _ as *const c_char + } + fn to_expr(&self, rule: &Rule) -> *mut sys::nftnl_expr { let immediate_const = match *self { Verdict::Drop => libc::NF_DROP, |