Skip to content

Commit

Permalink
[filter-fdb] Fix For Vlan Defined With No CIDR (sonic-net#976)
Browse files Browse the repository at this point in the history
VLAN_INTERFACE section in Config_db may contain entries with no CIDR.
This fix skip those entries.

signed-off-by: Tamer Ahmed <tamer.ahmed@microsoft.com>
  • Loading branch information
tahmed-dev authored Jul 11, 2020
1 parent bf62305 commit fad6ad5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions scripts/filter_fdb_entries.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ def get_vlan_cidr_map(filename):
vlan_cidr = defaultdict()
if "VLAN_INTERFACE" in config_db_entries.keys() and "VLAN" in config_db_entries.keys():
for vlan_key in config_db_entries["VLAN_INTERFACE"].keys():
if '|' not in vlan_key:
continue
vlan, cidr = tuple(vlan_key.split('|'))
if vlan in config_db_entries["VLAN"]:
vlan_cidr[vlan] = ip_interface(cidr).network
Expand Down
1 change: 1 addition & 0 deletions sonic-utilities-tests/filter_fdb_input/test_vectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@
"Vlan1000": {}
},
"VLAN_INTERFACE": {
"Vlan1000": {},
"Vlan1000|192.168.128.1/21": {}
},
},
Expand Down

0 comments on commit fad6ad5

Please sign in to comment.