Alias group - Strange update
Describe the bug ALL alias group file dosen't update when we click Apply. We have to delete or change md5 sum file in /var/db/aliastables.
To Reproduce Steps to reproduce the behavior:
- Go to Firewall -> Aliases -> Add alias
- Name: IP_ALIAS1
- Type: host -Content: 192.168.0.10
- Go to Firewall -> Aliases -> Add alias
- Name: IP_ALIAS2
- Type: host -Content: 192.168.0.20
- Go to Firewall -> Aliases -> Add alias
- Name: IP_ALIAS_GOUP
- Type: host
-Content: IP_ALIAS1,IP_ALIAS2
Click Apply
File /var/db/aliastables/IP_ALIAS_GOUP.txt should contain two entries:
192.168.0.10
192.168.0.20
Now (remve IP_ALIAS2 from alias group): Go to Firewall -> Aliases -> IP_ALIAS_GOUP -> Change alias
- Content: IP_ALIAS1
- Click save and Apply
a) Go to Firewall -> Diagnostic -> pftable -> show -> IP_ALIAS_GOUP (should contain one entry)
b) File /var/db/aliastables/IP_ALIAS_GOUP.txt should contain one entry:
192.168.0.10
But still contains two (192.168.0.10,192.168.0.20)
To update IP_ALIAS_GOUP pftable we have to remove IP_ALIAS_GOUP.md5.txt or change md5 entries in this file (and then click aply) or after change IP_ALIAS_GOUP and clicking apply wait about 2-4 minutes.
The same happens when you add aliases to a exist group.
Expected behavior Correct update of the aliases group and pftables
Environment OPNsense Version: OPNsense 19.1.6-amd64 Clean install from OPNsense-19.1.4-OpenSSL-dvd-amd64.iso
@advcron thanks for the report, I've prepared a patch on master https://github.com/opnsense/core/commit/3dc5f7150337434d838c79260278b148fa1afda6. Since there are more changes stashed for the python 2->3 conversion, it probably won't fit the current stable version.
@AdSchellevis I run OPNsense 19.1.6-amd64 and this patch works. After click Aplay alias gorup update immediately.
Thank you very much for the patch