From 9251775856d8ef7f39c408d47b9f856397a1ff1b Mon Sep 17 00:00:00 2001 From: Datong Sun Date: Thu, 16 Sep 2021 21:43:26 -0700 Subject: [PATCH] fix(fake_tcp) reduce log verbosity for bad SYN packets --- src/fake_tcp/mod.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/fake_tcp/mod.rs b/src/fake_tcp/mod.rs index bf4201e..6658810 100644 --- a/src/fake_tcp/mod.rs +++ b/src/fake_tcp/mod.rs @@ -1,7 +1,7 @@ pub mod packet; use bytes::{Bytes, BytesMut}; -use log::info; +use log::{info, trace}; use packet::*; use pnet::packet::{tcp, Packet}; use rand::prelude::*; @@ -394,7 +394,7 @@ impl Stack { assert!(shared.tuples.lock().unwrap().insert(tuple, Arc::new(incoming)).is_none()); tokio::spawn(sock.accept()); } else { - info!("Bad TCP SYN packet from {}, sending RST", remote_addr); + trace!("Bad TCP SYN packet from {}, sending RST", remote_addr); let buf = build_tcp_packet( local_addr, remote_addr, @@ -406,7 +406,7 @@ impl Stack { shared.outgoing.try_send(buf).unwrap(); } } else if (tcp_packet.get_flags() & tcp::TcpFlags::RST) == 0 { - info!("Bad TCP packet from {}, sending RST", remote_addr); + info!("Unknown TCP packet from {}, sending RST", remote_addr); let buf = build_tcp_packet( local_addr, remote_addr,