ufw show raw reset counters
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ufw |
Fix Released
|
Low
|
Unassigned |
Bug Description
Hello
ufw --version
ufw 0.36
on Ubuntu 18.04 LTS
0.35 on Ubuntu 16.04 LTS and github version on Ubuntu 18.04 LTS
behave similarly.
Problem
>sudo iptables -L -n -v
Chain INPUT (policy DROP 2 packets, 80 bytes)
(...à
>sudo ufw show raw
IPV4 (raw):
Chain INPUT (policy DROP 0 packets, 0 bytes)
The counter is reset to 0 (all global counters are reset as well)
that's because of self.initcaps() by default calling iptables -N to create a new test chain.
Changing code like this avoids the counter reset:
--- backend_
+++ backend_iptables.py 2019-10-10 15:06:45.440223758 +0200
@@ -170,7 +170,10 @@
return out
# Initialize the capabilities database
+ sav = self.do_checks
+ self.do_checks = False
+ self.do_checks = sav
args = ['-n', '-v', '-x', '-L']
items = []
Thanks for your report and analysis! I'll fix this along with a few other things in the next release of ufw.