summaryrefslogtreecommitdiff
path: root/sys/net/if_pflow.c
diff options
context:
space:
mode:
authorJoerg Goltermann <gollo@cvs.openbsd.org>2009-01-03 21:47:33 +0000
committerJoerg Goltermann <gollo@cvs.openbsd.org>2009-01-03 21:47:33 +0000
commit99afc494521d14340f4c89b68314b6784a258f9b (patch)
tree1ec14da4d8e967048a7e9e25b5cf405735d658b8 /sys/net/if_pflow.c
parentbbee3550e6b8d8b45d90685051c97f8a3f96213a (diff)
sync flow sequence ids on all used pflow interfaces.
OK henning@
Diffstat (limited to 'sys/net/if_pflow.c')
-rw-r--r--sys/net/if_pflow.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/sys/net/if_pflow.c b/sys/net/if_pflow.c
index fb04229b7f5..15c84a899b5 100644
--- a/sys/net/if_pflow.c
+++ b/sys/net/if_pflow.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_pflow.c,v 1.8 2008/11/26 18:01:43 dlg Exp $ */
+/* $OpenBSD: if_pflow.c,v 1.9 2009/01/03 21:47:32 gollo Exp $ */
/*
* Copyright (c) 2008 Henning Brauer <henning@openbsd.org>
@@ -212,9 +212,10 @@ pflowioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
case SIOCSIFFLAGS:
if ((ifp->if_flags & IFF_UP) &&
sc->sc_receiver_ip.s_addr != 0 &&
- sc->sc_receiver_port != 0)
+ sc->sc_receiver_port != 0) {
ifp->if_flags |= IFF_RUNNING;
- else
+ sc->sc_gcounter=pflowstats.pflow_flows;
+ } else
ifp->if_flags &= ~IFF_RUNNING;
break;
case SIOCSIFMTU:
@@ -261,9 +262,10 @@ pflowioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
if ((ifp->if_flags & IFF_UP) &&
sc->sc_receiver_ip.s_addr != 0 &&
- sc->sc_receiver_port != 0)
+ sc->sc_receiver_port != 0) {
ifp->if_flags |= IFF_RUNNING;
- else
+ sc->sc_gcounter=pflowstats.pflow_flows;
+ } else
ifp->if_flags &= ~IFF_RUNNING;
break;
@@ -467,7 +469,8 @@ pflow_pack_flow(struct pf_state *st, struct pflow_softc *sc)
}
}
- pflowstats.pflow_flows++;
+ if (pflowstats.pflow_flows == sc->sc_gcounter)
+ pflowstats.pflow_flows++;
sc->sc_gcounter++;
sc->sc_count++;
@@ -496,7 +499,8 @@ pflow_pack_flow(struct pf_state *st, struct pflow_softc *sc)
}
}
- pflowstats.pflow_flows++;
+ if (pflowstats.pflow_flows == sc->sc_gcounter)
+ pflowstats.pflow_flows++;
sc->sc_gcounter++;
sc->sc_count++;