From: Florian Forster Date: Sat, 28 Feb 2009 09:29:08 +0000 (+0100) Subject: dns plugin: Don't pass a NULL pointer to `pcap_open_live'. X-Git-Tag: collectd-4.6.2~12^2 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=b0608a28c996eae0dd407886154f6e8797b3545c;p=collectd.git 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 ;) --- 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,