afwall icon indicating copy to clipboard operation
afwall copied to clipboard

[ISSUE] AFWall+ v3.6.0 Duplicate Rules in Chain "afwall" Defined by Custom Script after Switching Interface

Open coldspring67 opened this issue 2 years ago • 1 comments

*** Issue *** After switching the interface the rules in chain "afwall" from a custom script are duplicated.

*** Steps to reproduce the problem ***

  1. Clear custom script in AFWall+
  2. Wifi on and 4G off
  3. Define a custom script which adds one or more rules to chain "afwall": a) Define a rule directly (e.g. "IPTABLES=/system/bin/iptables; $IPTABLES -A "afwall" -d 22.22.22.0/21 -j REJECT") or b) Include a script with rules (e.g. ". /data/local/rules.sh")
  4. Wifi off
  5. 4G on -> the rules in chain "afwall" from custom script are there twice
  6. 4G off
  7. Wifi on -> the rules in chain "afwall" from custom script are there three times

*** Expected behaviour *** The rules in chain "afwall" from custom script are there once even after switching interface, because: "Please note that all those chains [afwall etc.] are guaranteed to be cleared before the custom script is executed, so you don't need to worry about rules cleanup on your script IF you are using those chains." (https://github.com/ukanth/afwall/wiki/CustomScripts#adding-custom-rules)

*** Hard- and software *** Device: Samsung Galaxy S5 SM-G900F Android OS: LineageOS v18.1 (Android 11) AFWall+: v3.6.0 from F-Droid (profile mode: whitelist) Superuser: Magisk v24.3

Please let me know, if further information is needed.

Thank you, ukanth for great work!

coldspring67 avatar Nov 29 '23 21:11 coldspring67

I'm seeing a similar behavior adding a rule to afwall-wifi chain

Fry-kun avatar Dec 25 '23 00:12 Fry-kun