Page MenuHomeFreeBSD

D40336.diff
No OneTemporary

D40336.diff

diff --git a/sys/netinet/siftr.c b/sys/netinet/siftr.c
--- a/sys/netinet/siftr.c
+++ b/sys/netinet/siftr.c
@@ -379,6 +379,22 @@
if (hash_node == NULL) {
return;
+ } else if (siftr_pkts_per_log > 1) {
+ /*
+ * Taking the remainder of the counter divided
+ * by the current value of siftr_pkts_per_log
+ * and storing that in counter provides a neat
+ * way to modulate the frequency of log
+ * messages being written to the log file.
+ */
+ hash_node->counter = (hash_node->counter + 1) %
+ siftr_pkts_per_log;
+ /*
+ * If we have not seen enough packets since the last time
+ * we wrote a log message for this connection, return.
+ */
+ if (hash_node->counter > 0)
+ return;
}
log_buf = alq_getn(siftr_alq, MAX_LOG_MSG_LEN, ALQ_WAITOK);

File Metadata

Mime Type
text/plain
Expires
Wed, Feb 5, 6:19 PM (21 h, 23 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16478658
Default Alt Text
D40336.diff (783 B)

Event Timeline