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 Dec 28, 2020
1 parent de14939 commit 7924bd1
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 @@ -166,7 +166,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 @@ -176,7 +176,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 7924bd1

Please sign in to comment.