When forming the device and subnet define name, prepend zone name with
an underscore in case it starts with a digit in order to avoid generating
invalid syntax.
Ref: https://github.com/openwrt/openwrt/issues/10693
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
#
{% for (let zone in fw4.zones()): %}
- define {{ zone.name }}_devices = {{ fw4.set(zone.match_devices, true) }}
- define {{ zone.name }}_subnets = {{ fw4.set(zone.match_subnets, true) }}
+ define {{ replace(zone.name, /^[0-9]/, '_$&') }}_devices = {{ fw4.set(zone.match_devices, true) }}
+ define {{ replace(zone.name, /^[0-9]/, '_$&') }}_subnets = {{ fw4.set(zone.match_subnets, true) }}
{% endfor %}