Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/npf/npfd Treat EOF as a condition to re-open the pc...



details:   https://anonhg.NetBSD.org/src/rev/885f5f12964a
branches:  trunk
changeset: 827135:885f5f12964a
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Oct 16 11:18:43 2017 +0000

description:
Treat EOF as a condition to re-open the pcap socket. Since we've been woken
up by poll(2), there must be data to read. If there is not, our socket might
not be ok anymore.

diffstat:

 usr.sbin/npf/npfd/npfd.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 63fd71ef2624 -r 885f5f12964a usr.sbin/npf/npfd/npfd.c
--- a/usr.sbin/npf/npfd/npfd.c  Mon Oct 16 11:17:45 2017 +0000
+++ b/usr.sbin/npf/npfd/npfd.c  Mon Oct 16 11:18:43 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: npfd.c,v 1.8 2017/10/15 15:26:10 christos Exp $        */
+/*     $NetBSD: npfd.c,v 1.9 2017/10/16 11:18:43 christos Exp $        */
 
 /*-
  * Copyright (c) 2015 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: npfd.c,v 1.8 2017/10/15 15:26:10 christos Exp $");
+__RCSID("$NetBSD: npfd.c,v 1.9 2017/10/16 11:18:43 christos Exp $");
 
 #include <stdio.h>
 #include <string.h>
@@ -110,7 +110,7 @@
                                npfd_log_flush(log);
                                count = 0;
                        }
-                       if (npfd_log(log) < 0)
+                       if (npfd_log(log) <= 0)
                                npfd_log_pcap_reopen(log);
                }
 



Home | Main Index | Thread Index | Old Index