From b0608a28c996eae0dd407886154f6e8797b3545c Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Sat, 28 Feb 2009 10:29:08 +0100 Subject: [PATCH] dns plugin: Don't pass a NULL pointer to `pcap_open_live'. Although the documentation states clearly, that passing a NULL pointer as device is okay and handled like "any", doing so will crash the daemon on some systems, most notably *BSDs but Linux users have reported this behavior, too. This patch passes "any" when the pointer it NULL, which reportedly resulted in a different behavior, but still crashing the daemon. We'll keep trying ;) --- src/dns.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dns.c b/src/dns.c index c04169fe..4d3106b7 100644 --- a/src/dns.c +++ b/src/dns.c @@ -212,7 +212,7 @@ static void *dns_child_loop (void *dummy) /* Passing `pcap_device == NULL' is okay and the same as passign "any" */ DEBUG ("Creating PCAP object.."); - pcap_obj = pcap_open_live (pcap_device, + pcap_obj = pcap_open_live ((pcap_device != NULL) ? pcap_device : "any", PCAP_SNAPLEN, 0 /* Not promiscuous */, interval_g, -- 2.30.2