From bf66948ad76db33c568882c064876d09c0dbdb0d Mon Sep 17 00:00:00 2001 From: Pierre Chifflier Date: Thu, 15 Mar 2018 08:27:17 +0100 Subject: [PATCH] IKEv2: suppress some debug output --- rust/src/ikev2/ikev2.rs | 9 ++++----- src/output-json-ikev2.c | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/rust/src/ikev2/ikev2.rs b/rust/src/ikev2/ikev2.rs index 56a2fe220f..39941367a1 100644 --- a/rust/src/ikev2/ikev2.rs +++ b/rust/src/ikev2/ikev2.rs @@ -129,16 +129,15 @@ impl IKEV2State { fn parse(&mut self, i: &[u8], direction: u8) -> i8 { match parse_ikev2_header(i) { IResult::Done(rem,ref hdr) => { - SCLogDebug!("parse_ikev2: {:?}",hdr); if rem.len() == 0 && hdr.length == 28 { return 1; } // Rule 0: check version if hdr.maj_ver != 2 || hdr.min_ver != 0 { - SCLogInfo!("Unknown header version: {}.{}", hdr.maj_ver, hdr.min_ver); + self.set_event(IKEV2Event::MalformedData); + return -1; } if hdr.init_spi == 0 { - SCLogInfo!("Malformed SPI - wrong length"); self.set_event(IKEV2Event::MalformedData); return -1; } @@ -184,13 +183,13 @@ impl IKEV2State { // XXX TSr // XXX IDr _ => { - SCLogInfo!("Unknown payload content {:?}", payload.content); + SCLogDebug!("Unknown payload content {:?}", payload.content); }, } self.connection_state = self.connection_state.advance(payload); }; }, - e @ _ => SCLogInfo!("parse_ikev2_payload_with_type: {:?}",e), + e => { SCLogDebug!("parse_ikev2_payload_with_type: {:?}",e); () }, } self.transactions.push(tx); 1 diff --git a/src/output-json-ikev2.c b/src/output-json-ikev2.c index efba7980ab..230797fc8a 100644 --- a/src/output-json-ikev2.c +++ b/src/output-json-ikev2.c @@ -72,7 +72,7 @@ static int JsonIKEv2Logger(ThreadVars *tv, void *thread_data, LogIKEv2LogThread *thread = thread_data; json_t *js, *ikev2js; - js = CreateJSONHeader((Packet *)p, 0, "ikev2"); + js = CreateJSONHeader((Packet *)p, LOG_DIR_PACKET, "ikev2"); if (unlikely(js == NULL)) { return TM_ECODE_FAILED; }