Page MenuHomeVyOS Platform

firewall.py: 'type' Builtin was redeclared as a user variable
Open, NormalPublicBUG

Description

The 'type' builtin was replaced by a user variable, preventing the use of it as a type check. The offending block of code is this:

if 'add_address_to_group' in rule_conf:
    for type in ['destination_address', 'source_address']:
        if type in rule_conf['add_address_to_group']:
            if 'address_group' not in rule_conf['add_address_to_group'][type]:
                raise ConfigError(f'Dynamic address group must be defined.')
            else:
                target = rule_conf['add_address_to_group'][type]['address_group']
                fwall_group = 'ipv6_address_group' if family == 'ipv6' else 'address_group'
                group_obj = dict_search_args(firewall, 'group', 'dynamic_group', fwall_group, target)
                if group_obj is None:
                        raise ConfigError(f'Invalid dynamic address group on firewall rule')

Details

Version
1.5
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Bug (incorrect behavior)

Event Timeline

While not ideal, I don't see the built-in being used in that conf script?

While not ideal, I don't see the built-in being used in that conf script?

type will likely never be used directly inside any script, since type checks would more typically use isinstance, but type is useful when developing and debugging, which overriding the built-in breaks.

Viacheslav triaged this task as Normal priority.Mar 5 2026, 9:20 AM