Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FS#3977 - fw3: ipset timeout option ignored when set to zero #8976

Closed
openwrt-bot opened this issue Aug 12, 2021 · 1 comment
Closed

FS#3977 - fw3: ipset timeout option ignored when set to zero #8976

openwrt-bot opened this issue Aug 12, 2021 · 1 comment
Labels

Comments

@openwrt-bot
Copy link

jorne-tremani:

When I define a timeout of 0 in a firewall config ipset rule, the ipset is created without timeout support. The fw3 code checks for "timeout > 0" and therefor ignores the timeout option while a timeout value of zero is actually valid for ipsets and stands for "indefinite".

expected:
making an ipset firewall rule with //option timeout 0// creates an ipset with timeout support.

device: all (tested on NanoPi R4S)
openwrt version: 21.02-rc4 (custom build), current trunk is also affected

example snippet from /etc/config/firewall

config ipset
option name 'ssh-access'
option match 'src_net'
option family 'ipv6'
option storage 'hash'
option timeout '0'
option loadfile '/etc/ipset/ssh-access.list'

config rule
option src 'wan'
option ipset 'ssh-access'
option dest_port '22'
option proto 'tcp'
option target 'ACCEPT'
option name 'Allow-External-SSH-ipset'
option family 'ipv6'

Current workaround:

  • set the timeout to any value > 0
  • append " timeout 0" to all entries in the file loaded by loadfile
@openwrt-bot
Copy link
Author

ldir:

Would you like to test a proposed fix from my staging tree?

https://git.openwrt.org/?p=openwrt/staging/ldir.git;a=commit;h=c2035b35efbf20f0f87448d5c896f6bba2d09acf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant