summaryrefslogtreecommitdiffstats
path: root/kernel/linux
diff options
context:
space:
mode:
authorBart De Schuymer <bdschuym@pandora.be>2002-10-17 22:00:23 +0000
committerBart De Schuymer <bdschuym@pandora.be>2002-10-17 22:00:23 +0000
commit9cccad8f789437174f3ff74af27a226de23b0b25 (patch)
tree1bc8eb08840829148f10164c7a95def20d25fc50 /kernel/linux
parenta4f30f836a524445cf45689c4d6167c2257911de (diff)
add bcnt
Diffstat (limited to 'kernel/linux')
-rw-r--r--kernel/linux/include/linux/netfilter_bridge/ebtables.h1
-rw-r--r--kernel/linux/net/bridge/netfilter/ebtables.c9
2 files changed, 8 insertions, 2 deletions
diff --git a/kernel/linux/include/linux/netfilter_bridge/ebtables.h b/kernel/linux/include/linux/netfilter_bridge/ebtables.h
index ccb62d8..17f4d80 100644
--- a/kernel/linux/include/linux/netfilter_bridge/ebtables.h
+++ b/kernel/linux/include/linux/netfilter_bridge/ebtables.h
@@ -30,6 +30,7 @@
struct ebt_counter
{
uint64_t pcnt;
+ uint64_t bcnt;
};
struct ebt_entries {
diff --git a/kernel/linux/net/bridge/netfilter/ebtables.c b/kernel/linux/net/bridge/netfilter/ebtables.c
index fafec9f..f002ff5 100644
--- a/kernel/linux/net/bridge/netfilter/ebtables.c
+++ b/kernel/linux/net/bridge/netfilter/ebtables.c
@@ -194,6 +194,7 @@ unsigned int ebt_do_table (unsigned int hook, struct sk_buff **pskb,
// increase counter
(*(counter_base + i)).pcnt++;
+ (*(counter_base + i)).bcnt+=(**pskb).len;
// these should only watch: not modify, nor tell us
// what to do with the packet
@@ -885,8 +886,10 @@ static void get_counters(struct ebt_counter *oldcounters,
// add other counters to those of cpu 0
for (cpu = 1; cpu < smp_num_cpus; cpu++) {
counter_base = COUNTER_BASE(oldcounters, nentries, cpu);
- for (i = 0; i < nentries; i++)
+ for (i = 0; i < nentries; i++) {
counters[i].pcnt += counter_base[i].pcnt;
+ counters[i].bcnt += counter_base[i].bcnt;
+ }
}
}
@@ -1245,8 +1248,10 @@ static int update_counters(void *user, unsigned int len)
write_lock_bh(&t->lock);
// we add to the counters of the first cpu
- for (i = 0; i < hlp.num_counters; i++)
+ for (i = 0; i < hlp.num_counters; i++) {
t->private->counters[i].pcnt += tmp[i].pcnt;
+ t->private->counters[i].bcnt += tmp[i].bcnt;
+ }
write_unlock_bh(&t->lock);
ret = 0;