From: Victor Julien Date: Sun, 18 Dec 2022 06:46:44 +0000 (+0100) Subject: device: special case handling of dpdk devices X-Git-Tag: suricata-7.0.0-rc1~238 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cdac0425a8d7a0bdade081d4a2a8f566e0030fab;p=thirdparty%2Fsuricata.git device: special case handling of dpdk devices --- diff --git a/src/util-device.c b/src/util-device.c index 5aa8451b3f..26220ecfb3 100644 --- a/src/util-device.c +++ b/src/util-device.c @@ -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