This patch fixes a warning message when suricata is started without
giving an interface name on the command line. The code was trying
to get the MTU even if pcap_dev was not set.
int GetIfaceMaxPacketSize(char *pcap_dev)
{
int ll_header = GetIfaceMaxHWHeaderLength(pcap_dev);
- int mtu = GetIfaceMTU(pcap_dev);
+ int mtu = 0;
+
+ if ((pcap_dev == NULL) || strlen(pcap_dev) == 0)
+ return 0;
+
+ mtu = GetIfaceMTU(pcap_dev);
switch (mtu) {
case 0:
case -1: