]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
device: special case handling of dpdk devices
authorVictor Julien <vjulien@oisf.net>
Sun, 18 Dec 2022 06:46:44 +0000 (07:46 +0100)
committerVictor Julien <vjulien@oisf.net>
Tue, 20 Dec 2022 07:51:33 +0000 (08:51 +0100)
src/util-device.c

index 5aa8451b3f97a190c5a1001d7555d95a22ebc165..26220ecfb35bb5851efe97cdfe2cfea6d5f290f1 100644 (file)
@@ -247,6 +247,11 @@ static int LiveSafeDeviceName(const char *devname, char *newdevname, size_t dest
 
     /* If we have to shorten the interface name */
     if (devnamelen > MAX_DEVNAME) {
+        /* special mode for DPDK pci addresses */
+        if (devnamelen >= 5 && strncmp(devname, "0000:", 5) == 0) {
+            strlcpy(newdevname, devname + 5, destlen);
+            return 0;
+        }
 
         /* IF the dest length is over 10 chars long it will not do any
          * good for the shortening. The shortening is done due to the