From 985b93e80f89c970a6118f200ce6b7decb6e3117 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Wed, 19 Oct 2022 12:26:53 +0000 Subject: [PATCH] eve: log mac addresses in packet direction (cherry picked from commit 90f3823cadf76378f292c03b389986e12acf1aad) --- src/output-json.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/output-json.c b/src/output-json.c index 57b4222002..f26297257f 100644 --- a/src/output-json.c +++ b/src/output-json.c @@ -833,15 +833,9 @@ int CreateJSONEther(JsonBuilder *js, const Packet *p, const Flow *f) } } else { /* this is a packet context, so we need to add scalar fields */ - uint8_t *src, *dst; if (p->ethh != NULL) { - if ((PKT_IS_TOCLIENT(p))) { - src = p->ethh->eth_dst; - dst = p->ethh->eth_src; - } else { - src = p->ethh->eth_src; - dst = p->ethh->eth_dst; - } + uint8_t *src = p->ethh->eth_src; + uint8_t *dst = p->ethh->eth_dst; JSONFormatAndAddMACAddr(js, "src_mac", src, false); JSONFormatAndAddMACAddr(js, "dest_mac", dst, false); } -- 2.47.2