luci-app-firewall: fix family display for port forwards

The underlying fw3 program currently only does IPv4 port forwards while
LuCI incorrectly reports IPv4 + IPv6 for each forward. Adjust the text
accordingly to fix this.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
Jo-Philipp Wich 2020-01-16 13:54:22 +01:00
parent a4f6cf8759
commit a178cdb5cf

View file

@ -43,7 +43,7 @@ function fmt(fmt /*, ...*/) {
function forward_proto_txt(s) {
return fmt('%s-%s',
fwtool.fmt_family(uci.get('firewall', s, 'family')),
fwtool.fmt_family('ipv4'),
fwtool.fmt_proto(uci.get('firewall', s, 'proto'),
uci.get('firewall', s, 'icmp_type')) || 'TCP+UDP');
}