diff options
author | Cedric Berger <cedric@cvs.openbsd.org> | 2004-02-09 13:27:51 +0000 |
---|---|---|
committer | Cedric Berger <cedric@cvs.openbsd.org> | 2004-02-09 13:27:51 +0000 |
commit | fa358f23df6803279e999958829fbfcfb25f05b7 (patch) | |
tree | 430c0cba38b013a1718015130d55fce074e351a1 | |
parent | 907adb8fef2a3078e457c2dcea2515948b735d66 (diff) |
Repair "set loginterface". Don't flush stats on pfctl -e. pf_status.since
is the time of last "pf -e" or "pf -d". ok dhartmei@ henning@
-rw-r--r-- | sys/net/pf_if.c | 4 | ||||
-rw-r--r-- | sys/net/pf_ioctl.c | 17 |
2 files changed, 6 insertions, 15 deletions
diff --git a/sys/net/pf_if.c b/sys/net/pf_if.c index 4c1c2c99bc7..c6b322021c2 100644 --- a/sys/net/pf_if.c +++ b/sys/net/pf_if.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf_if.c,v 1.5 2004/01/07 19:58:54 markus Exp $ */ +/* $OpenBSD: pf_if.c,v 1.6 2004/02/09 13:27:50 cedric Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -775,7 +775,7 @@ pfi_skip_if(const char *filter, struct pfi_kif *p, int f) return (1); if (filter == NULL || !*filter) return (0); - return !strncmp(p->pfik_name, filter, strlen(filter)); + return strncmp(p->pfik_name, filter, strlen(filter)); } /* from pf_print_state.c */ diff --git a/sys/net/pf_ioctl.c b/sys/net/pf_ioctl.c index 33637b5467d..19965dadf28 100644 --- a/sys/net/pf_ioctl.c +++ b/sys/net/pf_ioctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf_ioctl.c,v 1.101 2004/02/04 10:43:18 mcbride Exp $ */ +/* $OpenBSD: pf_ioctl.c,v 1.102 2004/02/09 13:27:50 cedric Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -813,18 +813,7 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p) if (pf_status.running) error = EEXIST; else { - u_int64_t stateid = pf_status.stateid; - u_int32_t states = pf_status.states; - u_int32_t debug = pf_status.debug; - u_int32_t hostid = pf_status.hostid; - u_int32_t src_nodes = pf_status.src_nodes; - bzero(&pf_status, sizeof(struct pf_status)); pf_status.running = 1; - pf_status.states = states; - pf_status.debug = debug; - pf_status.stateid = stateid; - pf_status.hostid = hostid; - pf_status.states = src_nodes; pf_status.since = time.tv_sec; DPFPRINTF(PF_DEBUG_MISC, ("pf: started\n")); } @@ -835,6 +824,7 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p) error = ENOENT; else { pf_status.running = 0; + pf_status.since = time.tv_sec; DPFPRINTF(PF_DEBUG_MISC, ("pf: stopped\n")); } break; @@ -1426,7 +1416,8 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p) bzero(pf_status.fcounters, sizeof(pf_status.fcounters)); bzero(pf_status.scounters, sizeof(pf_status.scounters)); if (*pf_status.ifname) - pfi_clr_istats(pf_status.ifname, NULL, 0); + pfi_clr_istats(pf_status.ifname, NULL, + PFI_FLAG_INSTANCE); break; } |