Re: [PATCH v2] netfilter: nf_log: fix error on write NONE to logger choice sysctl

From: Pablo Neira Ayuso
Date: Wed Jul 06 2016 - 05:22:25 EST


On Fri, Jul 01, 2016 at 04:53:54PM +0300, Pavel Tikhomirov wrote:
> It is hard to unbind nf-logger:
>
> echo NONE > /proc/sys/net/netfilter/nf_log/0
> bash: echo: write error: No such file or directory
>
> sysctl -w net.netfilter.nf_log.0=NONE
> sysctl: setting key "net.netfilter.nf_log.0": No such file or directory
> net.netfilter.nf_log.0 = NONE
>
> You need explicitly send '\0', for instance like:
>
> echo -e "NONE\0" > /proc/sys/net/netfilter/nf_log/0
>
> That seem to be strange, so fix it using proc_dostring.
>
> Now it works fine:
> modprobe nfnetlink_log
> echo nfnetlink_log > /proc/sys/net/netfilter/nf_log/0
> cat /proc/sys/net/netfilter/nf_log/0
> nfnetlink_log
> echo NONE > /proc/sys/net/netfilter/nf_log/0
> cat /proc/sys/net/netfilter/nf_log/0
> NONE

Applied, thanks.