diff options
-rw-r--r-- | python/vyos/ifconfig/vxlan.py | 7 | ||||
-rwxr-xr-x | src/op_mode/dhcp.py | 3 |
2 files changed, 7 insertions, 3 deletions
diff --git a/python/vyos/ifconfig/vxlan.py b/python/vyos/ifconfig/vxlan.py index bdb48e303..918aea202 100644 --- a/python/vyos/ifconfig/vxlan.py +++ b/python/vyos/ifconfig/vxlan.py @@ -138,10 +138,13 @@ class VXLANIf(Interface): raise ValueError('Value out of range') if 'vlan_to_vni_removed' in self.config: - cur_vni_filter = get_vxlan_vni_filter(self.ifname) + cur_vni_filter = None + if dict_search('parameters.vni_filter', self.config) != None: + cur_vni_filter = get_vxlan_vni_filter(self.ifname) + for vlan, vlan_config in self.config['vlan_to_vni_removed'].items(): # If VNI filtering is enabled, remove matching VNI filter - if dict_search('parameters.vni_filter', self.config) != None: + if cur_vni_filter != None: vni = vlan_config['vni'] if vni in cur_vni_filter: self._cmd(f'bridge vni delete dev {self.ifname} vni {vni}') diff --git a/src/op_mode/dhcp.py b/src/op_mode/dhcp.py index 54d492cda..3229da4ad 100755 --- a/src/op_mode/dhcp.py +++ b/src/op_mode/dhcp.py @@ -47,7 +47,8 @@ def _utc_to_local(utc_dt): return datetime.fromtimestamp((datetime.fromtimestamp(utc_dt) - datetime(1970, 1, 1)).total_seconds()) -def _format_hex_string(in_str): +def _format_hex_string(in_bytes): + in_str = bytes(in_bytes).hex() out_str = "" # if input is divisible by 2, add : every 2 chars if len(in_str) > 0 and len(in_str) % 2 == 0: |