Skip to content

Commit

Permalink
[route_check]: ignore routes pointing to Loopback interface (sonic-ne…
Browse files Browse the repository at this point in the history
…t#1337)

orchagent ignore all routes pointing to Loopback interfaces.
add this skip logic in route check.

sonic-net/sonic-swss#1570

Signed-off-by: Guohan Lu <lguohan@gmail.com>
  • Loading branch information
lguohan authored and renukamanavalan committed Feb 12, 2021
1 parent 603ac53 commit cb033f1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/route_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def get_interfaces():

def filter_out_local_interfaces(keys):
rt = []
local_if = set(['eth0', 'lo', 'docker0'])
local_if_re = ['eth0', 'lo', 'docker0', 'Loopback\d+']

db = ConfigDBConnector()
db.db_connect('APPL_DB')
Expand All @@ -173,7 +173,7 @@ def filter_out_local_interfaces(keys):
if not e:
# Prefix might have been added. So try w/o it.
e = db.get_entry('ROUTE_TABLE', k.split("/")[0])
if not e or (e['ifname'] not in local_if):
if not e or all([not re.match(x, e['ifname']) for x in local_if_re]):
rt.append(k)

return rt
Expand Down

0 comments on commit cb033f1

Please sign in to comment.