summaryrefslogtreecommitdiffstats
path: root/kernel/linux2.5/net/bridge/netfilter/ebtables.c
diff options
context:
space:
mode:
authorBart De Schuymer <bdschuym@pandora.be>2002-10-21 17:15:28 +0000
committerBart De Schuymer <bdschuym@pandora.be>2002-10-21 17:15:28 +0000
commit0e94191d9d71bd19f9bf7403f014ffeb5671ff72 (patch)
tree611b224b5b87dcbfb5e59a959e1b52578ae73827 /kernel/linux2.5/net/bridge/netfilter/ebtables.c
parenta1f96e8a213d6f46aeb92f0057152b0f1268e087 (diff)
add byte counter
Diffstat (limited to 'kernel/linux2.5/net/bridge/netfilter/ebtables.c')
-rw-r--r--kernel/linux2.5/net/bridge/netfilter/ebtables.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/kernel/linux2.5/net/bridge/netfilter/ebtables.c b/kernel/linux2.5/net/bridge/netfilter/ebtables.c
index ab9e4c5..8e7d761 100644
--- a/kernel/linux2.5/net/bridge/netfilter/ebtables.c
+++ b/kernel/linux2.5/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 < NR_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;