diff options
author | mlaier <mlaier@FreeBSD.org> | 2004-10-05 08:26:34 +0000 |
---|---|---|
committer | mlaier <mlaier@FreeBSD.org> | 2004-10-05 08:26:34 +0000 |
commit | c5e647a2a2fa75aa1f5c201c4f0375463d7ac777 (patch) | |
tree | 3a10a20f5070d5d655a3494b0c3ce36cc7deb710 /contrib | |
parent | d9df4f59eb5718a5dc0f99e9f888ca454723eaa2 (diff) | |
download | FreeBSD-src-c5e647a2a2fa75aa1f5c201c4f0375463d7ac777.zip FreeBSD-src-c5e647a2a2fa75aa1f5c201c4f0375463d7ac777.tar.gz |
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
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/pf/pflogd/pflogd.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/contrib/pf/pflogd/pflogd.c b/contrib/pf/pflogd/pflogd.c index cb27197..a8c3863 100644 --- a/contrib/pf/pflogd/pflogd.c +++ b/contrib/pf/pflogd/pflogd.c @@ -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; |