]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
eve: log mac addresses in packet direction
authorVictor Julien <vjulien@oisf.net>
Wed, 19 Oct 2022 12:26:53 +0000 (12:26 +0000)
committerVictor Julien <vjulien@oisf.net>
Wed, 19 Oct 2022 21:04:53 +0000 (23:04 +0200)
src/output-json.c

index 0d836cd17bd405276d2c13c818d59ac753420b5d..f95ae2012d52be7c88b5b66e76b8eecacca7f43b 100644 (file)
@@ -790,15 +790,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);
         }