Skip to content

Commit

Permalink
[vnet_route_check] don't hardcode prefix length of /24 (sonic-net#1756)
Browse files Browse the repository at this point in the history
Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
  • Loading branch information
stepanblyschak authored Aug 13, 2021
1 parent 4175cb9 commit 7821a3f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scripts/vnet_route_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,9 @@ def filter_out_vnet_ip2me_routes(vnet_routes):
# rif_attrs[1] - IP prefix and prefix legth
# IP2ME routes have '/32' prefix length so replace it and add to the list
if rif_attrs[0] in vnet_intfs:
vnet_ip2me_routes.append(rif_attrs[1].replace('/24', '/32'))
rif_ip, _ = rif_attrs[1].split('/')
ip2me_route = rif_ip + '/32'
vnet_ip2me_routes.append(ip2me_route)

for vnet, vnet_attrs in vnet_routes.items():
for route in vnet_attrs['routes']:
Expand Down Expand Up @@ -240,7 +242,7 @@ def get_vnet_routes_from_asic_db():

vnet_vrfs = get_vrf_entries()
vnet_vrfs_oids = [vnet_vrfs[k] for k in vnet_vrfs]

vnet_intfs = get_vnet_intfs()

vrf_oid_to_vnet_map = {}
Expand Down

0 comments on commit 7821a3f

Please sign in to comment.