From 2403af5177859241c62d77a2f9b3b351bb3bfe37 Mon Sep 17 00:00:00 2001 From: Jason Ish Date: Fri, 29 Jul 2016 10:47:23 -0600 Subject: [PATCH] pcap: don't fail with --pcap with no device present Issue: 1856. A device with the name of "" (empty string) was being added with LiveRegisterDevice which failed to initialize causing Suricata to fail. --- src/suricata.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/suricata.c b/src/suricata.c index a6e3e1f7b1..28e764f666 100644 --- a/src/suricata.c +++ b/src/suricata.c @@ -1167,7 +1167,9 @@ static int ParseCommandLinePcapLive(SCInstance *suri, const char *optarg) if (suri->run_mode == RUNMODE_UNKNOWN) { suri->run_mode = RUNMODE_PCAP_DEV; - LiveRegisterDevice(suri->pcap_dev); + if (optarg) { + LiveRegisterDevice(suri->pcap_dev); + } } else if (suri->run_mode == RUNMODE_PCAP_DEV) { #ifdef OS_WIN32 SCLogError(SC_ERR_PCAP_MULTI_DEV_NO_SUPPORT, "pcap multi dev " -- 2.47.2