]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
eve: log mac addresses in packet direction 8047/head
authorVictor Julien <vjulien@oisf.net>
Wed, 19 Oct 2022 12:26:53 +0000 (12:26 +0000)
committerVictor Julien <vjulien@oisf.net>
Thu, 20 Oct 2022 13:55:47 +0000 (15:55 +0200)
(cherry picked from commit 90f3823cadf76378f292c03b389986e12acf1aad)

src/output-json.c

index 57b42220020d2c784ec0361b00c6f72637225ed6..f26297257fa1f6fbea0bb37172e5669adcea9599 100644 (file)
@@ -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);
         }