You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use nfqueue::{Queue,Verdict,Message};fncallback(msg:&Message,d:&mut()){println!(" -> msg: {}", msg);
msg.set_verdict(nfqueue::Verdict::Accept);}fnmain() -> Result<(),Box<dyn std::error::Error>>{letmut q = Queue::new(());
q.open();
q.create_queue(44, callback);
q.set_mode(nfqueue::CopyMode::CopyMeta,0xffff);//q.set_queuelen(1024); // linking fails with this
q.run_loop();
q.close();Ok(())}
Seems to be working in debug. But in release mode, it crashes:
#0 0x0000555555564850 in <nfqueue::message::Message as core::fmt::Display>::fmt ()
#1 0x00005555555840dc in core::fmt::write () at src/libcore/fmt/mod.rs:1028
#2 0x0000555555568981 in std::io::Write::write_fmt () at src/libstd/io/mod.rs:1412
#3 <std::io::stdio::Stdout as std::io::Write>::write_fmt () at src/libstd/io/stdio.rs:533
#4 0x00005555555691da in std::io::stdio::print_to::{{closure}} () at src/libstd/io/stdio.rs:786
#5 std::thread::local::LocalKey<T>::try_with () at src/libstd/thread/local.rs:262
#6 std::io::stdio::print_to () at src/libstd/io/stdio.rs:780
#7 std::io::stdio::_print () at src/libstd/io/stdio.rs:802
#8 0x00005555555644d8 in nfqnetsim::callback ()
#9 0x0000555555564249 in nfqueue::real_callback ()
#10 0x00007ffff7f5c3e9 in ?? () from /usr/lib/x86_64-linux-gnu/libnetfilter_queue.so.1
#11 0x00007ffff7b5573f in nfnl_handle_packet () from /usr/lib/x86_64-linux-gnu/libnfnetlink.so.0
#12 0x000055555556438f in nfqueue::Queue<T>::run_loop ()
#13 0x000055555556453b in nfqnetsim::main ()
#14 0x00005555555641f3 in std::rt::lang_start::{{closure}} ()
#15 0x000055555556dc93 in std::rt::lang_start_internal::{{closure}} () at src/libstd/rt.rs:48
#16 std::panicking::try::do_call () at src/libstd/panicking.rs:287
#17 0x000055555556f46a in __rust_maybe_catch_panic () at src/libpanic_unwind/lib.rs:78
#18 0x000055555556e6fd in std::panicking::try () at src/libstd/panicking.rs:265
#19 std::panic::catch_unwind () at src/libstd/panic.rs:396
#20 std::rt::lang_start_internal () at src/libstd/rt.rs:47
#21 0x0000555555564562 in main ()
Built with rustc 1.40.0-nightly (2477e2493 2019-11-04) and libnetfilter-queue-dev=1.0.3-1
The text was updated successfully, but these errors were encountered:
Program:
Seems to be working in debug. But in release mode, it crashes:
Built with
rustc 1.40.0-nightly (2477e2493 2019-11-04)
andlibnetfilter-queue-dev=1.0.3-1
The text was updated successfully, but these errors were encountered: