Make pflogd cope with module unload (and the sudden disappearing of pflog0).

Instead of eating all the available CPU we now shutdown gracefully.

Submitted by:	yongari
MFC after:	3 days
This commit is contained in:
Max Laier 2004-10-05 08:26:34 +00:00
parent 90d186c0cb
commit 22d6889b4d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=136141

View File

@ -656,8 +656,16 @@ main(int argc, char **argv)
while (1) {
np = pcap_dispatch(hpcap, PCAP_NUM_PKTS,
dump_packet, (u_char *)dpcap);
if (np < 0)
if (np < 0) {
#ifdef __FreeBSD__
if (errno == ENXIO) {
logmsg(LOG_ERR,
"Device not/no longer configured");
break;
}
#endif
logmsg(LOG_NOTICE, "%s", pcap_geterr(hpcap));
}
if (gotsig_close)
break;