ukanth / afwall

AFWall+ (Android Firewall +) - iptables based firewall for Android
GNU General Public License v3.0
2.68k stars 447 forks source link

AFWall+ Log does not work on kernels without CONFIG_NETFILTER_XT_TARGET_LOG #1345

Open resolutecake opened 9 months ago

resolutecake commented 9 months ago

Describe the bug Logging prevents rules from being applied for some kernels symptom: toaster: “Error applying iptables rules” Pixel 3, Android 12: works Pixel 6, Android 12: does not work It seems all Androids have NFLOG but newer Androids do not have LOG the LOG target is not available, which can be checked:

zcat /proc/config.gz | grep CONFIG_NETFILTER_XT_TARGET_LOG
# CONFIG_NETFILTER_XT_TARGET_LOG is not set
zcat /proc/config.gz | grep CONFIG_NETFILTER_XT_TARGET_NFLOG
CONFIG_NETFILTER_XT_TARGET_NFLOG=y
iptables --new-chain X
iptables --append X --jump NFLOG
# OK
iptables --append X --jump LOG
iptables v1.8.7 (legacy): Couldn't find target `LOG'
Try `iptables -h' or 'iptables --help' for more information.

IMPACT: AFWall+ Log function cannot be used on devices that do not have the iptables LOG target

Firewall Logs N/A version: 3.6dev+

Smartphone (please complete the following information): Pixel 3/6

Additional context it is unclear how NFLOG can be directed to logcat on Android