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:
parent
90d186c0cb
commit
22d6889b4d
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=136141
@ -656,8 +656,16 @@ main(int argc, char **argv)
|
|||||||
while (1) {
|
while (1) {
|
||||||
np = pcap_dispatch(hpcap, PCAP_NUM_PKTS,
|
np = pcap_dispatch(hpcap, PCAP_NUM_PKTS,
|
||||||
dump_packet, (u_char *)dpcap);
|
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));
|
logmsg(LOG_NOTICE, "%s", pcap_geterr(hpcap));
|
||||||
|
}
|
||||||
|
|
||||||
if (gotsig_close)
|
if (gotsig_close)
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user