Skip to content

Commit

Permalink
ike: do not log empty notify array
Browse files Browse the repository at this point in the history
Ticket: OISF#5167
  • Loading branch information
catenacyber authored and benignbala committed Nov 12, 2022
1 parent 74c2d96 commit 89339ee
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions rust/src/ike/logger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,12 +214,14 @@ fn log_ikev2(tx: &IKETransaction, jb: &mut JsonBuilder) -> Result<(), JsonError>
jb.open_object("ikev2")?;

jb.set_uint("errors", tx.errors as u64)?;
jb.open_array("notify")?;
for notify in tx.notify_types.iter() {
jb.append_string(&format!("{:?}", notify))?;
if !tx.notify_types.is_empty() {
jb.open_array("notify")?;
for notify in tx.notify_types.iter() {
jb.append_string(&format!("{:?}", notify))?;
}
jb.close()?;
}
jb.close()?;
jb.close()?;
Ok(())
}

Expand Down

0 comments on commit 89339ee

Please sign in to comment.